25 singular_db<store::key_t, store> store::m_db;
31 , m_itf(itf.singular())
38 : m_config(s.m_config)
48 m_db.release(
key(),
this);
54 return (std::make_pair(m_itf->key(), m_src));
85 s <<
"qos-store:[" << m_itf->to_string() <<
", src:" << m_src.
to_string()
86 <<
", value:" <<
static_cast<int>(m_value);
92 store::update(
const store& r)
100 std::shared_ptr<store>
101 store::find_or_add(
const store& temp)
103 return (m_db.find_or_add(temp.
key(), temp));
106 std::shared_ptr<store>
109 return (m_db.find(k));
112 std::shared_ptr<store>
115 return find_or_add(*
this);
131 store::event_handler::handle_replay()
139 std::shared_ptr<store_cmds::dump_cmd>
cmd =
140 std::make_shared<store_cmds::dump_cmd>();
145 for (
auto& rr : *cmd) {
146 auto& payload = rr.get_payload();
148 std::shared_ptr<interface> itf =
interface::find(payload.store.sw_if_index);
153 store qr(*itf,
from_api(payload.store.input_source), payload.store.value);
159 << payload.store.sw_if_index;
165 store::event_handler::order()
const
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
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.
const key_t key() const
Return the object's key.
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.
static rc_t write()
Write/Execute all commands hitherto enqueued.
rc_t rc() const
Get the HW return code.
static const log_level_t DEBUG
std::shared_ptr< store > singular() const
Return the matching 'singular instance'.
std::pair< interface::key_t, source_t > key_t
static std::shared_ptr< store > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
A command class that creates or updates the GBP endpoint.
store(const interface &i, const source_t &source, bits_t value)
A cmd class that deletes a GBP endpoint.
void replay(void)
replay the object to create it in hardware
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])
bool operator==(const store &bdae) const
comparison operator
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
std::string to_string() const
Convert to string for debugging.
static bool register_listener(listener *listener)
Register a listener of events.