-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream.h
38 lines (27 loc) · 850 Bytes
/
stream.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef STREAM_H
#define STREAM_H
#include <vector>
#include <string>
class Object;
class Stream
{
public:
Stream()
{}
Stream *apply_to(Object *func); // this -> func
Stream *apply_from(Object *func); // this <- func
void flow_from(Object *func); // this <= func
void set_applies_to(Stream *stream, Stream *out); // this -> func
void set_applies_from(Stream *stream, Stream *out); // this <- func
void set_flows_to(Stream *stream); // this => func
void set_flows_from(Stream *stream); // this <= func
std::vector<Object*> &get_vector() {return funcs;}
std::string to_string();
protected:
std::vector<Object*> funcs;
std::vector<Stream*> applies_to;
std::vector<Stream*> applies_from;
std::vector<Stream*> flows_to;
enum {Copy, ReturnRef, FlowRef} refs;
};
#endif // STREAM_H