dsl Namespace
Definition
namespace simaai::neat::graph::dsl { ... }
Classes Index
| struct | PortRef |
| struct | NodeRef |
Operators Index
| NodeRef | operator>> (const NodeRef &from, const NodeRef &to) |
| NodeRef | operator>> (const PortRef &from, const NodeRef &to) |
| NodeRef | operator>> (const NodeRef &from, const PortRef &to) |
| NodeRef | operator>> (const PortRef &from, const PortRef &to) |
Functions Index
| NodeRef | ref (Graph &g, NodeId id) |
| NodeRef | add (Graph &g, Graph::NodePtr node) |
| bool | has_port (const std::vector< PortDesc > &ports, const std::string &name) |
| void | ensure_graph (const Graph *g, const char *what) |
| const std::shared_ptr< Node > & | get_node (const Graph *g, NodeId id, const char *what) |
| void | connect_ports (const PortRef &from, const PortRef &to) |
Operators
operator>>()
Definition at line 138 of file GraphDsl.h.
138inline NodeRef operator>>(const NodeRef& from, const NodeRef& to) {
139 connect_ports(from.out(), to.in());
140 return to;
141}
operator>>()
Definition at line 143 of file GraphDsl.h.
143inline NodeRef operator>>(const PortRef& from, const NodeRef& to) {
144 connect_ports(from, to.in());
145 return to;
146}
operator>>()
Definition at line 148 of file GraphDsl.h.
148inline NodeRef operator>>(const NodeRef& from, const PortRef& to) {
149 connect_ports(from.out(), to);
151}
operator>>()
Definition at line 153 of file GraphDsl.h.
153inline NodeRef operator>>(const PortRef& from, const PortRef& to) {
154 connect_ports(from, to);
156}
Functions
add()
| inline |
Definition at line 46 of file GraphDsl.h.
connect_ports()
Definition at line 123 of file GraphDsl.h.
123inline void connect_ports(const PortRef& from, const PortRef& to) {
124 ensure_graph(from.g, "connect_ports(from)");
125 ensure_graph(to.g, "connect_ports(to)");
127 throw std::runtime_error("GraphDsl: cannot connect ports from different graphs");
128 }
129 if (!from.is_output) {
130 throw std::runtime_error("GraphDsl: left side is not an output port");
131 }
132 if (to.is_output) {
133 throw std::runtime_error("GraphDsl: right side is not an input port");
134 }
136}
ensure_graph()
| inline |
Definition at line 58 of file GraphDsl.h.
58inline void ensure_graph(const Graph* g, const char* what) {
59 if (!g)
60 throw std::runtime_error(std::string("GraphDsl: null graph in ") + what);
61}
get_node()
has_port()
| inline |
Definition at line 50 of file GraphDsl.h.
ref()
The documentation for this namespace was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.