![]() |
chigraph
master
Systems programming language written for beginners in LLVM
|
An instance of a node. More...
#include <chi/NodeInstance.hpp>
Public Member Functions | |
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. More... | |
NodeInstance (NodeInstance &&)=default | |
Move constructor. | |
NodeInstance (const NodeInstance &other, boost::uuids::uuid id=boost::uuids::random_generator()()) | |
Copy constructor. | |
~NodeInstance () | |
Destructor. | |
Context & | context () const |
Get the containing Context object. More... | |
GraphFunction & | function () const |
Get the containing GraphFunction. More... | |
boost::uuids::uuid | id () const |
Get the ID of the instance, unique to the graph. More... | |
GraphModule & | module () const |
Get the containing GraphModule. More... | |
void | setType (std::unique_ptr< NodeType > newType) |
Set the type of the node instance. More... | |
void | setX (float newX) |
Set the X location of the instance. More... | |
void | setY (float newY) |
Set the Y location of the instance. More... | |
std::string | stringId () const |
Get the ID as a string. More... | |
NodeType & | type () |
Get the type of the instance. More... | |
const NodeType & | type () const |
Get the type of the instance, const version. More... | |
float | x () const |
Get the X location of the instance. More... | |
float | y () const |
Get the Y location of the instance. More... | |
Public Attributes | |
std::vector< std::pair< NodeInstance *, size_t > > | inputDataConnections |
The connections that go into this node, data. | |
std::vector< std::vector< std::pair< NodeInstance *, size_t > > > | inputExecConnections |
The connections that lead to this node, exec. | |
std::vector< std::vector< std::pair< NodeInstance *, size_t > > > | outputDataConnections |
The connections that lead out of this node, data. | |
std::vector< std::pair< NodeInstance *, size_t > > | outputExecConnections |
The connections that go out of this node, exec. | |
An instance of a node.
Definition at line 19 of file NodeInstance.hpp.
chi::NodeInstance::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.
func | The function this nodeInstance belongs to |
nodeType | The type that the node is |
posX | The X location of the node |
posY | The Y location of the node |
nodeID | The unique ID for the node |
Definition at line 14 of file NodeInstance.cpp.
References inputDataConnections, inputExecConnections, outputDataConnections, outputExecConnections, and type().
|
inline |
Get the containing Context object.
Definition at line 87 of file NodeInstance.hpp.
Referenced by chi::NodeCompiler::context().
|
inline |
Get the containing GraphFunction.
Definition at line 91 of file NodeInstance.hpp.
Referenced by chi::connectData(), chi::connectExec(), chi::disconnectData(), chi::FunctionCompiler::getOrCreateNodeCompiler(), chi::Debugger::inspectNodeOutput(), chi::FunctionCompiler::nodeCompiler(), and chi::FunctionCompiler::nodeLineNumber().
|
inline |
Get the ID of the instance, unique to the graph.
Definition at line 64 of file NodeInstance.hpp.
Referenced by chi::GraphFunction::removeNode(), and setType().
|
inline |
Get the containing GraphModule.
Definition at line 95 of file NodeInstance.hpp.
References chi::connectData(), chi::connectExec(), chi::disconnectData(), and chi::disconnectExec().
Referenced by chi::connectData(), chi::connectExec(), chi::disconnectData(), chi::disconnectExec(), chi::lineNumberFromNode(), chi::Debugger::setBreakpoint(), and setType().
void chi::NodeInstance::setType | ( | std::unique_ptr< NodeType > | newType | ) |
Set the type of the node instance.
newType | The new type |
Definition at line 56 of file NodeInstance.cpp.
References chi::NodeType::dataInputs(), chi::NodeType::dataOutputs(), chi::disconnectData(), chi::disconnectExec(), id(), inputDataConnections, inputExecConnections, module(), outputDataConnections, outputExecConnections, type(), and chi::ChiModule::updateLastEditTime().
|
inline |
Set the X location of the instance.
newX | The new X coordinate |
Definition at line 58 of file NodeInstance.hpp.
|
inline |
Set the Y location of the instance.
newY | The new Y coordinate |
Definition at line 61 of file NodeInstance.hpp.
|
inline |
Get the ID as a string.
Definition at line 68 of file NodeInstance.hpp.
Referenced by chi::disconnectData(), chi::disconnectExec(), chi::Debugger::inspectNodeOutput(), chi::NodeCompiler::NodeCompiler(), chi::Debugger::setBreakpoint(), and chi::validateFunctionConnectionsAreTwoWay().
|
inline |
Get the type of the instance.
Definition at line 46 of file NodeInstance.hpp.
Referenced by chi::NodeCompiler::compile_stage2(), chi::connectData(), chi::connectExec(), chi::disconnectData(), chi::disconnectExec(), chi::NodeCompiler::NodeCompiler(), NodeInstance(), chi::NodeCompiler::pure(), setType(), and chi::validateFunctionConnectionsAreTwoWay().
|
inline |
Get the type of the instance, const version.
Definition at line 49 of file NodeInstance.hpp.
|
inline |
Get the X location of the instance.
Definition at line 52 of file NodeInstance.hpp.
Referenced by NodeInstance().
|
inline |
Get the Y location of the instance.
Definition at line 55 of file NodeInstance.hpp.