107 virtual void set_data(std::shared_ptr<BaseData> ) {}
178 return locked ?
static_cast<void *
>(
locked->get_value_ref()) :
nullptr;
184 return locked ?
static_cast<const void *
>(
locked->get_value_ref())
194 this->data = std::dynamic_pointer_cast<Data<T>>(std::move(
data));
198 std::weak_ptr<Data<T>>
233 template <
typename...
Args>
253 return std::static_pointer_cast<BaseData>(this->
data);
286 return static_cast<void *
>(this->
data->get_value_ref());
291 return static_cast<void *
>(this->
data->get_value_ref());
295 std::shared_ptr<Data<T>>
Template class for holding data of a specific type.
Definition data.hpp:84
Template class for output ports, specialized by data type.
Definition port.hpp:211
std::string get_data_type() const
Retrieves the type name of the data handled by this output port.
Definition port.hpp:260
PortType get_port_type() const override
Returns the type of the port as an output port.
Definition port.hpp:270
T * get_value_ref()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition port.hpp:277
const void * get_value_ref_void() const override
Retrieves a void* reference to the data value stored in this output port.
Definition port.hpp:284
void * get_value_ref_void() override
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition port.hpp:289
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:251
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:234
std::shared_ptr< Data< T > > data
A shared pointer to the data associated with this output port.
Definition port.hpp:296
Output()
Default constructor for Output.
Definition port.hpp:216
const T * get_value_ref() const
Retrieves a reference to the data value stored in this output port.
Definition port.hpp:276
Abstract base class representing a port in a node.
Definition port.hpp:45
std::string label
The label of the port.
Definition port.hpp:113
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:110
virtual void * get_value_ref_void()=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual const 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.
Definition port.hpp:107
virtual PortType get_port_type() const =0
Pure virtual function to get the type of the port (IN or OUT).
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