Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.29
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Ra::Dataflow::Core::Node Class Referenceabstract

Base abstract class for all the nodes added and used by the node system. More...

#include <Dataflow/Core/Node.hpp>

+ Inheritance diagram for Ra::Dataflow::Core::Node:
+ Collaboration diagram for Ra::Dataflow::Core::Node:

Public Types

using PortIndex = Ra::Core::Utils::Index
 
template<typename Port >
using PortCollection = std::vector<Port>
 
template<typename Port >
using PortPtr = std::shared_ptr<Port>
 
template<typename Port >
using PortRawPtr = Port*
 
template<typename Type >
using PortInPtr = PortPtr<PortIn<Type>>
 
template<typename Type >
using PortInRawPtr = PortIn<Type>*
 
template<typename Type >
using PortOutPtr = PortPtr<PortOut<Type>>
 
template<typename Type >
using PortOutRawPtr = PortOut<Type>*
 
using PortBasePtr = PortPtr<PortBase>
 
using PortBaseRawPtr = PortRawPtr<PortBase>
 
using PortBaseCollection = PortCollection<PortBasePtr>
 
using PortBaseInPtr = PortPtr<PortBaseIn>
 
using PortBaseInRawPtr = PortRawPtr<PortBaseIn>
 
using PortBaseInCollection = PortCollection<PortBaseInPtr>
 
using PortBaseOutPtr = PortPtr<PortBaseOut>
 
using PortBaseOutRawPtr = PortRawPtr<PortBaseOut>
 
using PortBaseOutCollection = PortCollection<PortBaseOutPtr>
 
template<typename Port >
using IndexAndPort = std::pair<PortIndex, Port>
 
template<typename T >
using ParamHandle = Ra::Core::VariableSet::VariableHandle<T>
 

Public Member Functions

virtual ~Node ()=default
 make Node a base abstract class
 
bool operator== (const Node &node)
 Two nodes are considered equal if there model and instance names are the same.
 
void add_metadata (const nlohmann::json &data)
 Add a metadata to the node to store application specific information.
 
const nlohmann::json & metadata ()
 Give access to extra json data stored on the node.
 
bool is_initialized () const
 
Ra::Core::VariableSetparameters ()
 Return node's parameters.
 
Ra::Core::VariableSetinput_variables ()
 Return a variable set of input ports default value reference, if any.
 
bool is_output ()
 Node is output if none of the output ports is linked.
 
bool is_input ()
 Node is input if all input ports have default values and not linked.
 
Constructors
 Node (const Node &)=delete
 
Nodeoperator= (const Node &)=delete
 
Function execution control
virtual void init ()
 Initializes the node content.
 
virtual bool compile ()
 Compile the node to check its validity.
 
virtual bool execute ()=0
 Executes the node.
 
virtual void destroy ()
 Delete the node's content.
 
Control the interfaces of the nodes (inputs, outputs, internal data, ...)
auto port_by_name (const std::string &type, const std::string &name) const -> IndexAndPort< PortBaseRawPtr >
 Get a port by its name.
 
auto input_by_name (const std::string &name) const -> IndexAndPort< PortBaseInRawPtr >
 Convenience alias to port_by_name("in", name)
 
auto output_by_name (const std::string &name) const -> IndexAndPort< PortBaseOutRawPtr >
 Convenience alias to port_by_name("out", name)
 
PortBaseRawPtr port_by_index (const std::string &type, PortIndex index) const
 Get a port by its index.
 
auto input_by_index (PortIndex index) const
 Convenience alias to port_by_index("in", index)
 
auto output_by_index (PortIndex index) const
 Convenience alias to port_by_index("out", index)
 
template<typename T >
auto input_by_index (PortIndex index) const
 Convenience alias with typed port.
 
template<typename T >
auto output_by_index (PortIndex index) const
 Convenience alias with typed port.
 
const PortBaseInCollectioninputs () const
 Gets the in ports of the node.
 
const PortBaseOutCollectionoutputs () const
 Gets the out ports of the node.
 
Identification methods
const std::stringmodel_name () const
 Gets the model (type/class) name of the node.
 
