Go to the documentation of this file.
30 #ifndef LVR2_TYPES_VARIANTCHANNELMAP
31 #define LVR2_TYPES_VARIANTCHANNELMAP
33 #include <unordered_map>
42 template<
typename... T>
44 :
public std::unordered_map<std::string, VariantChannel<T...> >
49 using elem_type = std::pair<const key_type, val_type>;
65 template <std::
size_t N>
74 using pointer = std::shared_ptr<resolved_elem_type>;
79 typename base::iterator base_it,
80 typename base::iterator end_it)
129 inline bool operator==(
const typename base::iterator& rhs) noexcept
134 inline bool operator!=(
const typename base::iterator& rhs) noexcept
153 using pointer = std::shared_ptr<resolved_elem_type>;
158 typename base::const_iterator base_it,
159 typename base::const_iterator end_it)
208 inline bool operator==(
const typename base::const_iterator& rhs) noexcept
213 inline bool operator!=(
const typename base::const_iterator& rhs) noexcept
244 void add(
const std::string& name);
254 void add(
const std::string& name,
size_t numElements,
size_t width);
286 int type(
const std::string& name)
const;
298 bool is_type(
const std::string& name)
const;
308 std::vector<std::string>
keys();
324 typename base::iterator it_base = this->begin();
325 typename base::iterator it_end = this->end();
332 typename base::const_iterator it_base = this->begin();
333 typename base::const_iterator it_end = this->end();
342 typename base::iterator it_base =
erase(it());
343 typename base::iterator it_end = this->end();
351 for(
auto vchannel: *
this)
353 cm.insert({vchannel.first, boost::apply_visitor(visitor, vchannel.second)});
366 std::cout <<
"[ VariantChannelMap ]\n";
369 std::cout << it.first <<
": " << it.second <<
"\n";
377 #include "VariantChannelMap.tcc"
379 #endif // LVR2_TYPES_VARIANTCHANNELMAP
const_iterator< U > & operator++() noexcept
boost::optional< Channel< T > > Optional
static constexpr std::size_t value
std::vector< std::string > keys()
Gets the available keys by a specific type.
iterator< U > & operator++() noexcept
std::shared_ptr< resolved_elem_type > pointer
const_iterator(typename base::const_iterator base_it, typename base::const_iterator end_it)
bool operator!=(const typename base::const_iterator &rhs) noexcept
std::pair< const key_type &, const Channel< U > & > resolved_elem_type
bool operator!=(const typename base::iterator &rhs) noexcept
pointer operator->() const noexcept
std::pair< const key_type &, Channel< U > & > resolved_elem_type
size_t numChannels()
Counts the number of channels by a specific type. @detail For total number of channels use "size()".
bool is_type(const std::string &name) const
Checks if key has specific type U.
base::iterator operator()() const noexcept
friend std::ostream & operator<<(std::ostream &os, const VariantChannelMap< T... > &cm)
Output cout.
std::shared_ptr< resolved_elem_type > pointer
const_iterator< U > typedBegin() const
pointer operator->() const noexcept
resolved_elem_type operator*() const noexcept
Channel< U >::Optional getOptional(const std::string &name)
typename val_type::template type_of_index< N > type_of_index
iterator< U > typedBegin()
static constexpr std::size_t num_types
Channel< U > & get(const std::string &name)
Gets AttributeChannel with type U from map as reference.
VariantChannelMap< T... > clone() const
base::const_iterator m_end_it
base::iterator operator()() const noexcept
static constexpr std::size_t num_types
iterator< U > operator++(int) noexcept
base::const_iterator m_base_it
VariantChannelMap< T... > manipulate(V visitor)
void add(const std::string &name, Channel< U > channel)
Adds an Key + AttributeChannel to the map.
std::pair< const key_type, val_type > elem_type
bool operator==(const typename base::iterator &rhs) noexcept
resolved_elem_type operator*() const noexcept
const_iterator< U > operator++(int) noexcept
bool operator==(const typename base::const_iterator &rhs) noexcept
iterator(typename base::iterator base_it, typename base::iterator end_it)
iterator< U > erase(iterator< U > it)
int type(const std::string &name) const
Gets type index of a map entry.
std::unordered_map< std::string, VariantChannel< T... > > base
Access type index by type.
lvr2
Author(s): Thomas Wiemann
, Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:25