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

Base class for nodes' ports A port is a strongly typed extremity of connections between nodes. More...

#include <Dataflow/Core/Port.hpp>

+ Collaboration diagram for Ra::Dataflow::Core::PortBase:

Public Member Functions

virtual ~PortBase ()=default
 Make PortBase a base abstract class.
 
const std::stringname () const
 Gets the port's name.
 
void set_name (const std::string &name)
 Set's port name.
 
std::type_index type () const
 Gets the type of the data (efficient for comparisons).
 
Nodenode () const
 Gets a pointer to the node this port belongs to.
 
std::string port_typename () const
 Gets the human readable type of the port object.
 
virtual bool has_data ()=0
 can we get data from the port ?
 
virtual void to_json (nlohmann::json &data)
 
virtual void from_json (const nlohmann::json &data)
 
Constructors
 PortBase (const PortBase &)=delete
 
PortBaseoperator= (const PortBase &)=delete
 
 PortBase (const std::string &name, std::type_index type, Node *node)
 

Detailed Description

Base class for nodes' ports A port is a strongly typed extremity of connections between nodes.

Warning
when comparing and using typed port, beware of the const qualifier that is not always exposed by the C++ type system. There are some undefined behavior concerning const_casts and const qualifier in the C++ documentation (https://en.cppreference.com/w/cpp/language/const_cast).

Definition at line 29 of file Port.hpp.

Constructor & Destructor Documentation

◆ PortBase()

Ra::Dataflow::Core::PortBase::PortBase ( const std::string & name,
std::type_index type,
Node * node )
inline
Parameters
nameThe name of the port.
typeThe data's type's hash.
nodeThe pointer to the node associated with the port.

Definition at line 44 of file Port.hpp.

Member Function Documentation

◆ from_json()

virtual void Ra::Dataflow::Core::PortBase::from_json ( const nlohmann::json & data)
inlinevirtual

Definition at line 68 of file Port.hpp.

◆ has_data()

virtual bool Ra::Dataflow::Core::PortBase::has_data ( )
pure virtual

can we get data from the port ?

Implemented in Ra::Dataflow::Core::PortIn< T >, and Ra::Dataflow::Core::PortOut< T >.

◆ name()

const std::string & Ra::Dataflow::Core::PortBase::name ( ) const
inline

Gets the port's name.

Definition at line 52 of file Port.hpp.

◆ node()

Node * Ra::Dataflow::Core::PortBase::node ( ) const
inline

Gets a pointer to the node this port belongs to.

Definition at line 58 of file Port.hpp.

◆ port_typename()

std::string Ra::Dataflow::Core::PortBase::port_typename ( ) const
inline

Gets the human readable type of the port object.

Returns
The simplified demangled type.

Definition at line 62 of file Port.hpp.

◆ set_name()

void Ra::Dataflow::Core::PortBase::set_name ( const std::string & name)
inline

Set's port name.

Definition at line 54 of file Port.hpp.

◆ to_json()

virtual void Ra::Dataflow::Core::PortBase::to_json ( nlohmann::json & data)
inlinevirtual

Definition at line 67 of file Port.hpp.

◆ type()

std::type_index Ra::Dataflow::Core::PortBase::type ( ) const
inline

Gets the type of the data (efficient for comparisons).

Definition at line 56 of file Port.hpp.


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