Blender V4.5
blenlib/intern/cpp_types.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "BLI_color.hh"
10#include "BLI_cpp_type_make.hh"
11#include "BLI_cpp_types_make.hh"
15
16namespace blender {
17
19{
21 return map;
22}
23
25{
27 return map;
28}
29
30void VectorCPPType::register_self()
31{
33 get_vector_from_value_map().add_new(&this->value, this);
34}
35
37{
38 const VectorCPPType *type = get_vector_from_self_map().lookup_default(&self, nullptr);
39 BLI_assert(type == nullptr || type->self == self);
40 return type;
41}
42
44{
45 const VectorCPPType *type = get_vector_from_value_map().lookup_default(&value, nullptr);
46 BLI_assert(type == nullptr || type->value == value);
47 return type;
48}
49
50} // namespace blender
51
53
59
67
72
75
#define BLI_assert(a)
Definition BLI_assert.h:46
CPPTypeFlags
#define BLI_CPP_TYPE_MAKE(TYPE_NAME, FLAGS)
#define BLI_CPP_TYPE_REGISTER(TYPE_NAME)
#define BLI_VECTOR_CPP_TYPE_MAKE(VALUE_TYPE)
#define BLI_VECTOR_CPP_TYPE_REGISTER(VALUE_TYPE)
PyObject * self
void add_new(const Key &key, const Value &value)
Definition BLI_map.hh:265
static const VectorCPPType * get_from_self(const CPPType &self)
const CPPType & value
static const VectorCPPType * get_from_value(const CPPType &value)
unsigned int uint32_t
static auto & get_vector_from_value_map()
static auto & get_vector_from_self_map()
signed short int16_t
Definition stdint.h:76
unsigned short uint16_t
Definition stdint.h:79
__int64 int64_t
Definition stdint.h:89
signed int int32_t
Definition stdint.h:77
unsigned char uint8_t
Definition stdint.h:78
unsigned __int64 uint64_t
Definition stdint.h:90
signed char int8_t
Definition stdint.h:75