libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
db
BasemapDatabase.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_BASEMAPDATABASE_H
2
#define OSMSCOUT_BASEMAPDATABASE_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2017 Tim Teulings
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
// Type and style sheet configuration
24
#include <
osmscout/OSMScoutTypes.h
>
25
#include <
osmscout/TypeConfig.h
>
26
27
// Water index
28
#include <
osmscout/db/WaterIndex.h
>
29
30
#include <
osmscout/system/Compiler.h
>
31
32
namespace
osmscout
{
33
38
class
OSMSCOUT_API
BasemapDatabaseParameter
CLASS_FINAL
39
{
40
private
:
41
bool
dataMMap{
true
};
42
43
public
:
44
BasemapDatabaseParameter
() =
default
;
45
46
void
SetDataMMap
(
bool
mmap);
47
bool
GetDataMMap
()
const
;
48
};
49
63
class
OSMSCOUT_API
BasemapDatabase
CLASS_FINAL
64
{
65
private
:
66
BasemapDatabaseParameter parameter;
67
68
std::string path;
69
bool
isOpen;
70
71
mutable
WaterIndexRef
waterIndex;
72
mutable
std::mutex waterIndexMutex;
73
74
public
:
75
explicit
BasemapDatabase
(
const
BasemapDatabaseParameter
& parameter);
76
virtual
~BasemapDatabase
();
77
78
bool
Open
(
const
std::string& path);
79
bool
IsOpen
()
const
;
80
void
Close
();
81
82
std::string
GetPath
()
const
;
83
84
WaterIndexRef
GetWaterIndex
()
const
;
85
};
86
88
using
BasemapDatabaseRef
= std::shared_ptr<BasemapDatabase>;
89
}
90
91
#endif
Compiler.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
OSMScoutTypes.h
TypeConfig.h
WaterIndex.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::Open
bool Open(const std::string &path)
osmscout::CLASS_FINAL::IsOpen
bool IsOpen() const
osmscout::CLASS_FINAL::GetWaterIndex
WaterIndexRef GetWaterIndex() const
osmscout::CLASS_FINAL::GetPath
std::string GetPath() const
osmscout::CLASS_FINAL::BasemapDatabaseParameter
BasemapDatabaseParameter()=default
osmscout::CLASS_FINAL::SetDataMMap
void SetDataMMap(bool mmap)
osmscout::CLASS_FINAL::~BasemapDatabase
virtual ~BasemapDatabase()
osmscout::CLASS_FINAL::BasemapDatabase
BasemapDatabase(const BasemapDatabaseParameter ¶meter)
osmscout::CLASS_FINAL::GetDataMMap
bool GetDataMMap() const
osmscout::CLASS_FINAL::Close
void Close()
osmscout
Definition
Area.h:39
osmscout::WaterIndexRef
std::shared_ptr< WaterIndex > WaterIndexRef
Definition
WaterIndex.h:107
osmscout::BasemapDatabaseRef
std::shared_ptr< BasemapDatabase > BasemapDatabaseRef
Reference counted reference to an Database instance.
Definition
BasemapDatabase.h:88
Generated by
1.17.0