chigraph  master
Systems programming language written for beginners in LLVM
chi::NodeInstance Struct Reference

An instance of a node. More...

#include <chi/NodeInstance.hpp>

+ Collaboration diagram for chi::NodeInstance:

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.
 
Contextcontext () const
 Get the containing Context object. More...
 
GraphFunctionfunction () const
 Get the containing GraphFunction. More...
 
boost::uuids::uuid id () const
 Get the ID of the instance, unique to the graph. More...
 
GraphModulemodule () 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...
 
NodeTypetype ()
 Get the type of the instance. More...
 
const NodeTypetype () 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.
 

Detailed Description

An instance of a node.

Definition at line 19 of file NodeInstance.hpp.

Constructor & Destructor Documentation

◆ NodeInstance()

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.

Parameters
funcThe function this nodeInstance belongs to
nodeTypeThe type that the node is
posXThe X location of the node
posYThe Y location of the node
nodeIDThe unique ID for the node

Definition at line 14 of file NodeInstance.cpp.

References inputDataConnections, inputExecConnections, outputDataConnections, outputExecConnections, and type().

+ Here is the call graph for this function:

Member Function Documentation

◆ context()

Context& chi::NodeInstance::context ( ) const
inline

Get the containing Context object.

Returns
The Context

Definition at line 87 of file NodeInstance.hpp.

Referenced by chi::NodeCompiler::context().

+ Here is the caller graph for this function:

◆ function()

GraphFunction& chi::NodeInstance::function ( ) const
inline

Get the containing GraphFunction.

Returns
The Function this node belongs to

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().

+ Here is the caller graph for this function:

◆ id()

boost::uuids::uuid chi::NodeInstance::id ( ) const
inline

Get the ID of the instance, unique to the graph.

Returns
The ID

Definition at line 64 of file NodeInstance.hpp.

Referenced by chi::GraphFunction::removeNode(), and setType().

+ Here is the caller graph for this function:

◆ module()

GraphModule& chi::NodeInstance::module ( ) const
inline

Get the containing GraphModule.

Returns
The GraphModule this node belongs to

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setType()

void chi::NodeInstance::setType ( std::unique_ptr< NodeType newType)

Set the type of the node instance.

Parameters
newTypeThe 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().

+ Here is the call graph for this function:

◆ setX()

void chi::NodeInstance::setX ( float  newX)
inline

Set the X location of the instance.

Parameters
newXThe new X coordinate

Definition at line 58 of file NodeInstance.hpp.

◆ setY()

void chi::NodeInstance::setY ( float  newY)
inline

Set the Y location of the instance.

Parameters
newYThe new Y coordinate

Definition at line 61 of file NodeInstance.hpp.

◆ stringId()

std::string chi::NodeInstance::stringId ( ) const
inline

Get the ID as a string.

Returns
String representation of the id

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().

+ Here is the caller graph for this function:

◆ type() [1/2]

NodeType& chi::NodeInstance::type ( )
inline

Get the type of the instance.

Returns
The type

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().

+ Here is the caller graph for this function:

◆ type() [2/2]

const NodeType& chi::NodeInstance::type ( ) const
inline

Get the type of the instance, const version.

Returns
The type

Definition at line 49 of file NodeInstance.hpp.

◆ x()

float chi::NodeInstance::x ( ) const
inline

Get the X location of the instance.

Returns
The X coordinate

Definition at line 52 of file NodeInstance.hpp.

Referenced by NodeInstance().

+ Here is the caller graph for this function:

◆ y()

float chi::NodeInstance::y ( ) const
inline

Get the Y location of the instance.

Returns
The Y coordinate

Definition at line 55 of file NodeInstance.hpp.


The documentation for this struct was generated from the following files: