Classes | Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
lvr2::VariantChannelMap< T > Class Template Reference

#include <VariantChannelMap.hpp>

Inheritance diagram for lvr2::VariantChannelMap< T >:
Inheritance graph
[legend]

Classes

struct  const_iterator
 
struct  index_of_type
 Access type index by type. More...
 
struct  iterator
 

Public Types

using base = std::unordered_map< std::string, VariantChannel< T... > >
 
using elem_type = std::pair< const key_type, val_type >
 
using key_type = std::string
 
template<std::size_t N>
using type_of_index = typename val_type::template type_of_index< N >
 
using types = std::tuple< T... >
 
using val_type = VariantChannel< T... >
 

Public Member Functions

template<typename U >
void add (const std::string &name)
 Adds an empty channel. More...
 
template<typename U >
void add (const std::string &name, Channel< U > channel)
 Adds an Key + AttributeChannel to the map. More...
 
template<typename U >
void add (const std::string &name, size_t numElements, size_t width)
 Adds an empty channel with size. More...
 
VariantChannelMap< T... > clone () const
 
template<typename U >
iterator< U > erase (iterator< U > it)
 
template<typename U >
Channel< U > & get (const std::string &name)
 Gets AttributeChannel with type U from map as reference. More...
 
template<typename U >
const Channel< U > & get (const std::string &name) const
 Gets AttributeChannel by type U from map. More...
 
template<typename U >
Channel< U >::Optional getOptional (const std::string &name)
 
template<typename U >
const Channel< U >::Optional getOptional (const std::string &name) const
 
template<typename U >
bool is_type (const std::string &name) const
 Checks if key has specific type U. More...
 
template<typename U >
std::vector< std::string > keys ()
 Gets the available keys by a specific type. More...
 
template<typename V >
VariantChannelMap< T... > manipulate (V visitor)
 
template<typename U >
size_t numChannels ()
 Counts the number of channels by a specific type. @detail For total number of channels use "size()". More...
 
int type (const std::string &name) const
 Gets type index of a map entry. More...
 
template<typename U >
iterator< U > typedBegin ()
 
template<typename U >
const_iterator< U > typedBegin () const
 

Static Public Attributes

static constexpr std::size_t num_types = val_type::num_types
 

Friends

std::ostream & operator<< (std::ostream &os, const VariantChannelMap< T... > &cm)
 Output cout. More...
 

Detailed Description

template<typename... T>
class lvr2::VariantChannelMap< T >

Definition at line 43 of file VariantChannelMap.hpp.

Member Typedef Documentation

◆ base

template<typename... T>
using lvr2::VariantChannelMap< T >::base = std::unordered_map<std::string, VariantChannel<T...> >

Definition at line 52 of file VariantChannelMap.hpp.

◆ elem_type

template<typename... T>
using lvr2::VariantChannelMap< T >::elem_type = std::pair<const key_type, val_type>

Definition at line 49 of file VariantChannelMap.hpp.

◆ key_type

template<typename... T>
using lvr2::VariantChannelMap< T >::key_type = std::string

Definition at line 47 of file VariantChannelMap.hpp.

◆ type_of_index

template<typename... T>
template<std::size_t N>
using lvr2::VariantChannelMap< T >::type_of_index = typename val_type::template type_of_index<N>

Definition at line 66 of file VariantChannelMap.hpp.

◆ types

template<typename... T>
using lvr2::VariantChannelMap< T >::types = std::tuple<T...>

Definition at line 51 of file VariantChannelMap.hpp.

◆ val_type

template<typename... T>
using lvr2::VariantChannelMap< T >::val_type = VariantChannel<T...>

Definition at line 48 of file VariantChannelMap.hpp.

Member Function Documentation

◆ add() [1/3]

template<typename... T>
template<typename U >
void lvr2::VariantChannelMap< T >::add ( const std::string &  name)

Adds an empty channel.

Parameters
[in]nameKey of the channel.

◆ add() [2/3]

