|
libosmscout 0.1
|
Extension of DataFile to allow loading data not only by offset but by id using an additional index file, mapping objects id to object file offset. More...
#include <DataFile.h>
Public Types | |
| using | ValueType = std::shared_ptr<N> |
| Public Types inherited from osmscout::DataFile< N > | |
| using | ValueCache = Cache<FileOffset, std::shared_ptr<N> > |
| using | ValueCacheEntry = typename Cache<FileOffset, ValueType>::CacheEntry |
| using | ValueCacheRef = typename Cache<FileOffset, ValueType>::CacheRef |
| using | ValueType = std::shared_ptr<N> |
Public Member Functions | |
| bool | Close () override |
| Close the index. | |
| bool | Get (const std::list< I > &ids, std::vector< ValueType > &data) const |
| bool | Get (const std::set< I > &ids, std::unordered_map< I, ValueType > &data) const |
| bool | Get (const std::set< I > &ids, std::vector< ValueType > &data) const |
| bool | Get (const std::vector< I > &ids, std::vector< ValueType > &data) const |
| bool | Get (I id, ValueType &entry) const |
| bool | GetOffset (I id, FileOffset &offset) const |
| template<typename IteratorIn> | |
| bool | GetOffsets (IteratorIn begin, IteratorIn end, size_t size, std::vector< FileOffset > &offsets) const |
| IndexedDataFile (const std::string &datafile, const std::string &indexfile, size_t indexCacheSize, size_t dataCacheSize) | |
| bool | IsOpen () const override |
| Return true, if index is currently opened. | |
| bool | Open (const TypeConfigRef &typeConfig, const std::string &path, bool memoryMappedIndex, bool memoryMappedData) |
| Public Member Functions inherited from osmscout::DataFile< N > | |
| DataFile (const DataFile &)=delete | |
| DataFile (const std::string &datafile, size_t cacheSize) | |
| DataFile (DataFile &&)=delete | |
| void | FlushCache () |
| bool | GetByBlockSpan (const DataBlockSpan &span, std::vector< ValueType > &data) const |
| Read data values from the given DataBlockSpan. | |
| template<typename IteratorIn> | |
| bool | GetByBlockSpans (IteratorIn begin, IteratorIn end, std::vector< ValueType > &data) const |
| Read data values from the given DataBlockSpans. | |
| bool | GetByOffset (FileOffset offset, ValueType &entry) const |
| Read one data value from the given file offset. | |
| template<typename IteratorIn> | |
| bool | GetByOffset (IteratorIn begin, IteratorIn end, size_t size, const GeoBox &boundingBox, std::vector< ValueType > &data) const |
| Read data values from the given file offsets. | |
| template<typename IteratorIn> | |
| bool | GetByOffset (IteratorIn begin, IteratorIn end, size_t size, std::unordered_map< FileOffset, ValueType > &dataMap) const |
| Read data values from the given file offsets. | |
| template<typename IteratorIn> | |
| bool | GetByOffset (IteratorIn begin, IteratorIn end, size_t size, std::vector< ValueType > &data) const |
| Reads data for the given file offsets. | |
| std::string | GetFilename () const |
| bool | Open (const TypeConfigRef &typeConfig, const std::string &path, bool memoryMappedData) |
| Open the index file. | |
| DataFile & | operator= (const DataFile &)=delete |
| DataFile & | operator= (DataFile &&)=delete |
| virtual | ~DataFile () |
Additional Inherited Members | |
| Protected Attributes inherited from osmscout::DataFile< N > | |
| TypeConfigRef | typeConfig |
Extension of DataFile to allow loading data not only by offset but by id using an additional index file, mapping objects id to object file offset.
| using osmscout::IndexedDataFile< I, N >::ValueType = std::shared_ptr<N> |
| osmscout::IndexedDataFile< I, N >::IndexedDataFile | ( | const std::string & | datafile, |
| const std::string & | indexfile, | ||
| size_t | indexCacheSize, | ||
| size_t | dataCacheSize ) |
References osmscout::DataFile< N >::DataFile().
|
overridevirtual |
Close the index.
Method is NOT thread-safe.
Reimplemented from osmscout::DataFile< N >.
References osmscout::DataFile< N >::Close().
| bool osmscout::IndexedDataFile< I, N >::Get | ( | const std::list< I > & | ids, |
| std::vector< ValueType > & | data ) const |
References osmscout::DataFile< N >::GetByOffset().
| bool osmscout::IndexedDataFile< I, N >::Get | ( | const std::set< I > & | ids, |
| std::unordered_map< I, ValueType > & | data ) const |
References osmscout::DataFile< N >::GetByOffset().
| bool osmscout::IndexedDataFile< I, N >::Get | ( | const std::set< I > & | ids, |
| std::vector< ValueType > & | data ) const |
References osmscout::DataFile< N >::GetByOffset().
| bool osmscout::IndexedDataFile< I, N >::Get | ( | const std::vector< I > & | ids, |
| std::vector< ValueType > & | data ) const |
References osmscout::DataFile< N >::GetByOffset().
| bool osmscout::IndexedDataFile< I, N >::Get | ( | I | id, |
| ValueType & | entry ) const |
References osmscout::DataFile< N >::GetByOffset().
| bool osmscout::IndexedDataFile< I, N >::GetOffset | ( | I | id, |
| FileOffset & | offset ) const |
| bool osmscout::IndexedDataFile< I, N >::GetOffsets | ( | IteratorIn | begin, |
| IteratorIn | end, | ||
| size_t | size, | ||
| std::vector< FileOffset > & | offsets ) const |
|
overridevirtual |
Return true, if index is currently opened.
Method is NOT thread-safe.
Reimplemented from osmscout::DataFile< N >.
References osmscout::DataFile< N >::IsOpen().
| bool osmscout::IndexedDataFile< I, N >::Open | ( | const TypeConfigRef & | typeConfig, |
| const std::string & | path, | ||
| bool | memoryMappedIndex, | ||
| bool | memoryMappedData ) |
References osmscout::DataFile< N >::Open(), and osmscout::DataFile< N >::typeConfig.