Maria GDK 5.0.0.737
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::TileData Class Reference

#include <MTileData.h>

Inheritance diagram for Maria::TileData:
Maria3D::ForestData Maria3D::GeometryData Maria3D::MapTextureData Maria3D::TextureData Maria::ElevationTileData Maria::MapTileData

Public Types

enum  TileState {
  Empty , Pending , Ready , OutsideArea ,
  OutsideResolution , Error
}
 

Public Member Functions

 TileData (TileId tileId, const std::shared_ptr< Maria::SharedCounter > &memCounter)
 
void SetState (TileState state)
 
TileState GetState () const
 
bool SetPendingDataRequest ()
 
void SetTimestamp (int64_t timestamp)
 
int64_t GetTimestamp () const
 
void SetTileId (TileId tileId)
 
TileId GetTileId () const
 
const BasicGeoTypes::GeoRectGetGeoRect () const
 
void SetGeoRect (const BasicGeoTypes::GeoRect &grc)
 
int getMemSize () const
 
virtual bool ProcessData (const MariaProtobuf::ProtoMapData &data)
 
const std::shared_ptr< MariaProtobuf::Metadata > & getMetaData () const
 
void setMetaData (const std::shared_ptr< MariaProtobuf::Metadata > &metaData)
 

Static Public Member Functions

static int getNumTilesInMemory ()
 

Protected Attributes

std::atomic< TileState_state
 
std::mutex _requestLock
 
TileId _tile_id
 
std::atomic< int64_t > _timestamp
 
int _memsize
 
std::shared_ptr< Maria::SharedCounter_cache_mem_counter
 
BasicGeoTypes::GeoRect _grc
 
std::shared_ptr< MariaProtobuf::Metadata > _metaData
 

Detailed Description

TileData - Short description. Detailed description.

Member Enumeration Documentation

◆ TileState

Enumerator
Empty 

No data exists in the tile, no request has been made.

Pending 

Data has been requested.

Ready 

Data has been recieved and processed. Tile is ready for use.

OutsideArea 

Tile request failed due to the request being ouside of the data area.

OutsideResolution 

Tile request failed due to the request being outside of the resolution range of the data set.

Error 

Tile request failed due to an unrecoverable error.

Member Function Documentation

◆ GetTimestamp()

int64_t Maria::TileData::GetTimestamp ( ) const
inline

Get timestamp. This value is used for LRU caching, and should be updated each time a tile is used.

◆ ProcessData()

bool Maria::TileData::ProcessData ( const MariaProtobuf::ProtoMapData &  data)
virtual

Process the newly loaded data. This virtual method is run after the data has been received and unpacked. This happens in the same thread as the data unpacking, which is separate from both main thread and data reader threads. This method can be used to do potentially costly data processing that needs to be done before the data can be used for rendering.

Returns
True if processing went ok. This will cause the tile state to be set to TileData::Redy. False if processing failed, and state is set to TileData::Error.

Reimplemented in Maria3D::ForestData, Maria3D::TextureData, Maria3D::GeometryData, Maria::ElevationTileData, and Maria::MapTileData.

◆ SetPendingDataRequest()

bool Maria::TileData::SetPendingDataRequest ( )
inline

Atomically shcedule tile data for request. This method ensures that the tile has not already been requested before adding it to the request queue. Use this when the same tile can be requested from multiple threads.

The pattern for adding a tile request is typically:

if(tile->SetPendingIfEmpty()) { if(!dataReader->AddDataRequest(query, tile) tile->setState(TileData::Empty); }

Returns
true if the tile can be added to the data reader, false if not.

◆ SetTimestamp()

void Maria::TileData::SetTimestamp ( int64_t  timestamp)
inline

Set timestamp. This value is used for LRU caching, and should be updated each time a tile is used.


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