HiPipe  0.7.0
C++17 data pipeline with Python bindings.
Classes | Functions
Bidirectional map between indices and values.

Classes

class  hipipe::index_mapper< T >
 Provides a bidirectional access from values to their indices in an std::vector. More...
 

Functions

template<typename Rng , typename T = ranges::range_value_t<Rng>>
index_mapper< T > hipipe::make_unique_index_mapper (Rng &&rng)
 Make index mapper from unique elements of a range. More...
 

Detailed Description

Function Documentation

◆ make_unique_index_mapper()

template<typename Rng , typename T = ranges::range_value_t<Rng>>
index_mapper<T> hipipe::make_unique_index_mapper ( Rng &&  rng)

Make index mapper from unique elements of a range.

Example:

std::vector<std::string> data = {"bum", "bada", "bum", "bum", "bada", "yeah!"};
index_mapper<std::string> mapper = make_unique_index_mapper(data);
// mapper.values() == {"bum", "bada", "yeah!"}
Parameters
rngThe range of values to be inserted.
Returns
The index mapper made of unique values of the range.

Definition at line 214 of file index_mapper.hpp.

hipipe::make_unique_index_mapper
index_mapper< T > make_unique_index_mapper(Rng &&rng)
Make index mapper from unique elements of a range.
Definition: index_mapper.hpp:214