libdballe  7.6
Public Types | Public Member Functions
dballe::memdb::Index< T > Struct Template Reference

Index element positions based by one value. More...

#include <index.h>

Inheritance diagram for dballe::memdb::Index< T >:

Public Types

typedef std::map< T, std::set< size_t > >::const_iterator const_iterator
 

Public Member Functions

const std::set< size_t > * search (const T &el) const
 Lookup all positions for a value.
 
bool search (const T &el, stl::SetIntersection< size_t > &out) const
 Lookup all positions for a value, appending the results to a SetIntersection. More...
 
std::unique_ptr< stl::Sequences< size_t > > search_from (const T &first, bool &found) const
 Lookup all positions for a value and all values after it, appending the results to a Sequences. More...
 
std::unique_ptr< stl::Sequences< size_t > > search_to (const T &end, bool &found) const
 Lookup all positions all values before the given one, appending the results to a Sequences. More...
 
std::unique_ptr< stl::Sequences< size_t > > search_between (const T &first, const T &end, bool &found) const
 Lookup all positions all values between two extremes (first included, second excluded), appending the results to a Sequences. More...
 

Detailed Description

template<typename T>
struct dballe::memdb::Index< T >

Index element positions based by one value.

Member Function Documentation

template<typename T>
bool dballe::memdb::Index< T >::search ( const T &  el,
stl::SetIntersection< size_t > &  out 
) const

Lookup all positions for a value, appending the results to a SetIntersection.

Returns
false if el was not found; it leaves out untouched in that case
template<typename T>
std::unique_ptr< stl::Sequences<size_t> > dballe::memdb::Index< T >::search_between ( const T &  first,
const T &  end,
bool &  found 
) const

Lookup all positions all values between two extremes (first included, second excluded), appending the results to a Sequences.

If the extremes match the whole index, returns 0 without allocating a Sequences, and sets found to true.

If the extremes do not match anything in the index, returns 0 without allocating a Sequences and sets found to false.

Else, returns a Sequences and sets found to true.

template<typename T>
std::unique_ptr< stl::Sequences<size_t> > dballe::memdb::Index< T >::search_from ( const T &  first,
bool &  found 
) const

Lookup all positions for a value and all values after it, appending the results to a Sequences.

If the extremes match the whole index, returns 0 without allocating a Sequences, and sets found to true.

If the extremes do not match anything in the index, returns 0 without allocating a Sequences and sets found to false.

Else, returns a Sequences and sets found to true.

template<typename T>
std::unique_ptr< stl::Sequences<size_t> > dballe::memdb::Index< T >::search_to ( const T &  end,
bool &  found 
) const

Lookup all positions all values before the given one, appending the results to a Sequences.

If the extremes match the whole index, returns 0 without allocating a Sequences, and sets found to true.

If the extremes do not match anything in the index, returns 0 without allocating a Sequences and sets found to false.

Else, returns a Sequences and sets found to true.


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