6template <
class PortType>
14 auto* port = byName[name];
15 auto oldUuid = port->uuid();
18 port->deserialize(data);
21 auto nIt = byName.
find(name);
22 assert(nIt != byName.
end());
25 auto uIt = byUuid.
find(oldUuid);
26 assert(uIt != byUuid.
end());
31 byUuid[port->uuid()] = port;
49template <
typename T,
typename... Args>
59template <
typename T,
typename... Args>
70 NF::Instance().ReserveAdditional(
sizeof...(Ts));
72#if __cplusplus >= 201703L
73 ((res = res & RegisterNode<Ts>(descs.
key)), ...);
74#elif __cplusplus > 201103L
87template <
class T,
class... Ts>
97 deregister(
typeid(T));
99#if __cplusplus >= 201703L
100 (deregister(
typeid(Ts)), ...);
101#elif __cplusplus > 201103L
107template <
class... Ts>
111#if __cplusplus >= 201703L
113#elif __cplusplus > 201103L
void registerOutputPort(const std::string &name, OutputPort< T, Args... > &port)
Register an OutputPort instance with this class.
std::map< std::string, Input * > inputs_by_name_
static void LoadAndRegisterPort(const std::string &name, const Metadata &data, std::unordered_map< Uuid, PortType * > &byUuid, std::map< std::string, PortType * > &byName)
std::map< std::string, Output * > outputs_by_name_
std::unordered_map< Uuid, Input * > inputs_by_uuid_
void registerInputPort(const std::string &name, InputPort< T > &port)
Register an InputPort instance with this class.
void registerPort(const std::string &name, InputPort< T > &port)
Register an InputPort instance with this class.
std::unordered_map< Uuid, Output * > outputs_by_uuid_
auto uuid() const -> Uuid
static T & Instance()
Access the singleton instance.
SingletonHolder< Factory< Node, std::string, Node::Pointer > > NodeFactoryType
Project top-level namespace.
auto RegisterNode(const std::string &name) -> bool
Register a Node type for serialization/deserialization using a custom name.
auto DeregisterNodes(const NodeDesc< Ts > &... descs) -> bool
Deregister one or more Node types using source-token descriptors.
auto NodeName() -> std::string
auto DeregisterNode() -> bool
Deregister a Node type.
nlohmann::ordered_json Metadata
Metadata storage class.
auto RegisterNodes(const NodeDesc< Ts > &... descs) -> bool
Register one or more Node types for serialization/deserialization.
Source-token descriptor pairing a Node type with a serialization key.
std::string key
Registered serialization key (the source spelling of T)
Helper class for calling function iteratively on parameter pack.