25 singular_db<record::key_t, record> record::m_db;
31 , m_itf(itf.singular())
37 : m_config(r.m_config)
46 m_db.release(
key(),
this);
52 return (std::make_pair(m_itf->key(), m_src));
82 s <<
"qos-record:[" << m_itf->to_string() <<
", src:" << m_src.
to_string();
88 record::update(
const record& r)
95 std::shared_ptr<record>
96 record::find_or_add(
const record& temp)
98 return (m_db.find_or_add(temp.
key(), temp));
101 std::shared_ptr<record>
104 return (m_db.find(k));
107 std::shared_ptr<record>
110 return find_or_add(*
this);
126 record::event_handler::handle_replay()
134 std::shared_ptr<record_cmds::dump_cmd>
cmd =
135 std::make_shared<record_cmds::dump_cmd>();
140 for (
auto& rr : *cmd) {
141 auto& payload = rr.get_payload();
143 std::shared_ptr<interface> itf =
155 << payload.record.sw_if_index;
161 record::event_handler::order()
const 177 os << key.first <<
"," << key.second;
std::pair< interface::key_t, source_t > key_t
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
A cmd class that deletes a GBP endpoint.
static rc_t write()
Write/Execute all commands hitherto enqueued.
rc_t rc() const
Get the HW return code.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
static const log_level_t DEBUG
void replay(void)
replay the object to create it in hardware
A command class that creates or updates the GBP endpoint.
record(const interface &i, const source_t &source)
std::string to_string() const
Convert to string for debugging.
A representation of an interface in VPP.
The Source of the QoS classification (i.e.
const std::string & to_string() const
convert to string format for debug purposes
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
void event_handler(void *tls_async)
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
static const log_level_t ERROR
static const map::outputs_t from_api(vapi_type_qos_egress_map_row rows[4])
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
std::shared_ptr< record > singular() const
Return the matching 'singular instance'.
The VPP Object Model (VOM) library.
const key_t key() const
Return the object's key.
A representation of a method call to VPP.
static std::shared_ptr< record > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
static bool register_listener(listener *listener)
Register a listener of events.
bool operator==(const record &bdae) const
comparison operator