14#ifndef MODB_STORECLIENT_H
15#define MODB_STORECLIENT_H
17#include <boost/noncopyable.hpp>
21#include "opflex/ofcore/OFTypes.h"
37class StoreClient :
private boost::noncopyable {
58 const OF_SHARED_PTR<const ObjectInstance>& oi);
74 const OF_SHARED_PTR<const ObjectInstance>& oi);
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;
267 StoreClient(ObjectStore* store, Region* region,
268 bool readOnly =
false);
Interface definition file for ObjectInstance.
Interface definition file for URIs.
A URI is used to identify managed objects in the MODB.
Definition URI.h:43
bool getParent(class_id_t child_class, const URI &child, std::pair< URI, prop_id_t > &parent)
Get the parent for the given 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.
bool get(class_id_t class_id, const URI &uri, OF_SHARED_PTR< const ObjectInstance > &oi) const
Get the object instance associated with the given class ID and URI.
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.
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 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 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.
void getObjectsForClass(class_id_t class_id, OF_UNORDERED_SET< URI > &output)
Get a set of all objects with the given class ID.
void queueNotification(class_id_t class_id, const URI &uri, notif_t ¬ifs)
Queue notifications for dispatch to the given URI and its parents.
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 remove(class_id_t class_id, const URI &uri, bool recursive, notif_t *notifs=NULL)
Remove the specified URI, if present.
void deliverNotifications(const notif_t ¬ifs)
Deliver the notifications to the object store notification queue.
bool isPresent(class_id_t class_id, const URI &uri) const
Check whether an item exists in the store.
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...
const std::string & getOwner() const
Get the owner of this store client.
OF_UNORDERED_MAP< URI, class_id_t > notif_t
A map to store queued notifications.
Definition StoreClient.h:118
OF_SHARED_PTR< const ObjectInstance > get(class_id_t class_id, const URI &uri) const
Get the object instance associated with the given class ID and URI.