57 return sizeof(ustring);
63 return sizeof(
void *);
101 return &zero_transform;
106 static const ustring names[] = {ustring(
"undefined"),
108 ustring(
"boolean"), ustring(
"float"),
109 ustring(
"int"), ustring(
"uint"),
110 ustring(
"uint64"), ustring(
"color"),
111 ustring(
"vector"), ustring(
"point"),
112 ustring(
"normal"), ustring(
"point2"),
113 ustring(
"closure"), ustring(
"string"),
114 ustring(
"enum"), ustring(
"transform"),
117 ustring(
"array_boolean"), ustring(
"array_float"),
118 ustring(
"array_int"), ustring(
"array_color"),
119 ustring(
"array_vector"), ustring(
"array_point"),
120 ustring(
"array_normal"), ustring(
"array_point2"),
121 ustring(
"array_string"), ustring(
"array_transform"),
122 ustring(
"array_node")};
124 constexpr size_t num_names =
sizeof(names) /
sizeof(*names);
127 return names[(int)
type];
151 const int struct_offset,
152 const void *default_value,
156 const int extra_flags)
166 socket.
flags = flags | extra_flags;
167 assert(
inputs.size() < std::numeric_limits<SocketModifiedFlags>::digits);
189 if (socket.name ==
name) {
200 if (socket.name ==
name) {
212 static unordered_map<ustring, NodeType> _types;
218 const ustring
name(name_);
221 LOG_ERROR <<
"Node type " << name_ <<
" registered twice";
230 type->create = create_;
236 const unordered_map<ustring, NodeType>::iterator it =
types().
find(
name);
unsigned long long int uint64_t
#define CCL_NAMESPACE_END
#define assert(assertion)
vector< SocketType, std::allocator< SocketType > > inputs
NodeType(Type type=NONE, const NodeType *base=nullptr)
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=nullptr)
unique_ptr< Node >(*)(const NodeType *) CreateFunc
const SocketType * find_output(ustring name) const
static const NodeType * find(ustring name)
void register_input(ustring name, ustring ui_name, SocketType::Type type, const int struct_offset, const void *default_value, const NodeEnum *enum_values=nullptr, const NodeType *node_type=nullptr, int flags=0, int extra_flags=0)
static unordered_map< ustring, NodeType > & types()
void register_output(ustring name, ustring ui_name, SocketType::Type type)
const SocketType * find_input(ustring name) const
vector< SocketType, std::allocator< SocketType > > outputs
static size_t size(Type type, bool packed)
const void * default_value
const NodeType * node_type
size_t storage_size() const
static bool is_float3(Type type)
static ustring type_name(Type type)
static void * zero_default_value()
const NodeEnum * enum_values
size_t packed_size() const
SocketModifiedFlags modified_flag_bit