106 virtual void set_data(std::shared_ptr<BaseData> ) {}
159 return this->
data.lock() ? this->
data.lock()->get_value_ref() :
nullptr;
169 return this->
data.lock() ? (
void *)this->
data.lock()->get_value_ref()
179 this->data = std::dynamic_pointer_cast<Data<T>>(std::move(
data));
183 std::weak_ptr<Data<T>>
218 template <
typename...
Args>
238 return std::static_pointer_cast<BaseData>(this->
data);
270 return (
void *)this->
data->get_value_ref();
274 std::shared_ptr<Data<T>>
Template class for holding data of a specific type.
Definition data.hpp:83
Template class for output ports, specialized by data type.
Definition port.hpp:196
std::string get_data_type() const
Retrieves the type name of the data handled by this output port.
Definition port.hpp:245
PortType get_port_type() const override
Returns the type of the port as an output port.
Definition port.hpp:255
std::shared_ptr< BaseData > get_data_shared_ptr_downcasted() const override
Retrieves a shared pointer to the data associated with this output port after downcasting.
Definition port.hpp:236
virtual ~Output()=default
Virtual destructor for Output.
Output(std::string label, Args &&...args)
Constructs an Output port with the specified label and additional arguments.
Definition port.hpp:219
std::shared_ptr< Data< T > > data
A shared pointer to the data associated with this output port.
Definition port.hpp:275
Output()
Default constructor for Output.
Definition port.hpp:201
T * get_value_ref() const
Retrieves a reference to the data value stored in this output port.
Definition port.hpp:261
void * get_value_ref_void() const override
Retrieves a void* reference to the data value stored in this output port.
Definition port.hpp:268
Abstract base class representing a port in a node.
Definition port.hpp:45
std::string label
The label of the port.
Definition port.hpp:112
virtual std::shared_ptr< BaseData > get_data_shared_ptr_downcasted() const
Retrieves a shared pointer to the data associated with the port after downcasting.
Definition port.hpp:80
std::string data_type
A string representing the type name.
Definition port.hpp:109
virtual void set_data(std::shared_ptr< BaseData >)
Sets the data associated with the port.
Definition port.hpp:106
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.
Port(std::string label)
Constructs a Port with the specified label.
Definition port.hpp:56
Port()=default
Default constructor for Port.
virtual ~Port()=default
Virtual destructor for Port.
std::string get_label() const
Retrieves the label of the port.
Definition port.hpp:73
std::string get_data_type() const
Retrieves the type name of the data handled by this port.
Definition port.hpp:67
Defines the BaseData and Data classes for handling typed data in the gnode namespace.
Defines the Logger class for managing logging functionality.
PortType
Enumeration for port types, indicating whether a port is an input or an output.
Definition port.hpp:33
@ IN
Represents an input port.
Definition port.hpp:34
@ OUT
Represents an output port.
Definition port.hpp:35