const std::stringdisplay_name () const
 Gets the display name of the node (e.g. for gui), no need to be unique in a graph.
 
void set_display_name (const std::string &name)
 Set the display name.
 
const std::stringinstance_name () const
 Gets the instance name of the node.
 
void set_instance_name (const std::string &name)
 Sets the instance name the node (unused?) instance name must be unique in a graph.
 
Serialization of a node
Todo

specify the json format for nodes and what is expected from the following methods

use standardize json serialization

void toJson (nlohmann::json &data) const
 Serialize the content of the node.
 
bool fromJson (const nlohmann::json &data)
 Unserialized the content of the node.
 

Protected Member Functions

 Node (const std::string &instance, const std::string &typeName)
 Construct the base node given its name and type.
 
template<typename PortType >
auto port_by_name (const PortCollection< PortPtr< PortType > > &ports, const std::string &name) const -> IndexAndPort< PortRawPtr< PortType > >
 Gets the Port By Name.
 
template<typename PortType >
auto port_base (const PortCollection< PortPtr< PortType > > &ports, PortIndex idx) const -> PortRawPtr< PortType >
 Gets the PortBase In or Out by its index.
 
template<typename T , typename PortType >
auto port (const PortCollection< PortPtr< PortType > > &ports, PortIndex index) const
 Gets a port in a collection by its index.
 
virtual bool fromJsonInternal (const nlohmann::json &data)
 Internal json representation of the Node.
 
virtual void toJsonInternal (nlohmann::json &data) const
 Internal json representation of the Node.
 
template<typename PortType >
PortIndex add_port (PortCollection< PortPtr< PortType > > &, PortPtr< PortType > port)
 Adds a port to port collection.
 
PortIndex add_input (PortBaseInPtr in)
 Convenience alias to add_port(inputs(), in)
 
PortIndex add_output (PortBaseOutPtr out)
 Convenience alias to add_port(outputs(), out)
 
template<typename T , typename... U>
auto add_input (U &&... u)
 Adds a typed input port.
 
template<typename T , typename... U>
auto add_output (U &&... u)
 Adds a typed output port.
 
template<typename T >
auto input_port (PortIndex index)
 Gets a typed (input/output) port.
 
template<typename T >
auto output_port (PortIndex index)
 Gets a typed (input/output) port.
 
void remove_input (PortIndex index)
 Remove the given port from the managed (input/output) ports.
 
void remove_output (PortIndex index)
 Remove the given port from the managed (input/output) ports.
 
template<typename T >
auto add_parameter (const std::string &name, const T &value)
 
template<typename T >
bool remove_parameter (const std::string &name)
 
template<typename T >
bool remove_parameter (ParamHandle< T > &handle)
 

Protected Attributes

bool m_initialized { false }
 Flag that checks if the node is already initialized.
 
std::string m_model_name
 The type name of the node. Initialized once at construction.
 
std::string m_instance_name
 The instance name of the node.
 
std::string m_display_name { "" }
 Node's name if needed for display.
 
PortCollection< PortPtr< PortBaseIn > > m_inputs
 The in ports of the node (own by the node)
 
PortCollection< PortPtr< PortBaseOut > > m_outputs
 The out ports of the node (own by the node)
 
Ra::Core::VariableSet m_parameters
 The editable parameters of the node.
 
Ra::Core::VariableSet m_input_variables
 
nlohmann::json m_metadata
 Additional data on the node, added by application or gui or ...
 

Detailed Description

Base abstract class for all the nodes added and used by the node system.

A node represent a function acting on some input data and generating some outputs. To build a computation graph, nodes should be added to the graph, which is itself a node (

See also
Ra::Dataflow::Core::DataflowGraph) and linked together through their input/output port.

Nodes computes their function using the input data collecting from the input ports, in an evaluation context (possibly empty) defined by their internal data to generate results sent to their output ports.

Derived class must implement bool execute() and static const std::string & node_typename()

static const std::string& node_typename() returns the demangled type name of the node or any human readable representation of the type name. This is a public static member each node concrete class must define to be serializable. Since we want to manipulate Node*, CRTP is not an option here.

