53 return sizeof(ustring);
59 return sizeof(
void *);
97 return &zero_transform;
102 static const ustring names[] = {ustring(
"undefined"),
104 ustring(
"boolean"), ustring(
"float"),
105 ustring(
"int"), ustring(
"uint"),
106 ustring(
"uint64"), ustring(
"color"),
107 ustring(
"vector"), ustring(
"point"),
108 ustring(
"normal"), ustring(
"point2"),
109 ustring(
"closure"), ustring(
"string"),
110 ustring(
"enum"), ustring(
"transform"),
113 ustring(
"array_boolean"), ustring(
"array_float"),
114 ustring(
"array_int"), ustring(
"array_color"),
115 ustring(
"array_vector"), ustring(
"array_point"),
116 ustring(
"array_normal"), ustring(
"array_point2"),
117 ustring(
"array_string"), ustring(
"array_transform"),
118 ustring(
"array_node")};
120 constexpr size_t num_names =
sizeof(names) /
sizeof(*names);
123 return names[(int)
type];
147 const int struct_offset,
148 const void *default_value,
152 const int extra_flags)
162 socket.
flags = flags | extra_flags;
163 assert(
inputs.size() < std::numeric_limits<SocketModifiedFlags>::digits);
185 if (socket.name ==
name) {
196 if (socket.name ==
name) {
208 static unordered_map<ustring, NodeType> _types;
214 const ustring
name(name_);
217 fprintf(stderr,
"Node type %s registered twice!\n", name_);
226 type->create = create_;
232 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
const void * default_value
const NodeType * node_type
static bool is_float3(Type type)
static ustring type_name(Type type)
static void * zero_default_value()
const NodeEnum * enum_values
SocketModifiedFlags modified_flag_bit