14 #ifndef MODB_STORECLIENT_H 15 #define MODB_STORECLIENT_H 17 #include <boost/noncopyable.hpp> 21 #include "opflex/ofcore/OFTypes.h" 29 namespace mointernal {
58 const OF_SHARED_PTR<const ObjectInstance>& oi);
74 const OF_SHARED_PTR<const ObjectInstance>& oi);
99 OF_SHARED_PTR<const ObjectInstance>
get(
class_id_t class_id,
100 const URI& uri)
const;
113 OF_SHARED_PTR<const ObjectInstance>& oi)
const;
118 typedef OF_UNORDERED_MAP<URI, class_id_t>
notif_t;
156 const URI& parent_uri,
159 const URI& child_uri);
174 const URI& parent_uri,
177 const URI& child_uri);
203 std::pair<URI, prop_id_t>& parent);
217 const URI& parent_uri,
220 std::vector<URI>& output);
260 OF_UNORDERED_SET<URI>& output);
264 friend class opflex::modb::Region;
265 friend class opflex::modb::ObjectStore;
268 bool readOnly =
false);
bool addChild(class_id_t parent_class, const URI &parent_uri, prop_id_t parent_prop, class_id_t child_class, const URI &child_uri)
Add a parent/child relationship between a parent URI (from any region) to a child URI (in this region...
OF_UNORDERED_MAP< URI, class_id_t > notif_t
A map to store queued notifications.
Definition: StoreClient.h:118
A client for accessing the object store scoped to an owner.
Definition: StoreClient.h:37
void queueNotification(class_id_t class_id, const URI &uri, notif_t ¬ifs)
Queue notifications for dispatch to the given URI and its parents.
void getObjectsForClass(class_id_t class_id, OF_UNORDERED_SET< URI > &output)
Get a set of all objects with the given class ID.
void delChild(class_id_t parent_class, const URI &parent_uri, prop_id_t parent_prop, class_id_t child_class, const URI &child_uri)
Remove a parent/child relationship between a parent URI and a child URI.
std::pair< URI, prop_id_t > getParent(class_id_t child_class, const URI &child)
Get the parent for the given child URI.
void put(class_id_t class_id, const URI &uri, const OF_SHARED_PTR< const ObjectInstance > &oi)
Set the specified URI to the provided object instance, replacing any existing value.
void getChildren(class_id_t parent_class, const URI &parent_uri, prop_id_t parent_prop, class_id_t child_class, std::vector< URI > &output)
Get the children of the parent URI and property and put the result into the supplied vector...
void removeChildren(class_id_t class_id, const URI &uri, notif_t *notifs)
Remove all the children of the given object, exluding the object itself.
const std::string & getOwner() const
Get the owner of this store client.
Definition: OFLogHandler.h:20
Interface definition file for ObjectInstance.
A URI is used to identify managed objects in the MODB.
Definition: URI.h:43
Interface definition file for URIs.
bool putIfModified(class_id_t class_id, const URI &uri, const OF_SHARED_PTR< const ObjectInstance > &oi)
Set the specified URI to the provided object instance if it has been modified, atomically.
bool isPresent(class_id_t class_id, const URI &uri) const
Check whether an item exists in the store.
void deliverNotifications(const notif_t ¬ifs)
Deliver the notifications to the object store notification queue.