Enzo
Loading...
Searching...
No Matches
NodeRegistry.h
1#pragma once
2#include "Engine/Network/NodeImpl.h"
3#include "Engine/Network/NodeType.h"
4#include <boost/config.hpp>
5#include <string>
6
7namespace enzo::nt {
8
10inline constexpr const char* kNodeConstructorPrefix = "enzoNode_";
11
13inline std::string nodeConstructorSymbol(const std::string& constructorName)
14{
15 return kNodeConstructorPrefix + constructorName;
16}
17
18} // namespace enzo::nt
19
31#define ENZO_REGISTER_NODE(constructorName, ImplementationClass) \
32 extern "C" BOOST_SYMBOL_EXPORT enzo::nt::NodeImpl* enzoNode_##constructorName( \
33 enzo::nt::Node& node, \
34 enzo::nt::CookContext& context \
35 ) \
36 { \
37 return new ImplementationClass(node, context); \
38 }