libosmscout  1.1.1
Public Slots | Public Member Functions | Static Public Member Functions | Friends | List of all members
osmscout::OSMScoutQt Class Reference

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

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

Public Slots

void threadFinished ()
 

Public Member Functions

 ~OSMScoutQt () override
 
QThread * makeThread (QString name)
 
bool waitForReleasingResources (unsigned long mSleep, unsigned long maxCount) const
 
DBThreadRef GetDBThread () const
 
SettingsRef GetSettings () const
 
MapManagerRef GetMapManager () const
 
VoiceManagerRef GetVoiceManager ()
 
LookupModuleMakeLookupModule ()
 
MapRendererMakeMapRenderer (RenderingType type)
 
RouterMakeRouter ()
 
NavigationModuleMakeNavigation ()
 
SearchModuleMakeSearchModule ()
 
StyleModuleMakeStyleModule ()
 
POILookupModuleMakePOILookupModule ()
 
ElevationModuleMakeElevationModule ()
 
QString GetUserAgent () const
 
QString GetCacheLocation () const
 
size_t GetOnlineTileCacheSize () const
 
QString GetIconDirectory () const
 

Static Public Member Functions

static void RegisterQmlTypes (const char *uri="net.sf.libosmscout.map", int versionMajor=1, int versionMinor=0)
 
static OSMScoutQtBuilder NewInstance ()
 
static OSMScoutQtGetInstance ()
 
static void FreeInstance ()
 

Friends

class OSMScoutQtBuilder
 

Detailed Description

Singleton that provides access to high level modules of OSMScout library. On application start should be registered Qt types by static method RegisterQmlTypes(). OSMScoutQt instance may be created by NewInstance() and accessed by GetInstance() then. To free resources should be called FreeInstance() before program exits.

Example:

.WithStyleSheetDirectory(stylesheetDir)
.WithStyleSheetFile(stylesheetFileName)
.WithIconDirectory(iconDirectory)
.WithMapLookupDirectories(mapLookupDirectories)
.WithOnlineTileProviders(":/resources/online-tile-providers.json")
.WithMapProviders(":/resources/map-providers.json")
.Init();
if (!success){
// terminate program, or just report error - something is really bad
}
// now it is possible to access OSMScoutQt by OSMScoutQt::GetInstance()

Constructor & Destructor Documentation

◆ ~OSMScoutQt()

osmscout::OSMScoutQt::~OSMScoutQt ( )
override

Member Function Documentation

◆ FreeInstance()

static void osmscout::OSMScoutQt::FreeInstance ( )
static

◆ GetCacheLocation()

QString osmscout::OSMScoutQt::GetCacheLocation ( ) const

◆ GetDBThread()

DBThreadRef osmscout::OSMScoutQt::GetDBThread ( ) const

◆ GetIconDirectory()

QString osmscout::OSMScoutQt::GetIconDirectory ( ) const

◆ GetInstance()

static OSMScoutQt& osmscout::OSMScoutQt::GetInstance ( )
static

◆ GetMapManager()

MapManagerRef osmscout::OSMScoutQt::GetMapManager ( ) const

◆ GetOnlineTileCacheSize()

size_t osmscout::OSMScoutQt::GetOnlineTileCacheSize ( ) const

◆ GetSettings()

SettingsRef osmscout::OSMScoutQt::GetSettings ( ) const

◆ GetUserAgent()

QString osmscout::OSMScoutQt::GetUserAgent ( ) const

◆ GetVoiceManager()

VoiceManagerRef osmscout::OSMScoutQt::GetVoiceManager ( )

◆ MakeElevationModule()

ElevationModule* osmscout::OSMScoutQt::MakeElevationModule ( )

◆ MakeLookupModule()

LookupModule* osmscout::OSMScoutQt::MakeLookupModule ( )

◆ MakeMapRenderer()

MapRenderer* osmscout::OSMScoutQt::MakeMapRenderer ( RenderingType  type)

◆ MakeNavigation()

NavigationModule* osmscout::OSMScoutQt::MakeNavigation ( )

◆ MakePOILookupModule()

POILookupModule* osmscout::OSMScoutQt::MakePOILookupModule ( )

◆ MakeRouter()

Router* osmscout::OSMScoutQt::MakeRouter ( )

◆ MakeSearchModule()

SearchModule* osmscout::OSMScoutQt::MakeSearchModule ( )

◆ MakeStyleModule()

StyleModule* osmscout::OSMScoutQt::MakeStyleModule ( )

◆ makeThread()

QThread* osmscout::OSMScoutQt::makeThread ( QString  name)

Create new background thread with given name.

Usage:

QThread *t=OSMScoutQt::GetInstance().makeThread("OverlayTileLoader"); Service *service=new Service(t); service->moveToThread(thread); connect(thread, SIGNAL(started()), service, SLOT(init())); thread->start();

Service should stop thread in own destructor: QThread::stop()

Parameters
name
Returns
thread

◆ NewInstance()

static OSMScoutQtBuilder osmscout::OSMScoutQt::NewInstance ( )
static

◆ RegisterQmlTypes()

static void osmscout::OSMScoutQt::RegisterQmlTypes ( const char *  uri = "net.sf.libosmscout.map",
int  versionMajor = 1,
int  versionMinor = 0 
)
static

◆ threadFinished

void osmscout::OSMScoutQt::threadFinished ( )
slot

◆ waitForReleasingResources()

bool osmscout::OSMScoutQt::waitForReleasingResources ( unsigned long  mSleep,
unsigned long  maxCount 
) const

Wait for releasing of dbThread shared pointer from other threads and terminating all created service threads. This waiting has configurable timeout, up to [mSleep * maxCount] milliseconds.

Note that on success, this method don't guarantee that dbThread is not used from another thread, see std::shared_ptr::use_count() documentation.

Parameters
mSleepwait period between checks (in milliseconds)
maxCountmaximul count
Returns
true if dbThread is holding just from current thread (dbThread.use_count() == 1) and all previously created service threads are terminated.

Friends And Related Function Documentation

◆ OSMScoutQtBuilder

friend class OSMScoutQtBuilder
friend

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