diff options
Diffstat (limited to 'src/libs/engine/ObjectStore.cpp')
-rw-r--r-- | src/libs/engine/ObjectStore.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/libs/engine/ObjectStore.cpp b/src/libs/engine/ObjectStore.cpp index 052200fd..3cecb338 100644 --- a/src/libs/engine/ObjectStore.cpp +++ b/src/libs/engine/ObjectStore.cpp @@ -72,11 +72,33 @@ ObjectStore::find_object(const Path& path) } +ObjectStore::Objects::const_iterator +ObjectStore::children_begin(SharedPtr<Shared::GraphObject> o) const +{ + Objects::const_iterator parent = _objects.find(o->path()); + assert(parent != _objects.end()); + ++parent; + return parent; +} + + +ObjectStore::Objects::const_iterator +ObjectStore::children_end(SharedPtr<Shared::GraphObject> o) const +{ + Objects::const_iterator parent = _objects.find(o->path()); + assert(parent != _objects.end()); + return _objects.find_descendants_end(parent); +} + + /** Add an object to the store. Not realtime safe. */ void -ObjectStore::add(GraphObjectImpl* o) +ObjectStore::add(GraphObject* obj) { + GraphObjectImpl* o = dynamic_cast<GraphObjectImpl*>(obj); + assert(o); + assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); if (_objects.find(o->path()) != _objects.end()) { |