Template Class VariantChannelMap
Defined in File VariantChannelMap.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public std::unordered_map< std::string, VariantChannel< T... > >
Derived Type
public lvr2::BaseBuffer(Class BaseBuffer)
Class Documentation
-
template<typename ...T>
class VariantChannelMap : public std::unordered_map<std::string, VariantChannel<T...>> Subclassed by lvr2::BaseBuffer
Public Types
-
using key_type = std::string
-
using val_type = VariantChannel<T...>
-
using base = std::unordered_map<std::string, VariantChannel<T...>>
Public Functions
-
template<typename U>
void add(const std::string &name, Channel<U> channel) Adds an Key + AttributeChannel to the map.
- Parameters:
name – [in] Key of the channel.
channel – [in] The channel.
-
template<typename U>
void add(const std::string &name) Adds an empty channel.
- Parameters:
name – [in] Key of the channel.
-
template<typename U>
void add(const std::string &name, size_t numElements, size_t width) Adds an empty channel with size.
- Parameters:
name – [in] Key of the channel.
numElements – [in] Number of elements in channel.
width – [in] Element size.
-
template<typename U>
Channel<U> &get(const std::string &name) Gets AttributeChannel with type U from map as reference.
- Parameters:
name – [in] Key of the channel.
-
template<typename U>
const Channel<U> &get(const std::string &name) const Gets AttributeChannel by type U from map.
- Parameters:
name – [in] Key of the channel.
-
int type(const std::string &name) const
Gets type index of a map entry.
- Parameters:
Key – [in] of the channel.
- Returns:
Index of type tuple of the variant.
-
template<typename U>
bool is_type(const std::string &name) const Checks if key has specific type U.
Example Usage: cm.is_type<float>(“points”) -> true
- Parameters:
name – [in] Key of the channel.
- Template Parameters:
U – Type of the value to check.
- Returns:
true If the type is equal.
- Returns:
false If the type is unequal.
-
template<typename U>
std::vector<std::string> keys() Gets the available keys by a specific type.
- Template Parameters:
U – Type of the channels.
- Returns:
Vector of keys.
-
template<typename U>
size_t numChannels() Counts the number of channels by a specific type. @detail For total number of channels use “size()”.
- Template Parameters:
U – Type of the channels.
- Returns:
Number of channels.
-
template<typename U>
inline const_iterator<U> typedBegin() const
-
template<typename V>
inline VariantChannelMap<T...> manipulate(V visitor)
-
VariantChannelMap<T...> clone() const
Friends
-
inline friend std::ostream &operator<<(std::ostream &os, const VariantChannelMap<T...> &cm)
Output cout.
-
template<typename U>
struct const_iterator Public Types
-
using pointer = std::shared_ptr<resolved_elem_type>
Public Functions
-
inline resolved_elem_type operator*() const noexcept
-
inline const_iterator<U> &operator++() noexcept
-
inline const_iterator<U> operator++(int) noexcept
-
using pointer = std::shared_ptr<resolved_elem_type>
-
template<class U>
struct index_of_type Access type index by type.
Example usage: ChanneVariantMap<int, float> my_map; ChanneVariantMap<int, float>::type_index<int>::value -> 0
-
template<typename U>
struct iterator Public Types
-
using pointer = std::shared_ptr<resolved_elem_type>
Public Functions
-
inline resolved_elem_type operator*() const noexcept
-
using pointer = std::shared_ptr<resolved_elem_type>
-
using key_type = std::string