Blender V4.3
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
5#include "BLI_color.hh"
11
12namespace blender {
13
15{
17 return map;
18}
19
21{
23 return map;
24}
25
26void VectorCPPType::register_self()
27{
29 get_vector_from_value_map().add_new(&this->value, this);
30}
31
33{
34 const VectorCPPType *type = get_vector_from_self_map().lookup_default(&self, nullptr);
35 BLI_assert(type == nullptr || type->self == self);
36 return type;
37}
38
40{
41 const VectorCPPType *type = get_vector_from_value_map().lookup_default(&value, nullptr);
42 BLI_assert(type == nullptr || type->value == value);
43 return type;
44}
45
46} // namespace blender
47
49
54
60
65
68
#define BLI_assert(a)
Definition BLI_assert.h:50
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:241
static const VectorCPPType * get_from_self(const CPPType &self)
static const VectorCPPType * get_from_value(const CPPType &value)
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
unsigned int uint32_t
Definition stdint.h:80
__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