3#include "Core/Utils/Color.hpp"
5#include <Dataflow/RaDataflow.hpp>
7#include <Core/Utils/TypesUtils.hpp>
45 m_name( name ), m_type( type ), m_node( node ) {}
67 virtual void to_json( nlohmann::json& data ) { data[
"name"] = name(); }
68 virtual void from_json(
const nlohmann::json& data ) {
69 if (
auto it = data.find(
"name" ); it != data.end() ) { set_name( *it ); }
75 Node* m_node {
nullptr };
79template <
typename Port>
82template <
typename Port>
83using PortRawPtr =
typename PortPtr<Port>::element_type*;
85using PortBasePtr = PortPtr<PortBase>;
86using PortBaseRawPtr = PortRawPtr<PortBase>;
Base abstract class for all the nodes added and used by the node system.
Base class for nodes' ports A port is a strongly typed extremity of connections between nodes.
std::string port_typename() const
Gets the human readable type of the port object.
const std::string & name() const
Gets the port's name.
virtual ~PortBase()=default
Make PortBase a base abstract class.
PortBase(const std::string &name, std::type_index type, Node *node)
virtual bool has_data()=0
can we get data from the port ?
std::type_index type() const
Gets the type of the data (efficient for comparisons).
Node * node() const
Gets a pointer to the node this port belongs to.
void set_name(const std::string &name)
Set's port name.
hepler function to manage enum as underlying types in VariableSet