|
GNode library (C++)
|
Abstract base class representing a port in a node. More...
#include <port.hpp>

Public Member Functions | |
| Port ()=default | |
| Default constructor for Port. | |
| Port (std::string label) | |
| Constructs a Port with the specified label. | |
| virtual | ~Port ()=default |
| Virtual destructor for Port. | |
| std::string | get_data_type () const |
| Retrieves the type name of the data handled by this port. | |
| std::string | get_label () const |
| Retrieves the label of the port. | |
| virtual std::shared_ptr< BaseData > | get_data_shared_ptr_downcasted () const |
| Retrieves a shared pointer to the data associated with the port after downcasting. | |
| virtual PortType | get_port_type () const =0 |
| Pure virtual function to get the type of the port (IN or OUT). | |
| virtual void * | get_value_ref_void () const =0 |
Retrieves a void* reference to the data value stored in this output port. | |
| virtual void | set_data (std::shared_ptr< BaseData >) |
| Sets the data associated with the port. | |
Protected Attributes | |
| std::string | data_type |
| A string representing the type name. | |
Private Attributes | |
| std::string | label = "no label" |
| The label of the port. | |
Abstract base class representing a port in a node.
The Port class provides a common interface for input and output ports. Each port has a label and can hold data.
|
default |
Default constructor for Port.
|
inline |
Constructs a Port with the specified label.
| label | A string representing the label of the port. |
|
virtualdefault |
Virtual destructor for Port.
|
inlinevirtual |
Retrieves a shared pointer to the data associated with the port after downcasting.
Reimplemented in gnode::Output< T >.
|
inline |
Retrieves the type name of the data handled by this port.
|
inline |
Retrieves the label of the port.
|
pure virtual |
Pure virtual function to get the type of the port (IN or OUT).
This function must be implemented by derived classes to indicate whether the port is an input (PortType::IN) or an output (PortType::OUT).
PortType::IN or PortType::OUT). Implemented in gnode::Input< T >, and gnode::Output< T >.
|
pure virtual |
Retrieves a void* reference to the data value stored in this output port.
void* pointer to the data value. Implemented in gnode::Input< T >, and gnode::Output< T >.
|
inlinevirtual |
Sets the data associated with the port.
| data | A shared pointer to the BaseData to set. |
Reimplemented in gnode::Input< T >.
|
protected |
A string representing the type name.
|
private |
The label of the port.