VISR  0.12.0
Versatile Interactive Scene Renderer
parameter_type.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_PARAMETER_TYPE_HPP_INCLUDED
4 #define VISR_PARAMETER_TYPE_HPP_INCLUDED
5 
7 
8 #include <cstddef>
9 
10 namespace visr
11 {
12 
13 using ParameterType = uint64_t;
14 
26 template< typename Parameter >
27 struct ParameterToId {};
28 
36 template< ParameterType Id >
38 
42 template< typename Parameter >
44 
45 } // namespace visr
46 
60 #define DEFINE_PARAMETER_TYPE( ParameterClassType, ParameterId, ParameterConfigType)\
61 namespace visr { \
62 template<> \
63 struct ParameterToId< ParameterClassType > \
64 {\
65 public:\
66  enum : ParameterType { id = ParameterId };\
67  using ConfigType = ParameterConfigType; \
68 };\
69  template<> \
70 struct IdToParameter< ParameterId > \
71 { \
72 public: \
73  using Type = ParameterClassType; \
74 }; \
75  template<> \
76 struct ParameterToConfigType< ParameterClassType > \
77 {\
78 public:\
79  using ConfigType = ParameterConfigType;\
80 }; \
81 }
82 
83 #endif // #ifndef VISR_PARAMETER_TYPE_HPP_INCLUDED
Definition: parameter_type.hpp:37
uint64_t ParameterType
Definition: parameter_type.hpp:13
Definition: parameter_type.hpp:43
Definition: options.cpp:10
Definition: parameter_type.hpp:27