libosmscout  1.1.1
Public Slots | Public Member Functions | Public Attributes | List of all members
osmscout::DBInstance Class Reference

#include <libosmscout-client-qt/include/osmscout/DBInstance.h>

Inheritance diagram for osmscout::DBInstance:
Inheritance graph
[legend]
Collaboration diagram for osmscout::DBInstance:
Collaboration graph
[legend]

Public Slots

void onThreadFinished ()
 

Public Member Functions

 DBInstance (const QString &path, const osmscout::DatabaseRef &database, const osmscout::LocationServiceRef &locationService, const osmscout::LocationDescriptionServiceRef &locationDescriptionService, const osmscout::MapServiceRef &mapService, const osmscout::StyleConfigRef &styleConfig)
 
 ~DBInstance () override
 
osmscout::GeoBox GetDBGeoBox () const
 
bool IsOpen () const
 
osmscout::DatabaseRef GetDatabase ()
 
osmscout::MapServiceRef GetMapService ()
 
osmscout::LocationDescriptionServiceRef GetLocationDescriptionService ()
 
osmscout::LocationServiceRef GetLocationService ()
 
osmscout::StyleConfigRef GetStyleConfig () const
 
qint64 LastUsageMs () const
 
bool LoadStyle (QString stylesheetFilename, std::unordered_map< std::string, bool > stylesheetFlags, QList< StyleError > &errors)
 
osmscout::MapPainterQtGetPainter ()
 
void close ()
 

Public Attributes

const QString path
 

Detailed Description

Instance of one osmscout database and database specific objects.

It is thread safe

Constructor & Destructor Documentation

◆ DBInstance()

osmscout::DBInstance::DBInstance ( const QString &  path,
const osmscout::DatabaseRef database,
const osmscout::LocationServiceRef locationService,
const osmscout::LocationDescriptionServiceRef locationDescriptionService,
const osmscout::MapServiceRef mapService,
const osmscout::StyleConfigRef styleConfig 
)
inline

◆ ~DBInstance()

osmscout::DBInstance::~DBInstance ( )
inlineoverride

Member Function Documentation

◆ close()

void osmscout::DBInstance::close ( )

◆ GetDatabase()

osmscout::DatabaseRef osmscout::DBInstance::GetDatabase ( )
inline

◆ GetDBGeoBox()

osmscout::GeoBox osmscout::DBInstance::GetDBGeoBox ( ) const
inline

◆ GetLocationDescriptionService()

osmscout::LocationDescriptionServiceRef osmscout::DBInstance::GetLocationDescriptionService ( )
inline

◆ GetLocationService()

osmscout::LocationServiceRef osmscout::DBInstance::GetLocationService ( )
inline

◆ GetMapService()

osmscout::MapServiceRef osmscout::DBInstance::GetMapService ( )
inline

◆ GetPainter()

osmscout::MapPainterQt* osmscout::DBInstance::GetPainter ( )

Get or create thread local MapPainter instance for this map

Note
To make sure that painter will not be destroyed during usage, read-lock for databases should be held.
Warning
It may be null when styleConfig is not loaded!
Returns
pointer to thread-local painter

◆ GetStyleConfig()

osmscout::StyleConfigRef osmscout::DBInstance::GetStyleConfig ( ) const
inline

◆ IsOpen()

bool osmscout::DBInstance::IsOpen ( ) const
inline

return true if database is open lastUsage is not udpated

◆ LastUsageMs()

qint64 osmscout::DBInstance::LastUsageMs ( ) const
inline

Returns the number of milliseconds since last database usage

◆ LoadStyle()

bool osmscout::DBInstance::LoadStyle ( QString  stylesheetFilename,
std::unordered_map< std::string, bool >  stylesheetFlags,
QList< StyleError > &  errors 
)

◆ onThreadFinished

void osmscout::DBInstance::onThreadFinished ( )
slot

Member Data Documentation

◆ path

const QString osmscout::DBInstance::path

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