Definition at line 39 of file Node.hpp.

Member Typedef Documentation

◆ IndexAndPort

template<typename Port >
using Ra::Dataflow::Core::Node::IndexAndPort = std::pair<PortIndex, Port>

Definition at line 75 of file Node.hpp.

◆ ParamHandle

template<typename T >
using Ra::Dataflow::Core::Node::ParamHandle = Ra::Core::VariableSet::VariableHandle<T>

Definition at line 78 of file Node.hpp.

◆ PortBaseCollection

◆ PortBaseInCollection

◆ PortBaseInPtr

Definition at line 66 of file Node.hpp.

◆ PortBaseInRawPtr

using Ra::Dataflow::Core::Node::PortBaseInRawPtr = PortRawPtr<PortBaseIn>

Definition at line 67 of file Node.hpp.

◆ PortBaseOutCollection

◆ PortBaseOutPtr

Definition at line 70 of file Node.hpp.

◆ PortBaseOutRawPtr

using Ra::Dataflow::Core::Node::PortBaseOutRawPtr = PortRawPtr<PortBaseOut>

Definition at line 71 of file Node.hpp.

◆ PortBasePtr

Definition at line 62 of file Node.hpp.

◆ PortBaseRawPtr

using Ra::Dataflow::Core::Node::PortBaseRawPtr = PortRawPtr<PortBase>

Definition at line 63 of file Node.hpp.

◆ PortCollection

template<typename Port >
using Ra::Dataflow::Core::Node::PortCollection = std::vector<Port>

Definition at line 45 of file Node.hpp.

◆ PortIndex

using Ra::Dataflow::Core::Node::PortIndex = Ra::Core::Utils::Index

Definition at line 42 of file Node.hpp.

◆ PortInPtr

template<typename Type >
using Ra::Dataflow::Core::Node::PortInPtr = PortPtr<PortIn<Type>>

Definition at line 53 of file Node.hpp.

◆ PortInRawPtr

template<typename Type >
using Ra::Dataflow::Core::Node::PortInRawPtr = PortIn<Type>*

Definition at line 55 of file Node.hpp.

◆ PortOutPtr

template<typename Type >
using Ra::Dataflow::Core::Node::PortOutPtr = PortPtr<PortOut<Type>>

Definition at line 58 of file Node.hpp.

◆ PortOutRawPtr

template<typename Type >
using Ra::Dataflow::Core::Node::PortOutRawPtr = PortOut<Type>*

Definition at line 60 of file Node.hpp.

◆ PortPtr

template<typename Port >
using Ra::Dataflow::Core::Node::PortPtr = std::shared_ptr<Port>

Definition at line 48 of file Node.hpp.

◆ PortRawPtr

template<typename Port >
using Ra::Dataflow::Core::Node::PortRawPtr = Port*

Definition at line 50 of file Node.hpp.

Constructor & Destructor Documentation

◆ Node()

Ra::Dataflow::Core::Node::Node ( const std::string & instance,
const std::string & typeName )
protected

Construct the base node given its name and type.

Parameters
instanceNameThe name of the node, unique in a graph
typeNameThe type name of the node, from static typename() concrete node class.

Definition at line 12 of file Node.cpp.

Member Function Documentation

◆ add_input() [1/2]

Node::PortIndex Ra::Dataflow::Core::Node::add_input ( PortBaseInPtr in)
inlineprotected

Convenience alias to add_port(inputs(), in)

Definition at line 484 of file Node.hpp.

+ Here is the call graph for this function:

◆ add_input() [2/2]

template<typename T , typename... U>
auto Ra::Dataflow::Core::Node::add_input ( U &&... u)
inlineprotected

Adds a typed input port.

Template Parameters
TPort data type.
Parameters
uPort ctor parameter.
Returns
Typed port shared pointer.

Definition at line 340 of file Node.hpp.

+ Here is the call graph for this function:

◆ add_metadata()

void Ra::Dataflow::Core::Node::add_metadata ( const nlohmann::json & data)

