smgl 0.11.0
Structured Metadata Engine and Graph Objects Library
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
Node.hpp File Reference
#include <functional>
#include <map>
#include <memory>
#include <typeinfo>
#include <unordered_map>
#include <vector>
#include "smgl/Factory.hpp"
#include "smgl/Metadata.hpp"
#include "smgl/Ports.hpp"
#include "smgl/Singleton.hpp"
#include "smgl/Uuid.hpp"
#include "smgl/filesystem.hpp"
#include "smgl/NodeImpl.hpp"
Include dependency graph for Node.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  smgl::Node
 Generic Node class. More...
 
struct  smgl::Node::Info
 Port registration information. More...
 
struct  smgl::NodeDesc< T >
 Source-token descriptor pairing a Node type with a serialization key. More...
 

Namespaces

namespace  smgl
 Project top-level namespace.
 
namespace  smgl::detail
 Implementation details namespace.
 

Macros

#define SMGL_NODE(...)   ::smgl::NodeDesc<__VA_ARGS__>(#__VA_ARGS__)
 Construct a smgl::NodeDesc for type T with a source-faithful key.
 

Typedefs

using smgl::detail::NodeFactoryType = SingletonHolder< Factory< Node, std::string, Node::Pointer > >
 
using smgl::unknown_identifier = detail::NodeFactoryType::InstanceType::unknown_identifier
 

Functions

template<class... Ts>
auto smgl::RegisterNodes (const NodeDesc< Ts > &... descs) -> bool
 Register one or more Node types for serialization/deserialization.
 
template<class T >
auto smgl::RegisterNode (const std::string &name) -> bool
 Register a Node type for serialization/deserialization using a custom name.
 
template<class T , class... Ts>
auto smgl::DeregisterNode () -> bool
 Deregister a Node type.
 
template<class... Ts>
auto smgl::DeregisterNodes (const NodeDesc< Ts > &... descs) -> bool
 Deregister one or more Node types using source-token descriptors.
 
auto smgl::DeregisterNode (const std::string &name) -> bool
 Deregister a Node type by Name.
 
auto smgl::CreateNode (const std::string &name) -> Node::Pointer
 
template<class T >
auto smgl::NodeName () -> std::string
 
auto smgl::NodeName (const Node::Pointer &node) -> std::string
 
auto smgl::NodeName (const Node *node) -> std::string
 
auto smgl::IsRegistered (const std::string &name) -> bool
 
auto smgl::IsRegistered (const Node::Pointer &node) -> bool
 
auto smgl::IsRegistered (const Node *node) -> bool
 

Macro Definition Documentation

◆ SMGL_NODE

#define SMGL_NODE (   ...)    ::smgl::NodeDesc<__VA_ARGS__>(#__VA_ARGS__)

Construct a smgl::NodeDesc for type T with a source-faithful key.

Captures the verbatim, as-written spelling of T (via the preprocessor # operator) as the registered serialization key, then wraps it in a smgl::NodeDesc for use with smgl::RegisterNodes() / smgl::DeregisterNodes().

Always fully-qualify T, even under a using namespace directive: the spelling becomes part of the Node's serialization identity and must be identical across every registration site and platform.

The macro is variadic so that multi-parameter templates, whose spelling contains top-level commas, are passed as a single type:

smgl::RegisterNodes(SMGL_NODE(my::ns::SumNode));
smgl::RegisterNodes(SMGL_NODE(my::ns::PairNode<int, double>));
#define SMGL_NODE(...)
Construct a smgl::NodeDesc for type T with a source-faithful key.
Definition Node.hpp:531
auto RegisterNodes(const NodeDesc< Ts > &... descs) -> bool
Register one or more Node types for serialization/deserialization.
Definition NodeImpl.hpp:66

Definition at line 531 of file Node.hpp.