63 template<
typename T,
typename =
void>
68 struct IsDataModelType<T, Void<
decltype(acceptNodeType(std::decay<T>::type::nodeType))>> : std::true_type
77 typename std::enable_if<
81 static constexpr std::true_type isLeafHelper(
int);
82 template<
typename C,
typename... Args>
83 static constexpr std::false_type isLeafHelper(Args &&...);
86 using Type =
decltype(isLeafHelper<T>(0));
89 template<
typename T,
typename =
void>
97 template<
typename T,
typename =
void>
98 struct IsOptional : std::false_type
102 struct IsOptional<T, Void<decltype(std::declval<T>().hasValue())>> : std::true_type
105 template<
typename T,
typename =
void>
111 : std::integral_constant<
113 IsDataModelLeaf<T>::Type::value && IsDataModelRoot<typename std::decay_t<T>::ValueType>::value>
116 template<
typename T,
typename =
void>
117 struct HasValidRange : std::false_type
121 struct HasValidRange<T, Void<decltype(std::declval<typename std::decay<T>::type>().
validRange())>>
125 template<
typename T,
typename =
void>
126 struct HasValidValues : std::false_type
130 struct HasValidValues<T, Void<decltype(std::declval<typename std::decay<T>::type>().
validValues())>>
134 template<
typename T,
typename =
void>
135 struct HasValidSize : std::false_type
139 struct HasValidSize<T, Void<decltype(std::declval<typename std::decay<T>::type>().validSize())>>
183 "The template parameter to IsOptional must be a data model leaf type");
197 "The template parameter to HasValidRange must be a data model leaf type");
211 "The template parameter to HasValidValues must be a data model leaf type");
225 "The template parameter to HasValidSize must be a data model leaf type");
typename Detail::IsDataModelLeaf< T >::Type IsDataModelLeaf
Check if T is a data model leaf type.
Definition Traits.h:160
typename Detail::IsNestedDataModelLeaf< T > IsNestedDataModelLeaf
Check if T is a nested data model leaf type (a leaf with ValueType being another data model)
Definition Traits.h:168
NodeType
Definition NodeType.h:49
typename Detail::IsDataModelRoot< T >::type IsDataModelRoot
Check if T is the root of a data model.
Definition Traits.h:176
typename Detail::IsDataModelType< T >::type IsDataModelType
Check if T is a data model type.
Definition Traits.h:151
Ret validRange(const CameraInfo &cameraInfo)
Definition SettingsInfo.h:190
std::set< typename T::ValueType > validValues(const CameraInfo &cameraInfo)
Definition SettingsInfo.h:184
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84
Check if T has a ValidRange constraint.
Definition Traits.h:194
Check if T has a ValidSize constraint.
Definition Traits.h:222
Check if data model type T has a ValidValues constraint.
Definition Traits.h:208