Add a metadata to the node to store application specific information.

Merge/replace node's metadata using data. Used, e.g. by the node editor gui to save node position in the graphical canvas. To remove a field, set it to "null"_json == nullptr

Parameters
dataa json object containing metadata.

Definition at line 68 of file Node.cpp.

◆ add_output() [1/2]

Node::PortIndex Ra::Dataflow::Core::Node::add_output ( PortBaseOutPtr out)
inlineprotected

Convenience alias to add_port(outputs(), out)

Definition at line 488 of file Node.hpp.

+ Here is the call graph for this function:

◆ add_output() [2/2]

template<typename T , typename... U>
auto Ra::Dataflow::Core::Node::add_output ( U &&... u)
inlineprotected

Adds a typed output port.

Template Parameters
TPort data type.
Parameters
uPort ctor parameter.
Returns
Typed port shared pointer.

Definition at line 352 of file Node.hpp.

+ Here is the call graph for this function:

◆ add_parameter()

template<typename T >
auto Ra::Dataflow::Core::Node::add_parameter ( const std::string & name,
const T & value )
inlineprotected

Definition at line 387 of file Node.hpp.

◆ add_port()

template<typename PortType >
Node::PortIndex Ra::Dataflow::Core::Node::add_port ( PortCollection< PortPtr< PortType > > & ports,
PortPtr< PortType > port )
inlineprotected

Adds a port to port collection.

Parameters
portThe in port to add.
collPort collection (input or output)
Returns
The index of the inserted port.

Definition at line 468 of file Node.hpp.

+ Here is the call graph for this function:

◆ compile()

bool Ra::Dataflow::Core::Node::compile ( )
inlinevirtual

Compile the node to check its validity.

Only nodes defining a full computation graph will need to override this method. The base version do nothing.

Returns
the compilation status

Reimplemented in Ra::Dataflow::Core::DataflowGraph.

Definition at line 492 of file Node.hpp.

◆ destroy()

void Ra::Dataflow::Core::Node::destroy ( )
inlinevirtual

Delete the node's content.

The destroy() function is called once at the end of the lifetime of the node. Its goal is to free the internal data that have been allocated.

Reimplemented in Ra::Dataflow::Core::DataflowGraph.

Definition at line 432 of file Node.hpp.

+ Here is the call graph for this function:

◆ display_name()

const std::string & Ra::Dataflow::Core::Node::display_name ( ) const
inline

Gets the display name of the node (e.g. for gui), no need to be unique in a graph.

Definition at line 195 of file Node.hpp.

◆ execute()

◆ fromJson()

bool Ra::Dataflow::Core::Node::fromJson ( const nlohmann::json & data)

Unserialized the content of the node.

Fill the node from its json representation.

Todo
check model name ...

Definition at line 15 of file Node.cpp.

+ Here is the call graph for this function:

◆ fromJsonInternal()

bool Ra::Dataflow::Core::Node::fromJsonInternal ( const nlohmann::json & data)
protectedvirtual

Internal json representation of the Node.

Default implementation warn about unsupported deserialization. Effective deserialzation must be implemented by inheriting classes. Be careful with template specialization and function member overriding in derived classes.

Reimplemented in Customs::FilterSelector< T >, Ra::Dataflow::Core::DataflowGraph, Ra::Dataflow::Core::Functionals::BinaryOpNode< t_a, t_b, t_result >, Ra::Dataflow::Core::Functionals::FilterNode< coll_t, v_t >, Ra::Dataflow::Core::Functionals::ReduceNode< coll_t, v_t >, Ra::Dataflow::Core::Functionals::TransformNode< coll_t, v_t >, Ra::Dataflow::Core::Sinks::SinkNode< T >, Ra::Dataflow::Core::Sources::FunctionSourceNode< R, Args >, Ra::Dataflow::Core::Sources::SingleDataSourceNode< T >, and Ra::Dataflow::Rendering::Nodes::RenderingNode.

Definition at line 91 of file Node.cpp.

+ Here is the call graph for this function:

◆ init()

void Ra::Dataflow::Core::Node::init ( )
inlinevirtual

