#include "WorldModelStore.h"
◆ ModelFileMap
◆ AcquireModelInstance()
| std::shared_ptr< VMAP::WorldModel > WorldModelStore::AcquireModelInstance |
( |
std::string const & |
basepath, |
|
|
std::string const & |
filename, |
|
|
uint32 |
flags |
|
) |
| |
Critical section, thread safe access
22{
24 std::lock_guard<std::mutex> lock(
_lock);
25
28 {
29 std::shared_ptr<VMAP::WorldModel> worldmodel = std::make_shared<VMAP::WorldModel>();
30 LOG_DEBUG(
"maps",
"WorldModelStore: loading file '{}{}'", basepath, filename);
31 if (!worldmodel->readFile(basepath + filename + ".vmo"))
32 {
33 LOG_ERROR(
"maps",
"WorldModelStore: could not load '{}{}.vmo'", basepath, filename);
34 return nullptr;
35 }
36
37 worldmodel->Flags = flags;
38
39 model =
_loadedModels.insert(std::pair<std::string, std::shared_ptr<VMAP::WorldModel>>(filename, worldmodel)).first;
40 }
41
42 return model->second;
43}
#define LOG_ERROR(filterType__,...)
Definition Log.h:158
#define LOG_DEBUG(filterType__,...)
Definition Log.h:170
ModelFileMap _loadedModels
Definition WorldModelStore.h:39
std::mutex _lock
Definition WorldModelStore.h:41
References _loadedModels, _lock, LOG_DEBUG, and LOG_ERROR.
◆ instance()
30 {
33 }
Definition WorldModelStore.h:27
static WorldModelStore * instance()
Definition WorldModelStore.h:29
References instance().
Referenced by instance().
◆ _loadedModels
◆ _lock
| std::mutex WorldModelStore::_lock |
|
private |
The documentation for this class was generated from the following files: