|
libosmscout 1.1.1
|
#include <libosmscout/include/osmscout/io/DataFile.h>


Public Types | |
| using | ValueType = std::shared_ptr<N> |
| using | ValueCache = Cache<FileOffset, std::shared_ptr<N> > |
| using | ValueCacheEntry = typename Cache<FileOffset, ValueType>::CacheEntry |
| using | ValueCacheRef = typename Cache<FileOffset, ValueType>::CacheRef |
Public Member Functions | |
| DataFile (const std::string &datafile, size_t cacheSize) | |
| DataFile (const DataFile &)=delete | |
| DataFile (DataFile &&)=delete | |
| DataFile & | operator= (const DataFile &)=delete |
| DataFile & | operator= (DataFile &&)=delete |
| virtual | ~DataFile () |
| bool | Open (const TypeConfigRef &typeConfig, const std::string &path, bool memoryMappedData) |
| virtual bool | IsOpen () const |
| virtual bool | Close () |
| void | FlushCache () |
| std::string | GetFilename () const |
| bool | GetByOffset (FileOffset offset, ValueType &entry) const |
| bool | GetByBlockSpan (const DataBlockSpan &span, std::vector< ValueType > &data) const |
| template<typename IteratorIn> | |
| bool | GetByOffset (IteratorIn begin, IteratorIn end, size_t size, std::vector< ValueType > &data) const |
| template<typename IteratorIn> | |
| bool | GetByOffset (IteratorIn begin, IteratorIn end, size_t size, const GeoBox &boundingBox, std::vector< ValueType > &data) const |
| template<typename IteratorIn> | |
| bool | GetByOffset (IteratorIn begin, IteratorIn end, size_t size, std::unordered_map< FileOffset, ValueType > &dataMap) const |
| template<typename IteratorIn> | |
| bool | GetByBlockSpans (IteratorIn begin, IteratorIn end, std::vector< ValueType > &data) const |
Protected Attributes | |
| TypeConfigRef | typeConfig |
Access to standard format data files.
Allows to load data objects by offset using various standard library data structures.
| using osmscout::DataFile< N >::ValueCache = Cache<FileOffset, std::shared_ptr<N> > |
| using osmscout::DataFile< N >::ValueCacheEntry = typename Cache<FileOffset, ValueType>::CacheEntry |
| using osmscout::DataFile< N >::ValueCacheRef = typename Cache<FileOffset, ValueType>::CacheRef |
| using osmscout::DataFile< N >::ValueType = std::shared_ptr<N> |
| osmscout::DataFile< N >::DataFile | ( | const std::string & | datafile, |
| size_t | cacheSize ) |
|
delete |
|
delete |
|
virtual |
|
virtual |
Close the index.
Method is NOT thread-safe.
Reimplemented in osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::IndexedDataFile< I, N >, osmscout::IndexedDataFile< Id, osmscout::CLASS_FINAL::Intersection >, osmscout::IndexedDataFile< OSMId, RawRelation >, and osmscout::IndexedDataFile< OSMId, RawWay >.
| void osmscout::DataFile< N >::FlushCache | ( | ) |
| bool osmscout::DataFile< N >::GetByBlockSpan | ( | const DataBlockSpan & | span, |
| std::vector< ValueType > & | data ) const |
Read data values from the given DataBlockSpan.
Method is thread-safe.
| bool osmscout::DataFile< N >::GetByBlockSpans | ( | IteratorIn | begin, |
| IteratorIn | end, | ||
| std::vector< ValueType > & | data ) const |
Read data values from the given DataBlockSpans.
Method is thread-safe.
| bool osmscout::DataFile< N >::GetByOffset | ( | FileOffset | offset, |
| ValueType & | entry ) const |
Read one data value from the given file offset.
Method is thread-safe.
| bool osmscout::DataFile< N >::GetByOffset | ( | IteratorIn | begin, |
| IteratorIn | end, | ||
| size_t | size, | ||
| const GeoBox & | boundingBox, | ||
| std::vector< ValueType > & | data ) const |
Read data values from the given file offsets.
Method is thread-safe.
| bool osmscout::DataFile< N >::GetByOffset | ( | IteratorIn | begin, |
| IteratorIn | end, | ||
| size_t | size, | ||
| std::unordered_map< FileOffset, ValueType > & | dataMap ) const |
Read data values from the given file offsets.
Method is thread-safe.
| bool osmscout::DataFile< N >::GetByOffset | ( | IteratorIn | begin, |
| IteratorIn | end, | ||
| size_t | size, | ||
| std::vector< ValueType > & | data ) const |
Reads data for the given file offsets. File offsets are passed by iterator over some container. the size parameter hints as the number of entries returned by the iterators and is used to preallocate enough room in the result vector.
| N | Object type managed by the data file |
| IteratorIn | Iterator over a colection |
| begin | Start iterator for the file offset |
| end | End iterator for the file offset |
| size | Number of entries returnd by the begin, end itertaor pair. USed for preallocating enough space in result vector. |
| data | vector containing data. Data is appended. |
Method is thread-safe.
|
inline |
|
virtual |
Return true, if index is currently opened.
Method is NOT thread-safe.
Reimplemented in osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::CLASS_FINAL< DataLoader >, osmscout::IndexedDataFile< I, N >, osmscout::IndexedDataFile< Id, osmscout::CLASS_FINAL::Intersection >, osmscout::IndexedDataFile< OSMId, RawRelation >, and osmscout::IndexedDataFile< OSMId, RawWay >.
| bool osmscout::DataFile< N >::Open | ( | const TypeConfigRef & | typeConfig, |
| const std::string & | path, | ||
| bool | memoryMappedData ) |
Open the index file.
Method is NOT thread-safe.
|
delete |
|
delete |
|
protected |