Initializes the node content.

The init() function should be called once at the beginning of the lifetime of the node by the owner of the node (the graph which contains the node). Its goal is to initialize the node's internal data if any. The default do nothing.

Reimplemented in Ra::Dataflow::Core::DataflowGraph, Ra::Dataflow::Core::Functionals::BinaryOpNode< t_a, t_b, t_result >, Ra::Dataflow::Core::Functionals::FilterNode< coll_t, v_t >, Ra::Dataflow::Core::Functionals::ReduceNode< coll_t, v_t >, Ra::Dataflow::Core::Functionals::TransformNode< coll_t, v_t >, and Ra::Dataflow::Core::Sinks::SinkNode< T >.

Definition at line 428 of file Node.hpp.

◆ input_by_index() [1/2]

auto Ra::Dataflow::Core::Node::input_by_index ( PortIndex index) const
inline

Convenience alias to port_by_index("in", index)

Definition at line 161 of file Node.hpp.

◆ input_by_index() [2/2]

template<typename T >
auto Ra::Dataflow::Core::Node::input_by_index ( PortIndex index) const
inline

Convenience alias with typed port.

Definition at line 166 of file Node.hpp.

◆ input_by_name()

auto Ra::Dataflow::Core::Node::input_by_name ( const std::string & name) const -> IndexAndPort<PortBaseInRawPtr>

Convenience alias to port_by_name("in", name)

Definition at line 78 of file Node.cpp.

◆ input_port()

template<typename T >
auto Ra::Dataflow::Core::Node::input_port ( PortIndex index)
inlineprotected

Gets a typed (input/output) port.

Template Parameters
TPort data type.
Parameters
indexThe (input or output) port index.
Returns
Typed port shared pointer or nullptr if index of removed port.

Definition at line 365 of file Node.hpp.

+ Here is the call graph for this function:

◆ input_variables()

Ra::Core::VariableSet & Ra::Dataflow::Core::Node::input_variables ( )
inline

Return a variable set of input ports default value reference, if any.

Definition at line 496 of file Node.hpp.

+ Here is the call graph for this function:

◆ inputs()

const Node::PortBaseInCollection & Ra::Dataflow::Core::Node::inputs ( ) const
inline

Gets the in ports of the node.

Input ports are own by the node.

Definition at line 455 of file Node.hpp.

◆ instance_name()

const std::string & Ra::Dataflow::Core::Node::instance_name ( ) const
inline

Gets the instance name of the node.

Definition at line 447 of file Node.hpp.

◆ is_initialized()

bool Ra::Dataflow::Core::Node::is_initialized ( ) const
inline

Definition at line 240 of file Node.hpp.

◆ is_input()

bool Ra::Dataflow::Core::Node::is_input ( )
inline

Node is input if all input ports have default values and not linked.

Definition at line 513 of file Node.hpp.

◆ is_output()

bool Ra::Dataflow::Core::Node::is_output ( )
inline

Node is output if none of the output ports is linked.

Definition at line 505 of file Node.hpp.

◆ metadata()

const nlohmann::json & Ra::Dataflow::Core::Node::metadata ( )
inline

Give access to extra json data stored on the node.

Definition at line 439 of file Node.hpp.

◆ model_name()

const std::string & Ra::Dataflow::Core::Node::model_name ( ) const
inline

Gets the model (type/class) name of the node.

Definition at line 443 of file Node.hpp.

◆ operator==()

bool Ra::Dataflow::Core::Node::operator== ( const Node & node)
inline

Two nodes are considered equal if there model and instance names are the same.

Definition at line 463 of file Node.hpp.

+ Here is the call graph for this function:

◆ output_by_index() [1/2]

auto Ra::Dataflow::Core::Node::output_by_index ( PortIndex index) const
inline

Convenience alias to port_by_index("out", index)

Definition at line 163 of file Node.hpp.

◆ output_by_index() [2/2]

template<typename T >
auto Ra::Dataflow::Core::Node::output_by_index ( PortIndex index) const
inline

Convenience alias with typed port.

