|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
201 template <
typename OBJ>
220 template <
typename OBJ>
229 std::shared_ptr<OBJ> inst = obj.singular();
246 auto match_ptr = [inst](
const object_ref& oref) {
247 return (inst == oref.obj());
249 auto it = std::find_if(objs.begin(), objs.end(), match_ptr);
251 if (
it != objs.end()) {
279 static void dump(std::ostream& os);
328 struct listener_comparator_t
332 return (l1->order() < l2->order());
339 typedef std::multiset<listener*, listener_comparator_t> listener_list;
344 static std::unique_ptr<listener_list> m_listeners;
static rc_t write()
Write/Execute all commands hitherto enqueued.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
static rc_t write(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
The VPP Object Model (VOM) library.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
const static rc_t OK
The HW write was successfull.
The interface to writing objects into VPP OM.
static void sweep(const client_db::key_t &key)
Sweep all the key's objects that are stale.
static void populate(const client_db::key_t &key)
populate the OM with state read from HW.
Class definition for listeners to OM events.
virtual dependency_t order() const =0
Get the sortable Id of the listener.
A represenation of a reference to a VPP object.
A class providing the RAII pattern for mark and sweep.
static bool register_listener(listener *listener)
Register a listener of events.
mark_n_sweep(const client_db::key_t &key)
Constructor - will call mark on the key.
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 replay(void)
Replay all of the objects to HW.
const typedef std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
virtual void handle_populate(const client_db::key_t &key)=0
Handle a populate event.
object_ref_list & find(const key_t &k)
Find the objects owned by the key.
save_rewrite_length must be aligned so that reass doesn t overwrite it
static void remove(const client_db::key_t &key)
Remove all object in the OM referenced by the key.
A DB storing the objects that each owner/key owns.
~mark_n_sweep()
Destructor - will call sweep on the key.
virtual ~listener()=default
std::set< object_ref > object_ref_list
A convenitent typedef for set of objects owned.
static void mark(const client_db::key_t &key)
Mark all state owned by this key as stale.
bool operator<(const listener &listener) const
less than operator for set sorting
virtual void handle_replay()=0
Handle a replay event.
Error codes that VPP will return during a HW write.