3 #ifndef LVR2_TYPES_VARIANTCHANNEL
4 #define LVR2_TYPES_VARIANTCHANNEL
6 #include <boost/variant.hpp>
17 template<
typename... T>
20 using base = boost::variant<Channel<T>...>;
23 template <
class T1,
class Tuple>
39 static constexpr std::size_t
num_types = std::tuple_size<types>::value;
41 template <std::
size_t N>
49 boost::shared_array<U>
dataPtr()
const;
51 template<std::
size_t N>
52 boost::shared_array<type_of_index<N> >
dataPtr()
const
78 os <<
"type: " << ch.
type() <<
", " <<
static_cast <const base &
>(ch);
100 return channel.
width();
108 std::enable_if_t<std::is_same<U, V>::value,
int> = 0>
115 std::enable_if_t<!std::is_same<U, V>::value,
int> = 0>
118 throw std::invalid_argument(
"tried to get wrong type of channel");
119 return boost::shared_array<U>();
123 struct CloneVisitor :
public boost::static_visitor< VariantChannel<T...> >
128 return channel.
clone();
132 template <
class T1,
class... Types>
134 static constexpr std::size_t value = 0;
137 template <
class T1,
class U,
class... Types>
139 static constexpr std::size_t value = 1 +
TupleIndex<T1, std::tuple<Types...>>::value;
144 template<
typename ...Tp>
150 #include "VariantChannel.tcc"
152 #endif // LVR2_TYPES_VARIANTCHANNEL