Definition at line 171 of file Node.hpp.

◆ output_by_name()

auto Ra::Dataflow::Core::Node::output_by_name ( const std::string & name) const -> IndexAndPort<PortBaseOutRawPtr>

Convenience alias to port_by_name("out", name)

Definition at line 82 of file Node.cpp.

◆ output_port()

template<typename T >
auto Ra::Dataflow::Core::Node::output_port ( PortIndex index)
inlineprotected

Gets a typed (input/output) port.

Template Parameters
TPort data type.
Parameters
indexThe (input or output) port index.
Returns
Typed port shared pointer or nullptr if index of removed port.

Definition at line 371 of file Node.hpp.

+ Here is the call graph for this function:

◆ outputs()

const Node::PortBaseOutCollection & Ra::Dataflow::Core::Node::outputs ( ) const
inline

Gets the out ports of the node.

Output ports are own by the node.

Definition at line 459 of file Node.hpp.

◆ parameters()

Ra::Core::VariableSet & Ra::Dataflow::Core::Node::parameters ( )
inline

Return node's parameters.

Definition at line 243 of file Node.hpp.

◆ port()

template<typename T , typename PortType >
auto Ra::Dataflow::Core::Node::port ( const PortCollection< PortPtr< PortType > > & ports,
PortIndex index ) const
inlineprotected

Gets a port in a collection by its index.

Template Parameters
TThe contained type.
PortTypePortBaseIn or PortBaseOut
Parameters
portsThe port collection
idx
Returns
auto A raw ptr to the port typed in or out.

Definition at line 296 of file Node.hpp.

◆ port_base()

template<typename PortType >
auto Ra::Dataflow::Core::Node::port_base ( const PortCollection< PortPtr< PortType > > & ports,
PortIndex idx ) const -> PortRawPtr<PortType>
protected

Gets the PortBase In or Out by its index.

Template Parameters
PortTypePortBaseIn or PortBaseOut
Parameters
ports
idx
Returns
PortRawPtr<PortType>

Definition at line 538 of file Node.hpp.

◆ port_by_index()

PortBase * Ra::Dataflow::Core::Node::port_by_index ( const std::string & type,
PortIndex index ) const

Get a port by its index.

Parameters
typeeither "in" or "out", the directional type of the port
indexIndex of the port \in [0 get(Inputs|Output).size()[
Returns
a raw pointer on the requested port if it exists, nullptr else

Definition at line 86 of file Node.cpp.

+ Here is the call graph for this function:

◆ port_by_name() [1/2]

template<typename PortType >
auto Ra::Dataflow::Core::Node::port_by_name ( const PortCollection< PortPtr< PortType > > & ports,
const std::string & name ) const -> IndexAndPort<PortRawPtr<PortType>>
protected

Gets the Port By Name.

Template Parameters
PortTypePortBaseIn or PortBaseOut
Parameters
portsPort collection to search in.
nameThe named used to add the port.
Returns
IndexAndPort<PortRawPtr<PortType>> the index to access the port and a raw ptr to the port.

Definition at line 523 of file Node.hpp.

+ Here is the call graph for this function:

◆ port_by_name() [2/2]

auto Ra::Dataflow::Core::Node::port_by_name ( const std::string & type,
const std::string & name ) const -> IndexAndPort<PortBaseRawPtr>

Get a port by its name.

Parameters
typeeither "in" or "out", the directional type of the port
name
Returns
the index to access the port and a raw ptr to the port.

Definition at line 72 of file Node.cpp.

◆ remove_input()

void Ra::Dataflow::Core::Node::remove_input ( PortIndex index)
inlineprotected

Remove the given port from the managed (input/output) ports.

The port is reset, but the index might be used by a newly added port. Other port index remains valid.

Parameters
indexthe port to remove.

Definition at line 382 of file Node.hpp.

◆ remove_output()

void Ra::Dataflow::Core::Node::remove_output ( PortIndex index)
inlineprotected

Remove the given port from the managed (input/output) ports.

The port is reset, but the index might be used by a newly added port. Other port index remains valid.

Parameters
indexthe port to remove.

Definition at line 384 of file Node.hpp.

◆ remove_parameter() [1/2]

template<typename T >
bool Ra::Dataflow::Core::Node::remove_parameter ( const std::string & name)
inlineprotected

Definition at line 392 of file Node.hpp.

◆ remove_parameter() [2/2]

template<typename T >
bool Ra::Dataflow::Core::Node::remove_parameter ( ParamHandle< T > & handle)
inlineprotected

Definition at line 397 of file Node.hpp.

◆ set_display_name()

void Ra::Dataflow::Core::Node::set_display_name ( const std::string & name)
inline

Set the display name.

Definition at line 197 of file Node.hpp.

◆ set_instance_name()

void Ra::Dataflow::Core::Node::set_instance_name ( const std::string & name)
inline

Sets the instance name the node (unused?) instance name must be unique in a graph.

Definition at line 451 of file Node.hpp.

◆ toJson()

void Ra::Dataflow::Core::Node::toJson ( nlohmann::json & data) const

Serialize the content of the node.

Fill the given json object with the json representation of the concrete node.

Definition at line 50 of file Node.cpp.

+ Here is the call graph for this function:

◆ toJsonInternal()

void Ra::Dataflow::Core::Node::toJsonInternal ( nlohmann::json & data) const
protectedvirtual

Internal json representation of the Node.

Default implementation warn about unsupported deserialization. Effective deserialzation must be implemented by inheriting classes. Be careful with template specialization and function member overriding in derived classes.

Reimplemented in Customs::FilterSelector< T >, Ra::Dataflow::Core::DataflowGraph, Ra::Dataflow::Core::Functionals::BinaryOpNode< t_a, t_b, t_result >, Ra::Dataflow::Core::Functionals::FilterNode< coll_t, v_t >, Ra::Dataflow::Core::Functionals::ReduceNode< coll_t, v_t >, Ra::Dataflow::Core::Functionals::TransformNode< coll_t, v_t >, Ra::Dataflow::Core::Sinks::SinkNode< T >, Ra::Dataflow::Core::Sources::FunctionSourceNode< R, Args >, Ra::Dataflow::Core::Sources::SingleDataSourceNode< T >, and Ra::Dataflow::Rendering::Nodes::RenderingNode.

Definition at line 109 of file Node.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_display_name

std::string Ra::Dataflow::Core::Node::m_display_name { "" }
protected

Node's name if needed for display.

Definition at line 408 of file Node.hpp.

◆ m_initialized

bool Ra::Dataflow::Core::Node::m_initialized { false }
protected

Flag that checks if the node is already initialized.

Definition at line 402 of file Node.hpp.

◆ m_input_variables

Ra::Core::VariableSet Ra::Dataflow::Core::Node::m_input_variables
protected

To edit input port's default values, filled by input_variables. Maybe not needed, and input_variables just return a variable set ?

Definition at line 419 of file Node.hpp.

◆ m_inputs

PortCollection<PortPtr<PortBaseIn> > Ra::Dataflow::Core::Node::m_inputs
protected

The in ports of the node (own by the node)

Definition at line 411 of file Node.hpp.

◆ m_instance_name

std::string Ra::Dataflow::Core::Node::m_instance_name
protected

The instance name of the node.

Definition at line 406 of file Node.hpp.

◆ m_metadata

nlohmann::json Ra::Dataflow::Core::Node::m_metadata
protected

Additional data on the node, added by application or gui or ...

Definition at line 422 of file Node.hpp.

◆ m_model_name

std::string Ra::Dataflow::Core::Node::m_model_name
protected

The type name of the node. Initialized once at construction.

Definition at line 404 of file Node.hpp.

◆ m_outputs

PortCollection<PortPtr<PortBaseOut> > Ra::Dataflow::Core::Node::m_outputs
protected

The out ports of the node (own by the node)

Definition at line 413 of file Node.hpp.

◆ m_parameters

Ra::Core::VariableSet Ra::Dataflow::Core::Node::m_parameters
protected

The editable parameters of the node.

Definition at line 416 of file Node.hpp.


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