NAP
typeinfo.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 #include <rttr/type>
8 #include <rttr/registration>
9 #ifdef NAP_ENABLE_PYTHON
10  #include "pythonmodule.h"
11 #endif
12 #include <utility/dllexport.h>
13 #include <string.h>
14 
136 namespace nap
137 {
138  namespace rtti
139  {
140  using TypeInfo = rttr::type;
141  using Enum = rttr::enumeration;
142  using Property = rttr::property;
143  using Variant = rttr::variant;
144  using Instance = rttr::instance;
145  using VariantArray = rttr::variant_array_view;
146  using VariantMap = rttr::variant_associative_view;
147 
151  namespace method
152  {
153  constexpr const char* description = "description";
154  constexpr const char* assign = "assign";
155  constexpr const char* toObject = "toObject";
156  constexpr const char* toString = "toString";
157  constexpr const char* translateTargetID = "translateTargetID";
158  }
159 
163  enum class EPropertyMetaData : uint8_t
164  {
165  Default = 0,
166  Required = 1,
167  FileLink = 2,
168  Embedded = 4,
169  ReadOnly = 8
170  };
171 
175  enum class EPropertyFileType : uint8_t
176  {
177  Any = 0,
178  Image = 1,
179  FragShader = 2,
180  VertShader = 3,
181  ComputeShader = 4,
182  Python = 5,
183  Mesh = 6,
184  Video = 7,
185  ImageSequence = 8,
186  Audio = 9,
187  Font = 10
188  };
189 
191  {
192  return static_cast<EPropertyMetaData>(static_cast<uint8_t>(a) & static_cast<uint8_t>(b));
193  }
194 
196  {
197  return static_cast<EPropertyMetaData>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
198  }
199 
203  inline bool isPrimitive(const rtti::TypeInfo& type)
204  {
205  return type.is_arithmetic() || type.is_enumeration() || type == rtti::TypeInfo::get<std::string>();
206  }
207 
211  inline bool hasFlag(const rtti::Property& property, EPropertyMetaData flags)
212  {
213  const rtti::Variant& meta_data = property.get_metadata("flags");
214  if (!meta_data.is_valid())
215  return false;
216 
217  uint8_t current_flags = meta_data.convert<uint8_t>();
218  return (current_flags & (uint8_t)flags) != 0;
219  }
220 
225  inline bool isFileType(const rtti::Property &property, EPropertyFileType filetype)
226  {
227  const rtti::Variant& meta_data = property.get_metadata("filetype");
228  return meta_data.is_valid() ?
229  meta_data.convert<uint8_t>() == (uint8_t)filetype : false;
230  }
231 
236  enum class ETypeCheck : uint8_t
237  {
238  EXACT_MATCH,
240  };
241 
245  inline bool isTypeMatch(const rtti::TypeInfo& typeA, const rtti::TypeInfo& typeB, ETypeCheck typeCheck)
246  {
247  return typeCheck == ETypeCheck::EXACT_MATCH ? typeA == typeB : typeA.is_derived_from(typeB);
248  }
249 
257  inline rttr::method findMethodRecursive(const rtti::TypeInfo& type, const std::string& methodName)
258  {
259  for (const rtti::TypeInfo& base : type.get_base_classes())
260  {
261  auto result = base.get_method(methodName);
262  if (result.is_valid())
263  return result;
264  }
265  return type.get_method(methodName);
266  }
267  }
268 
269  namespace detail
270  {
286  template<typename T>
287  struct void_ { typedef void type; };
288 
289  template<typename Type, typename = void>
290  struct BaseClassList
291  {
292  using List = rttr::detail::type_list<>;
293  };
294 
295  template<typename Type>
296  struct BaseClassList<Type, typename void_<typename Type::base_class_list>::type>
297  {
298  using List = typename Type::base_class_list;
299  };
300 
312  template <typename Return, typename... Args>
313  bool isReturnTypeLValueReference(Return(*f)(Args...))
314  {
315  return std::is_lvalue_reference<Return>();
316  }
317 
318  template <typename Return, typename Class, typename... Arg>
319  bool isReturnTypeLValueReference(Return(Class::*f)(Arg...))
320  {
321  return std::is_lvalue_reference<Return>();
322  }
323 
324  template <typename Return, typename Class, typename... Arg>
325  bool isReturnTypeLValueReference(Return(Class::*f)(Arg...) const)
326  {
327  return std::is_lvalue_reference<Return>();
328  }
329  }
330 }
331 
332 
334 // RTTI Macros
336 
340 #define RTTI_OF(Type) nap::rtti::TypeInfo::get<Type>()
341 
342 
344  // RTTI_ENABLE
346 
352 #define RTTI_ENABLE(...) \
353  RTTR_ENABLE(__VA_ARGS__) \
354  RTTR_REGISTRATION_FRIEND
355 
356 
358 // RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR
360 
361 #define CONCAT_UNIQUE_NAMESPACE(x, y) namespace x##y
362 #define UNIQUE_REGISTRATION_NAMESPACE(id) CONCAT_UNIQUE_NAMESPACE(__rtti_registration_, id)
363 
370 #ifdef NAP_ENABLE_PYTHON
371  #define RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_1(Type) \
372  UNIQUE_REGISTRATION_NAMESPACE(__COUNTER__) \
373  { \
374  RTTR_REGISTRATION \
375  { \
376  using namespace rttr; \
377  namespace py = pybind11; \
378  using PythonClassType = nap::rtti::PythonClass<Type, nap::detail::BaseClassList<Type>::List>; \
379  std::string rtti_class_type_name = #Type; \
380  registration::class_<Type> rtti_class_type(#Type); \
381  PythonClassType python_class(#Type);
382 #else // NAP_ENABLE_PYTHON
383  #define RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_1(Type) \
384  UNIQUE_REGISTRATION_NAMESPACE(__COUNTER__) \
385  { \
386  RTTR_REGISTRATION \
387  { \
388  using namespace rttr; \
389  std::string rtti_class_type_name = #Type; \
390  registration::class_<Type> rtti_class_type(#Type);
391 #endif // NAP_ENABLE_PYTHON
392 
393 
401 #ifdef NAP_ENABLE_PYTHON
402 #define RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_2(Type, Description) \
403  UNIQUE_REGISTRATION_NAMESPACE(__COUNTER__) \
404  { \
405  static const char* getTypeDescription() { return Description; } \
406  RTTR_REGISTRATION \
407  { \
408  using namespace rttr; \
409  namespace py = pybind11; \
410  using PythonClassType = nap::rtti::PythonClass<Type, nap::detail::BaseClassList<Type>::List>; \
411  std::string rtti_class_type_name = #Type; \
412  registration::class_<Type> rtti_class_type(#Type); \
413  rtti_class_type.method(nap::rtti::method::description, &getTypeDescription); \
414  PythonClassType python_class(#Type);
415 #else // NAP_ENABLE_PYTHON
416 #define RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_2(Type, Description) \
417  UNIQUE_REGISTRATION_NAMESPACE(__COUNTER__) \
418  { \
419  static const char* getTypeDescription() { return Description; } \
420  RTTR_REGISTRATION \
421  { \
422  using namespace rttr; \
423  std::string rtti_class_type_name = #Type; \
424  registration::class_<Type> rtti_class_type(#Type); \
425  rtti_class_type.method(nap::rtti::method::description, &getTypeDescription);
426 #endif // NAP_ENABLE_PYTHON
427 
428 // Selector
429 #define GET_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_MACRO(_1,_2,NAME,...) NAME
430 
438 #define RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(...) GET_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_MACRO(__VA_ARGS__, RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_2, RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR_1)(__VA_ARGS__)
439 
440 
442 // RTTI_PROPERTY
444 
452 #ifdef NAP_ENABLE_PYTHON
453  #define RTTI_PROPERTY_3(Name, Member, Flags) \
454  rtti_class_type.property(Name, Member)( metadata("flags", (uint8_t)(Flags))); \
455  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
456  { \
457  if(((uint8_t)(Flags) & (uint8_t)(nap::rtti::EPropertyMetaData::ReadOnly)) != 0) \
458  cls.def_readonly(Name, Member); \
459  else \
460  cls.def_readwrite(Name, Member); \
461  });
462 #else
463  #define RTTI_PROPERTY_3(Name, Member, Flags) \
464  rtti_class_type.property(Name, Member)( metadata("flags", (uint8_t)(Flags)));
465 #endif // NAP_ENABLE_PYTHON
466 
475 #ifdef NAP_ENABLE_PYTHON
476  #define RTTI_PROPERTY_4(Name, Member, Flags, Description) \
477  rtti_class_type.property(Name, Member)( \
478  metadata("flags", (uint8_t)(Flags)), \
479  metadata("description", (const char*)(Description))); \
480  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
481  { \
482  if(((uint8_t)(Flags) & (uint8_t)(nap::rtti::EPropertyMetaData::ReadOnly)) != 0) \
483  cls.def_readonly(Name, Member); \
484  else \
485  cls.def_readwrite(Name, Member); \
486  });
487 #else
488  #define RTTI_PROPERTY_4(Name, Member, Flags, Description) \
489  rtti_class_type.property(Name, Member)( \
490  metadata("flags", (uint8_t)(Flags)), \
491  metadata("description", (const char*)(Description)));
492 #endif // NAP_ENABLE_PYTHON
493 
494 #define GET_PROPERTY_MACRO(_1,_2,_3,_4,NAME,...) NAME
495 
505 #define RTTI_PROPERTY(...) GET_PROPERTY_MACRO(__VA_ARGS__, RTTI_PROPERTY_4, RTTI_PROPERTY_3)(__VA_ARGS__)
506 
507 
509 // RTTI_PROPERTY_FILELINK
511 
520 #ifdef NAP_ENABLE_PYTHON
521 #define RTTI_PROPERTY_FILELINK_4(Name, Member, Flags, FileType) \
522  rtti_class_type.property(Name, Member)( \
523  metadata("flags", (uint8_t)(nap::rtti::EPropertyMetaData::FileLink | Flags)), \
524  metadata("filetype", (uint8_t)(FileType))); \
525  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
526  { \
527  cls.def_readwrite(Name, Member); \
528  });
529 #else // NAP_ENABLE_PYTHON
530 #define RTTI_PROPERTY_FILELINK_4(Name, Member, Flags, FileType) \
531  rtti_class_type.property(Name, Member)( \
532  metadata("flags", (uint8_t)(nap::rtti::EPropertyMetaData::FileLink | Flags)), \
533  metadata("filetype", (uint8_t)(FileType)));
534 #endif // NAP_ENABLE_PYTHON
535 
545 #ifdef NAP_ENABLE_PYTHON
546 #define RTTI_PROPERTY_FILELINK_5(Name, Member, Flags, FileType, Description) \
547  rtti_class_type.property(Name, Member)( \
548  metadata("flags", (uint8_t)(nap::rtti::EPropertyMetaData::FileLink | Flags)), \
549  metadata("filetype", (uint8_t)(FileType)), \
550  metadata("description", (const char*)(Description))); \
551  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
552  { \
553  cls.def_readwrite(Name, Member); \
554  });
555 #else // NAP_ENABLE_PYTHON
556 #define RTTI_PROPERTY_FILELINK_5(Name, Member, Flags, FileType, Description) \
557  rtti_class_type.property(Name, Member)( \
558  metadata("flags", (uint8_t)(nap::rtti::EPropertyMetaData::FileLink | Flags)), \
559  metadata("filetype", (uint8_t)(FileType)), \
560  metadata("description", (const char*)(Description)));
561 #endif // NAP_ENABLE_PYTHON
562 
563 #define GET_PROPERTY_FILELINK_MACRO(_1,_2,_3,_4,_5,NAME,...) NAME
564 
574 #define RTTI_PROPERTY_FILELINK(...) GET_PROPERTY_FILELINK_MACRO(__VA_ARGS__, RTTI_PROPERTY_FILELINK_5, RTTI_PROPERTY_FILELINK_4)(__VA_ARGS__)
575 
576 
578 // RTTI_FUNCTION
580 
587 #ifdef NAP_ENABLE_PYTHON
588 #define RTTI_FUNCTION(Name, Member) \
589  rtti_class_type.method(Name, Member); \
590  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
591  { \
592  cls.def(Name, Member, nap::detail::isReturnTypeLValueReference(Member) ? py::return_value_policy::reference : py::return_value_policy::automatic_reference); \
593  });
594 #else // NAP_ENABLE_PYTHON
595 #define RTTI_FUNCTION(Name, Member) \
596  rtti_class_type.method(Name, Member);
597 #endif // NAP_ENABLE_PYTHON
598 
604 #ifdef NAP_ENABLE_PYTHON
605 #define RTTI_CUSTOM_REGISTRATION_FUNCTION(Func) \
606  python_class.registerFunction(std::bind(&Func<PythonClassType::PybindClass>, std::placeholders::_1, std::placeholders::_2));
607 #else // NAP_ENABLE_PYTHON
608 #define RTTI_CUSTOM_REGISTRATION_FUNCTION(Func)
609 #endif // NAP_ENABLE_PYTHON
610 
611 
613 // RTTI_CONSTRUCTOR
615 
623 #ifdef NAP_ENABLE_PYTHON
624  #define RTTI_CONSTRUCTOR(...) \
625  rtti_class_type.constructor<__VA_ARGS__>()(policy::ctor::as_raw_ptr); \
626  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
627  { \
628  cls.def(py::init<__VA_ARGS__>()); \
629  });
630 #else // NAP_ENABLE_PYTHON
631  #define RTTI_CONSTRUCTOR(...) \
632  rtti_class_type.constructor<__VA_ARGS__>()(policy::ctor::as_raw_ptr);
633 #endif // NAP_ENABLE_PYTHON
634 
635 
637  // RTTI_VALUE_CONSTRUCTOR
639 
648 #ifdef NAP_ENABLE_PYTHON
649 #define RTTI_VALUE_CONSTRUCTOR(...) \
650  rtti_class_type.constructor<__VA_ARGS__>()(policy::ctor::as_object); \
651  python_class.registerFunction([](pybind11::module& module, PythonClassType::PybindClass& cls) \
652  { \
653  cls.def(py::init<__VA_ARGS__>()); \
654  });
655 #else // NAP_ENABLE_PYTHON
656 #define RTTI_VALUE_CONSTRUCTOR(...) \
657  rtti_class_type.constructor<__VA_ARGS__>()(policy::ctor::as_object);
658 #endif // NAP_ENABLE_PYTHON
659 
660 
662 // RTTI_END_CLASS
664 
669 #ifdef NAP_ENABLE_PYTHON
670 #define RTTI_END_CLASS \
671  nap::rtti::PythonModule& python_module = nap::rtti::PythonModule::get("nap"); \
672  python_module.registerTypeImportCallback(rtti_class_type_name, \
673  [](std::vector<std::string>& baseTypes) \
674  { \
675  PythonClassType::GetBaseTypes(baseTypes); \
676  }, \
677  [python_class](py::module& module) \
678  { \
679  python_class.invoke(module); \
680  }); \
681  } \
682  }
683 #else
684 #define RTTI_END_CLASS \
685  } \
686  }
687 #endif // NAP_ENABLE_PYTHON
688 
689 
691 // RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR
693 
701 #define RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR_1(Type) \
702  RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(Type)
703 
712 #define RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR_2(Type, Description) \
713  RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(Type, Description)
714 
715 #define GET_RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR_MACRO(_1,_2,NAME,...) NAME
716 
725 #define RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR(...) GET_RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR_MACRO(__VA_ARGS__, RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR_2, RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR_1)(__VA_ARGS__)
726 
727 
729  // RTTI_END_STRUCT
731 
737 #define RTTI_END_STRUCT \
738  RTTI_END_CLASS
739 
740 
742  // RTTI_BEGIN_CLASS
744 
751 #define RTTI_BEGIN_CLASS_1(Type) \
752  RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(Type) \
753  RTTI_CONSTRUCTOR()
754 
762 #define RTTI_BEGIN_CLASS_2(Type, Description) \
763  RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(Type, Description) \
764  RTTI_CONSTRUCTOR()
765 
766 #define GET_RTTI_BEGIN_CLASS_MACRO(_1,_2,NAME,...) NAME
767 
775 #define RTTI_BEGIN_CLASS(...) GET_RTTI_BEGIN_CLASS_MACRO(__VA_ARGS__, RTTI_BEGIN_CLASS_2, RTTI_BEGIN_CLASS_1)(__VA_ARGS__)
776 
777 
779 // RTTI_BEGIN_STRUCT
781 
789 #define RTTI_BEGIN_STRUCT_1(Type) \
790  RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR(Type) \
791  RTTI_VALUE_CONSTRUCTOR()
792 
801 #define RTTI_BEGIN_STRUCT_2(Type, Description) \
802  RTTI_BEGIN_STRUCT_NO_DEFAULT_CONSTRUCTOR(Type, Description) \
803  RTTI_VALUE_CONSTRUCTOR()
804 
805 #define GET_RTTI_BEGIN_STRUCT_MACRO(_1,_2,NAME,...) NAME
806 
814 #define RTTI_BEGIN_STRUCT(...) GET_RTTI_BEGIN_STRUCT_MACRO(__VA_ARGS__, RTTI_BEGIN_STRUCT_2, RTTI_BEGIN_STRUCT_1)(__VA_ARGS__)
815 
816 
818  // RTTI_BEGIN_ENUM
820 
825 #define RTTI_BEGIN_ENUM(Type) \
826  UNIQUE_REGISTRATION_NAMESPACE(__COUNTER__) \
827  { \
828  RTTR_REGISTRATION \
829  { \
830  using namespace rttr; \
831  registration::enumeration<Type>(#Type) \
832  (
833 
839 #define RTTI_ENUM_VALUE(Value, String) \
840  value(String, Value)
841 
845 #define RTTI_END_ENUM \
846  ); \
847  } \
848  }
849 
850 
852 // RTTI_DEFINE_BASE
854 
861 #define RTTI_DEFINE_BASE_1(Type) \
862  RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(Type) \
863  RTTI_END_CLASS
864 
872 #define RTTI_DEFINE_BASE_2(Type, Description) \
873  RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(Type, Description) \
874  RTTI_END_CLASS
875 
876 #define GET_RTTI_DEFINE_BASE_MACRO(_1,_2,NAME,...) NAME
877 
885 #define RTTI_DEFINE_BASE(...) GET_RTTI_DEFINE_BASE_MACRO(__VA_ARGS__, RTTI_DEFINE_BASE_2, RTTI_DEFINE_BASE_1)(__VA_ARGS__)
886 
887 
889 // RTTI_DEFINE_CLASS
891 
896 #define RTTI_DEFINE_CLASS_1(Type) \
897  RTTI_BEGIN_CLASS(Type) \
898  RTTI_END_CLASS
899 
905 #define RTTI_DEFINE_CLASS_2(Type, Description) \
906  RTTI_BEGIN_CLASS(Type, Description) \
907  RTTI_END_CLASS
908 
909 #define GET_RTTI_DEFINE_CLASS_MACRO(_1,_2,NAME,...) NAME
910 
916 #define RTTI_DEFINE_CLASS(...) GET_RTTI_DEFINE_CLASS_MACRO(__VA_ARGS__, RTTI_DEFINE_CLASS_2, RTTI_DEFINE_CLASS_1)(__VA_ARGS__)
917 
918 
920 // RTTI_DEFINE_STRUCT
922 
927 #define RTTI_DEFINE_STRUCT_1(Type) \
928  RTTI_BEGIN_STRUCT(Type) \
929  RTTI_END_STRUCT
930 
936 #define RTTI_DEFINE_STRUCT_2(Type, Description) \
937  RTTI_BEGIN_STRUCT(Type, Description) \
938  RTTI_END_STRUCT
939 
940 #define GET_RTTI_DEFINE_STRUCT_MACRO(_1,_2,NAME,...) NAME
941 
947 #define RTTI_DEFINE_STRUCT(...) GET_RTTI_DEFINE_STRUCT_MACRO(__VA_ARGS__, RTTI_DEFINE_STRUCT_2, RTTI_DEFINE_STRUCT_1)(__VA_ARGS__)
nap::ComputeShader
Definition: shader.h:176
nap::rtti::EPropertyMetaData
EPropertyMetaData
Definition: typeinfo.h:163
nap::rtti::method::toObject
constexpr const char * toObject
to object pointer
Definition: typeinfo.h:155
nap::rtti::method::assign
constexpr const char * assign
assignment
Definition: typeinfo.h:154
nap::rtti::EPropertyMetaData::Embedded
@ Embedded
An embedded pointer.
nap::rtti::EPropertyFileType::VertShader
@ VertShader
Points to a .frag file, must be used with EPropertyMetaData::FileLink.
nap::rtti::VariantArray
rttr::variant_array_view VariantArray
Definition: typeinfo.h:145
nap::rtti::EPropertyFileType::ImageSequence
@ ImageSequence
Points to a an image sequence, must be used with EPropertyMetaData::FileLink.
nap::rtti::EPropertyMetaData::Required
@ Required
Load will fail if the property isn't set.
nap::rtti::EPropertyFileType::FragShader
@ FragShader
Points to a .vert file, must be used with EPropertyMetaData::FileLink.
nap::rtti::VariantMap
rttr::variant_associative_view VariantMap
Definition: typeinfo.h:146
nap::Video
Definition: video.h:399
nap::rtti::method::description
constexpr const char * description
rtti type description
Definition: typeinfo.h:153
nap::rtti::isTypeMatch
bool isTypeMatch(const rtti::TypeInfo &typeA, const rtti::TypeInfo &typeB, ETypeCheck typeCheck)
Definition: typeinfo.h:245
nap::rtti::isFileType
bool isFileType(const rtti::Property &property, EPropertyFileType filetype)
Definition: typeinfo.h:225
nap::rtti::Enum
rttr::enumeration Enum
Definition: typeinfo.h:141
nap::rtti::Property
rttr::property Property
Definition: typeinfo.h:142
nap::Image
Definition: image.h:18
nap::rtti::method::toString
constexpr const char * toString
to object path
Definition: typeinfo.h:156
nap::rtti::method::translateTargetID
constexpr const char * translateTargetID
transform id
Definition: typeinfo.h:157
nap::rtti::EPropertyFileType::Any
@ Any
Can point to any file, default.
nap::rtti::hasFlag
bool hasFlag(const rtti::Property &property, EPropertyMetaData flags)
Definition: typeinfo.h:211
nap::rtti::EPropertyMetaData::ReadOnly
@ ReadOnly
A read only property in Python.
nap::rtti::EPropertyMetaData::Default
@ Default
Uses the (class) default if the property isn't set.
nap::rtti::isPrimitive
bool isPrimitive(const rtti::TypeInfo &type)
Definition: typeinfo.h:203
nap::Font
Definition: font.h:64
nap::rtti::findMethodRecursive
rttr::method findMethodRecursive(const rtti::TypeInfo &type, const std::string &methodName)
Definition: typeinfo.h:257
nap
Definition: templateapp.h:17
nap::rtti::ETypeCheck::EXACT_MATCH
@ EXACT_MATCH
The type needs to be of the exact same kind.
nap::rtti::Instance
rttr::instance Instance
Definition: typeinfo.h:144
nap::rtti::EPropertyFileType
EPropertyFileType
Definition: typeinfo.h:175
nap::rtti::Variant
rttr::variant Variant
Definition: typeinfo.h:143
nap::rtti::ETypeCheck::IS_DERIVED_FROM
@ IS_DERIVED_FROM
The type is derived from the specified type.
nap::rtti::EPropertyFileType::Python
@ Python
Points to a .py file, must be used with EPropertyMetaData::FileLink.
nap::rtti::TypeInfo
rttr::type TypeInfo
Definition: typeinfo.h:140
nap::rtti::ETypeCheck
ETypeCheck
Definition: typeinfo.h:236
nap::rtti::operator&
EPropertyMetaData operator&(EPropertyMetaData a, EPropertyMetaData b)
Definition: typeinfo.h:190
nap::rtti::operator|
EPropertyMetaData operator|(EPropertyMetaData a, EPropertyMetaData b)
Definition: typeinfo.h:195
nap::Mesh
Definition: mesh.h:424
nap::rtti::EPropertyFileType::Audio
@ Audio
Points to an audio file, must be used with EPropertyMetaData::FileLink.