43 typedef std::string ElementID;
44 static const ElementID DefaultElementID;
53 explicit Element(
const ElementID&
id,
bool _init =
false ): myid(
id),init_out(_init) {};
63 virtual void setIn(
size_t num,
long value ) = 0;
64 virtual long getOut()
const = 0;
66 ElementID getId()
const;
68 virtual std::string getType()
const
73 virtual std::shared_ptr<Element> find(
const ElementID&
id );
75 virtual void addChildOut( std::shared_ptr<Element>& el,
size_t in_num );
76 virtual void delChildOut( std::shared_ptr<Element>& el );
77 size_t outCount()
const;
79 virtual void addInput(
size_t num,
long value = 0 );
80 virtual void delInput(
size_t num );
81 size_t inCount()
const;
83 friend std::ostream& operator<<(std::ostream& os,
const Element& el );
84 friend std::ostream& operator<<(std::ostream& os,
const std::shared_ptr<Element>& el );
87 Element(): myid(DefaultElementID) {};
91 ChildInfo(std::shared_ptr<Element> e,
size_t n):
95 std::shared_ptr<Element> el;
99 typedef std::vector<ChildInfo> OutputList;
101 virtual void setChildOut();
105 InputInfo(): num(0), value(0), type(unknown) {}
106 InputInfo(
size_t n,
long v): num(n), value(v), type(unknown) {}
112 typedef std::vector<InputInfo> InputList;