Go to the documentation of this file.
38 template <
class ObjectTypePtr,
class Id = std::
string>
61 << armarx::GetTypeString<ObjectTypePtr>(
true);
78 auto it = map.find(
id);
85 throw LocalException(
"key not found!");
94 auto it = map.find(
id);
97 throw LocalException(
"key exists already");
99 map.insert(std::make_pair(
id, obj));
106 static std::atomic<int> InstanceCounter = {0};
107 return InstanceCounter;
117 std::map<Id, ObjectTypePtr>&
120 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)