#include <MeasurementContainerWithDimension.h>
|
template<std::size_t N = std::variant_size_v< measurement_container_variant_t >> |
static void | dumpVariantTypes (std::ostream &out) |
|
template<typename derived_t, typename ... T_Container>
class MeasurementContainerWithDimension< derived_t, T_Container >
Definition at line 38 of file MeasurementContainerWithDimension.h.
◆ measurement_container_variant_t
template<typename derived_t , typename ... T_Container>
◆ countDerivedVariants()
template<typename derived_t , typename ... T_Container>
template<typename container_t , std::size_t N = std::variant_size_v< measurement_container_variant_t >>
Definition at line 75 of file MeasurementContainerWithDimension.h.
80 if constexpr(isSameContainer<container_t, N-1>()) {
85 using this_container_type =
typename this_variant_type::container_type;
86 if constexpr(std::is_base_of_v<container_t, this_container_type>
87 && std::has_virtual_destructor_v<this_container_type> && std::has_virtual_destructor_v<container_t>) {
◆ countVariants()
template<typename derived_t , typename ... T_Container>
template<typename container_t , std::size_t N = std::variant_size_v< measurement_container_variant_t >>
|
inlinestaticconstexprprotected |
◆ derived()
template<typename derived_t , typename ... T_Container>
◆ dimMax()
template<typename derived_t , typename ... T_Container>
template<std::size_t N = std::variant_size_v< measurement_container_variant_t >>
|
inlinestaticconstexprprotected |
◆ dumpVariantTypes()
template<typename derived_t , typename ... T_Container>
template<std::size_t N = std::variant_size_v< measurement_container_variant_t >>
◆ getContainerWithDimension()
template<typename derived_t , typename ... T_Container>
template<typename container_t , std::size_t = std::variant_size_v< measurement_container_variant_t >>
Definition at line 236 of file MeasurementContainerWithDimension.h.
237 constexpr
unsigned int variant_multiplicity = countVariants<container_t>();
239 static constexpr std::size_t NVariants = std::variant_size_v< measurement_container_variant_t >;
240 if constexpr( variant_multiplicity == 1) {
241 return getContainerWithDimensionNoAmbiguities<container_t, false, NVariants>(
a);
244 if (variant_multiplicity==0) {
245 if (countDerivedVariants<container_t>(
a) == 1) {
246 return getContainerWithDimensionNoAmbiguities<container_t, false, NVariants>(
a);
249 DEBUG_TRACE( std::cout <<
"DEBUG need to search with dimension check for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
250 <<
" multiplicity : " << variant_multiplicity <<
" derived " << countDerivedVariants<container_t>(
a)
252 return getContainerWithDimensionNoAmbiguities<container_t, true, NVariants>(
a, getDimensionOfDerivedVariantOption<container_t,NVariants>(
a));
◆ getContainerWithDimensionNoAmbiguities()
template<typename derived_t , typename ... T_Container>
template<typename container_t , bool check_dimension, std::size_t N>
Definition at line 114 of file MeasurementContainerWithDimension.h.
120 return this_variant_type();
124 using this_container_type =
typename this_variant_type::container_type ;
125 DEBUG_TRACE( std::cout <<
"DEBUG search option for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
126 <<
" option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
127 <<
" check dimension ? " << check_dimension <<
" desired dimension " << dimension
129 if constexpr(std::is_same_v<this_container_type, container_t>) {
131 if constexpr(!check_dimension && countVariants<container_t>()==1) {
136 assert( (countVariants<this_container_type,N-1>()) == 0 );
137 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
138 <<
" foumd unambiguous option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
145 if (this_variant_type::dimension() == dimension) {
146 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
147 <<
" foumd dimension option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
153 else if constexpr(std::is_base_of_v<container_t, this_container_type>) {
155 if constexpr(std::has_virtual_destructor_v<this_container_type> && std::has_virtual_destructor_v<container_t>) {
158 const this_container_type *derived_container =
dynamic_cast<const this_container_type *
>(&
a);
159 if (derived_container) {
162 if constexpr(!check_dimension) {
166 if constexpr(countVariants<container_t,N-1>() != 0) {
170 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(this_container_type).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
171 <<
" foumd derived option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
177 if (this_variant_type::dimension() == dimension) {
178 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(this_container_type).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
179 <<
" derived with dimension option: " <<
N <<
" " <<
typeid(this_container_type).
name()
180 <<
" dim " << this_variant_type::dimension()
◆ getDimensionOfDerivedVariantOption()
template<typename derived_t , typename ... T_Container>
template<typename container_t , std::size_t N>
Definition at line 193 of file MeasurementContainerWithDimension.h.
200 using this_container_type =
typename this_variant_type::container_type;
202 DEBUG_TRACE( std::cout <<
"DEBUG determin dimension for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
203 <<
" option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
207 DEBUG_TRACE( std::cout <<
"DEBUG get dimension for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
208 <<
" option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
210 return derived_t::getDimension(
a);
212 else if constexpr(std::is_base_of_v<container_t, this_container_type>) {
213 DEBUG_TRACE( std::cout <<
"DEBUG try get dimension for derived " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
214 <<
" option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
217 if constexpr(std::has_virtual_destructor_v<this_container_type> && std::has_virtual_destructor_v<container_t>) {
221 if constexpr(countVariants<this_container_type>() > 1) {
224 const this_container_type *derived_container =
dynamic_cast<const this_container_type *
>(&
a);
225 if (derived_container) {
226 return derived_t::getDimension(*derived_container);
◆ isSameContainer()
template<typename derived_t , typename ... T_Container>
template<typename container_t , std::size_t N>
|
inlinestaticconstexprprotected |
◆ lvalue()
template<typename derived_t , typename ... T_Container>
template<typename T >
|
inlinestaticconstexprprotected |
◆ throwContainerNotInVariant()
template<typename derived_t , typename ... T_Container>
The documentation for this class was generated from the following file: