NodeRef Struct
Declaration
struct simaai::neat::graph::dsl::NodeRef { ... }
Included Headers
#include <GraphDsl.h>
Public Operators Index
| operator NodeId () const | |
| PortRef | operator[] (const std::string &name) const |
| PortRef | operator[] (const char *name) const |
Public Member Functions Index
| PortRef | out () const |
| PortRef | out (const std::string &name) const |
| PortRef | in () const |
| PortRef | in (const std::string &name) const |
Public Member Attributes Index
| Graph * | g = nullptr |
| NodeId | id = kInvalidNode |
Definition at line 24 of file GraphDsl.h.
Public Operators
operator NodeId()
| inline |
Definition at line 28 of file GraphDsl.h.
operator[]()
| inline |
Definition at line 36 of file GraphDsl.h.
105inline PortRef NodeRef::operator[](const std::string& name) const {
107 const auto in_ports = node->input_ports();
108 const auto out_ports = node->output_ports();
109 const bool has_in = has_port(in_ports, name);
110 const bool has_out = has_port(out_ports, name);
111
112 if (has_out && !has_in)
113 return out(name);
114 if (has_in && !has_out)
115 return in(name);
116
117 if (!has_in && !has_out) {
118 throw std::runtime_error("GraphDsl: unknown port: " + name);
119 }
120 throw std::runtime_error("GraphDsl: ambiguous port name (use .in or .out): " + name);
121}
operator[]()
| inline |
Definition at line 37 of file GraphDsl.h.
Public Member Functions
in()
| inline |
Definition at line 34 of file GraphDsl.h.
in()
| inline |
Definition at line 35 of file GraphDsl.h.
96inline PortRef NodeRef::in(const std::string& name) const {
98 const auto ports = node->input_ports();
99 if (!has_port(ports, name)) {
100 throw std::runtime_error("GraphDsl: unknown input port: " + name);
101 }
102 return PortRef{g, id, g->intern_port(name), false};
103}
out()
| inline |
Definition at line 32 of file GraphDsl.h.
out()
| inline |
Definition at line 33 of file GraphDsl.h.
78inline PortRef NodeRef::out(const std::string& name) const {
80 const auto ports = node->output_ports();
81 if (!has_port(ports, name)) {
82 throw std::runtime_error("GraphDsl: unknown output port: " + name);
83 }
84 return PortRef{g, id, g->intern_port(name), true};
85}
Public Member Attributes
g
|
Definition at line 25 of file GraphDsl.h.
id
|
Definition at line 26 of file GraphDsl.h.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.