Blender  V3.3
deg_node_factory.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2019 Blender Foundation. All rights reserved. */
3 
9 
10 namespace blender::deg {
11 
12 /* Global type registry */
13 static DepsNodeFactory *node_typeinfo_registry[static_cast<int>(NodeType::NUM_TYPES)] = {nullptr};
14 
16 {
17  BLI_assert(factory != nullptr);
18  const int type_as_int = static_cast<int>(factory->type());
19  node_typeinfo_registry[type_as_int] = factory;
20 }
21 
23 {
24  /* Look up type - at worst, it doesn't exist in table yet, and we fail. */
25  const int type_as_int = static_cast<int>(type);
26  return node_typeinfo_registry[type_as_int];
27 }
28 
29 } // namespace blender::deg
#define BLI_assert(a)
Definition: BLI_assert.h:46
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void register_node_typeinfo(DepsNodeFactory *factory)
DepsNodeFactory * type_get_factory(const NodeType type)
static DepsNodeFactory * node_typeinfo_registry[static_cast< int >(NodeType::NUM_TYPES)]
virtual NodeType type() const =0