Blender V5.0
BLI_cpp_types_make.hh
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#pragma once
10
11#include "BLI_cpp_type_make.hh"
12#include "BLI_cpp_types.hh"
13
14namespace blender {
15
16template<typename ValueType>
18 : self(CPPType::get<Vector<ValueType>>()), value(CPPType::get<ValueType>())
19{
20 this->register_self();
21}
22
23} // namespace blender
24
26#define BLI_VECTOR_CPP_TYPE_MAKE(VALUE_TYPE) \
27 BLI_CPP_TYPE_MAKE(blender::Vector<VALUE_TYPE>, CPPTypeFlags::None) \
28 template<> const blender::VectorCPPType &blender::VectorCPPType::get_impl<VALUE_TYPE>() \
29 { \
30 static blender::VectorCPPType type{blender::TypeTag<VALUE_TYPE>{}}; \
31 return type; \
32 }
33
35#define BLI_VECTOR_CPP_TYPE_REGISTER(VALUE_TYPE) blender::VectorCPPType::get<VALUE_TYPE>()
const CPPType & value
VectorCPPType(TypeTag< ValueType >)
static const VectorCPPType & get()