Go to the documentation of this file.
37 template <
class ObjectTypePtr,
class Id = std::
string>
58 ARMARX_IMPORTANT <<
"Clearing global cache for type " << armarx::GetTypeString<ObjectTypePtr>(
true);
72 auto it = map.find(
id);
79 throw LocalException(
"key not found!");
87 auto it = map.find(
id);
90 throw LocalException(
"key exists already");
92 map.insert(std::make_pair(
id, obj));
97 static std::atomic<int> InstanceCounter = {0};
98 return InstanceCounter;
109 static std::map<Id, ObjectTypePtr> map;
std::map< Id, ObjectTypePtr > & getCache() const
bool hasObject(const Id &id) const
Mutex::scoped_lock ScopedLock
std::atomic< int > & getInstanceCounter()
ScopedLockPtr getMapLock() const
GlobalCache(const GlobalCache &source)
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
std::shared_ptr< ScopedLock > ScopedLockPtr
ObjectTypePtr getCacheObject(const Id &id)
This file offers overloads of toIce() and fromIce() functions for STL container types.
void insertObject(const Id &id, const ObjectTypePtr &obj)