14 #ifndef MODB_STORECLIENT_H
15 #define MODB_STORECLIENT_H
17 #include <boost/unordered_map.hpp>
18 #include <boost/noncopyable.hpp>
19 #include <boost/shared_ptr.hpp>
20 #include <boost/unordered_set.hpp>
31 namespace mointernal {
60 const boost::shared_ptr<const ObjectInstance>& oi);
76 const boost::shared_ptr<const ObjectInstance>& oi);
101 boost::shared_ptr<const ObjectInstance>
get(
class_id_t class_id,
102 const URI& uri)
const;
115 boost::shared_ptr<const ObjectInstance>& oi)
const;
120 typedef boost::unordered_map<URI, class_id_t>
notif_t;
158 const URI& parent_uri,
161 const URI& child_uri);
176 const URI& parent_uri,
179 const URI& child_uri);
205 std::pair<URI, prop_id_t>& parent);
219 const URI& parent_uri,
222 std::vector<URI>& output);
262 boost::unordered_set<URI>& output);
266 friend class opflex::modb::Region;
267 friend class opflex::modb::ObjectStore;
270 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...
A client for accessing the object store scoped to an owner.
Definition: StoreClient.h:39
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 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, boost::unordered_set< URI > &output)
Get a set of all objects with the given class ID.
const std::string & getOwner() const
Get the owner of this store client.
std::pair< URI, prop_id_t > getParent(class_id_t child_class, const URI &child)
Get the parent for the given child URI.
bool isPresent(class_id_t class_id, const URI &uri) const
Check whether an item exists in the store.
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.
Interface definition file for ObjectInstance.
A URI is used to identify managed objects in the MODB.
Definition: URI.h:41
bool putIfModified(class_id_t class_id, const URI &uri, const boost::shared_ptr< const ObjectInstance > &oi)
Set the specified URI to the provided object instance if it has been modified, atomically.
Interface definition file for URIs.
void put(class_id_t class_id, const URI &uri, const boost::shared_ptr< const ObjectInstance > &oi)
Set the specified URI to the provided object instance, replacing any existing value.
boost::unordered_map< URI, class_id_t > notif_t
A map to store queued notifications.
Definition: StoreClient.h:120
void deliverNotifications(const notif_t ¬ifs)
Deliver the notifications to the object store notification queue.