4 #ifndef CHI_NODE_INSTANCE_HPP 5 #define CHI_NODE_INSTANCE_HPP 13 #include <boost/uuid/uuid.hpp> 14 #include <boost/uuid/uuid_generators.hpp> 15 #include <boost/uuid/uuid_io.hpp> 28 boost::uuids::uuid nodeID = boost::uuids::random_generator()());
38 boost::uuids::uuid
id = boost::uuids::random_generator()());
42 void setType(std::unique_ptr<NodeType> newType);
52 float x()
const {
return mX; }
55 float y()
const {
return mY; }
58 void setX(
float newX) { mX = newX; }
61 void setY(
float newY) { mY = newY; }
64 boost::uuids::uuid
id()
const {
return mId; }
68 std::string
stringId()
const {
return boost::uuids::to_string(
id()); }
98 std::unique_ptr<NodeType> mType;
103 boost::uuids::uuid mId;
150 #endif // CHI_NODE_INSTANCE_HPP std::vector< std::vector< std::pair< NodeInstance *, size_t > > > inputExecConnections
The connections that lead to this node, exec.
this is an AST-like representation of a function in a graph It is used for IDE-like behavior...
Forward declares all the chigraph data types.
void setType(std::unique_ptr< NodeType > newType)
Set the type of the node instance.
std::string stringId() const
Get the ID as a string.
std::vector< std::vector< std::pair< NodeInstance *, size_t > > > outputDataConnections
The connections that lead out of this node, data.
NodeType & type()
Get the type of the instance.
std::vector< std::pair< NodeInstance *, size_t > > inputDataConnections
The connections that go into this node, data.
GraphModule & module() const
Get the containing GraphModule.
NodeInstance(GraphFunction *func, std::unique_ptr< NodeType > nodeType, float posX, float posY, boost::uuids::uuid nodeID=boost::uuids::random_generator()())
Construct a nodeinstace with a type location and an ID, usually called from GraphFunction::insertNode...
The class that handles the loading, creation, storing, and compilation of modules It also stores a LL...
void setY(float newY)
Set the Y location of the instance.
~NodeInstance()
Destructor.
Result disconnectData(NodeInstance &lhs, size_t lhsConnID, NodeInstance &rhs)
Disconnect a data connection.
Result connectData(NodeInstance &lhs, size_t lhsConnID, NodeInstance &rhs, size_t rhsConnID)
Connects two nodes' data connections.
Result connectExec(NodeInstance &lhs, size_t lhsConnID, NodeInstance &rhs, size_t rhsConnID)
Connects two nodes' exec connections.
std::vector< std::pair< NodeInstance *, size_t > > outputExecConnections
The connections that go out of this node, exec.
Module that holds graph functions.
Result disconnectExec(NodeInstance &lhs, size_t lhsConnID)
Disconnect a exec connection.
float x() const
Get the X location of the instance.
The namespace where chigraph lives.
Context & context() const
Get the containing Context object.
const NodeType & type() const
Get the type of the instance, const version.
boost::uuids::uuid id() const
Get the ID of the instance, unique to the graph.
The result object, used for identifiying errors with good diagnostics.
void setX(float newX)
Set the X location of the instance.
float y() const
Get the Y location of the instance.