Blender V5.0
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
8
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
long long int int64_t
unsigned long long int uint64_t
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)
VectorCPPType(TypeTag< ValueType >)
QuaternionBase< float > Quaternion
static auto & get_vector_from_value_map()
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
static auto & get_vector_from_self_map()
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
blender::VecBase< int16_t, 2 > short2
ColorSceneLinearByteEncoded4b< eAlpha::Premultiplied > ColorGeometry4b