23 std::unique_ptr<OM::listener_list> OM::m_listeners;
43 auto mark_obj = [](
const object_ref& oref) { oref.mark(); };
45 std::for_each(objs.begin(), objs.end(), mark_obj);
57 for (
auto it = objs.begin(); it != objs.end();) {
114 l->handle_populate(key);
127 m_listeners.reset(
new listener_list);
130 m_listeners->insert(listener);
void dump(const key_t &key, std::ostream &os)
Print each of the object in the DB into the stream provided.
std::set< object_ref > object_ref_list
A convenitent typedef for set of objects owned.
object_ref_list & find(const key_t &k)
Find the objects owned by the key.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
void flush(const key_t &k)
flush, i.e.
static rc_t write()
Write/Execute all commands hitherto enqueued.
A DB storing the objects that each owner/key owns.
A represenation of a reference to a VPP object.
static void remove(const client_db::key_t &key)
Remove all object in the OM referenced by the key.
static void mark(const client_db::key_t &key)
Mark all state owned by this key as stale.
Class definition for listeners to OM events.
static void sweep(const client_db::key_t &key)
Sweep all the key's objects that are stale.
mark_n_sweep(const client_db::key_t &key)
Constructor - will call mark on the key.
~mark_n_sweep()
Destructor - will call sweep on the key.
The VPP Object Model (VOM) library.
static void replay(void)
Replay all of the objects to HW.
static void dump(const client_db::key_t &key, std::ostream &os)
Print each of the object in the DB into the stream provided.
static void populate(const client_db::key_t &key)
populate the OM with state read from HW.
static bool register_listener(listener *listener)
Register a listener of events.