template<typename... T>
template<typename U >
void lvr2::VariantChannelMap< T >::add ( const std::string &  name,
Channel< U >  channel 
)

Adds an Key + AttributeChannel to the map.

Parameters
[in]nameKey of the channel.
[in]channelThe channel.

◆ add() [3/3]

template<typename... T>
template<typename U >
void lvr2::VariantChannelMap< T >::add ( const std::string &  name,
size_t  numElements,
size_t  width 
)

Adds an empty channel with size.

Parameters
[in]nameKey of the channel.
[in]numElementsNumber of elements in channel.
[in]widthElement size.

◆ clone()

template<typename... T>
VariantChannelMap<T...> lvr2::VariantChannelMap< T >::clone ( ) const

◆ erase()

template<typename... T>
template<typename U >
iterator<U> lvr2::VariantChannelMap< T >::erase ( iterator< U >  it)
inline

Definition at line 340 of file VariantChannelMap.hpp.

◆ get() [1/2]

template<typename... T>
template<typename U >
Channel<U>& lvr2::VariantChannelMap< T >::get ( const std::string &  name)

Gets AttributeChannel with type U from map as reference.

Parameters
[in]nameKey of the channel.

◆ get() [2/2]

template<typename... T>
template<typename U >
const Channel<U>& lvr2::VariantChannelMap< T >::get ( const std::string &  name) const

Gets AttributeChannel by type U from map.

Parameters
[in]nameKey of the channel.

◆ getOptional() [1/2]

template<typename... T>
template<typename U >
Channel<U>::Optional lvr2::VariantChannelMap< T >::getOptional ( const std::string &  name)

◆ getOptional() [2/2]

template<typename... T>
template<typename U >
const Channel<U>::Optional lvr2::VariantChannelMap< T >::getOptional ( const std::string &  name) const

◆ is_type()

template<typename... T>
template<typename U >
bool lvr2::VariantChannelMap< T >::is_type ( const std::string &  name) const

Checks if key has specific type U.

Example Usage: cm.is_type<float>("points") -> true

Parameters
[in]nameKey of the channel.
Template Parameters
UType of the value to check.
Returns
true If the type is equal.
false If the type is unequal.

◆ keys()

template<typename... T>
template<typename U >
std::vector<std::string> lvr2::VariantChannelMap< T >::keys ( )

Gets the available keys by a specific type.

Template Parameters
UType of the channels.
Returns
Vector of keys.

◆ manipulate()

template<typename... T>
template<typename V >
VariantChannelMap<T...> lvr2::VariantChannelMap< T >::manipulate ( visitor)
inline

Definition at line 348 of file VariantChannelMap.hpp.

◆ numChannels()

template<typename... T>
template<typename U >
size_t lvr2::VariantChannelMap< T >::numChannels ( )

Counts the number of channels by a specific type. @detail For total number of channels use "size()".

Template Parameters
UType of the channels.
Returns
Number of channels.

◆ type()

template<typename... T>
int lvr2::VariantChannelMap< T >::type ( const std::string &  name) const

Gets type index of a map entry.

Parameters
[in]Keyof the channel.
Returns
Index of type tuple of the variant.

◆ typedBegin() [1/2]

template<typename... T>
template<typename U >
iterator<U> lvr2::VariantChannelMap< T >::typedBegin ( )
inline

Definition at line 322 of file VariantChannelMap.hpp.

◆ typedBegin() [2/2]

template<typename... T>
template<typename U >
const_iterator<U> lvr2::VariantChannelMap< T >::typedBegin ( ) const
inline

Definition at line 330 of file VariantChannelMap.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename... T>
std::ostream& operator<< ( std::ostream &  os,
const VariantChannelMap< T... > &  cm 
)
friend

Output cout.

Definition at line 364 of file VariantChannelMap.hpp.

Member Data Documentation

◆ num_types

template<typename... T>
constexpr std::size_t lvr2::VariantChannelMap< T >::num_types = val_type::num_types
staticconstexpr

Definition at line 68 of file VariantChannelMap.hpp.


The documentation for this class was generated from the following file:


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:27