libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::NumericIndex< N > Class Template Reference

Numeric index handles an index over instance of class <T> where the index criteria is of type <N>, where <N> has a numeric nature (usually Id). More...

#include <NumericIndex.h>

Public Member Functions

bool Close ()
void DumpStatistics () const
bool GetOffset (const N &id, FileOffset &offset) const
 Return the file offset in the data file for the given object id.
template<typename IteratorIn>
bool GetOffsets (IteratorIn begin, IteratorIn end, size_t size, std::vector< FileOffset > &offsets) const
 Return the file offsets in the data file for the given object ids.
bool IsOpen () const
 NumericIndex (const std::string &filename, size_t cacheSize)
bool Open (const std::string &path, bool memoryMapped)
virtual ~NumericIndex ()

Detailed Description

template<class N>
class osmscout::NumericIndex< N >

Numeric index handles an index over instance of class <T> where the index criteria is of type <N>, where <N> has a numeric nature (usually Id).

Constructor & Destructor Documentation

◆ NumericIndex()

template<class N>
osmscout::NumericIndex< N >::NumericIndex ( const std::string & filename,
size_t cacheSize )

◆ ~NumericIndex()

template<class N>
osmscout::NumericIndex< N >::~NumericIndex ( )
virtual

References Close().

Member Function Documentation

◆ Close()

template<class N>
bool osmscout::NumericIndex< N >::Close ( )

◆ DumpStatistics()

template<class N>
void osmscout::NumericIndex< N >::DumpStatistics ( ) const

References osmscout::log.

◆ GetOffset()

template<class N>
bool osmscout::NumericIndex< N >::GetOffset ( const N & id,
FileOffset & offset ) const

Return the file offset in the data file for the given object id.

This method is thread-safe.

References osmscout::IOException::GetDescription(), and osmscout::log.

Referenced by GetOffsets().

◆ GetOffsets()

template<class N>
template<typename IteratorIn>
bool osmscout::NumericIndex< N >::GetOffsets ( IteratorIn begin,
IteratorIn end,
size_t size,
std::vector< FileOffset > & offsets ) const

Return the file offsets in the data file for the given object ids.

This method is thread-safe.

References GetOffset().

◆ IsOpen()

template<class N>
bool osmscout::NumericIndex< N >::IsOpen ( ) const

◆ Open()

template<class N>
bool osmscout::NumericIndex< N >::Open ( const std::string & path,
bool memoryMapped )

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