26 :
interface(mk_name(parent, vlan), parent.type(), state)
27 , m_parent(parent.singular())
40 , m_parent(o.m_parent)
48 return (interface::operator==(s) && (m_parent->key() == s.m_parent->key()) &&
49 (m_vlan == s.m_vlan));
53 sub_interface::mk_name(
const interface& parent, vlan_id_t vlan)
55 return (parent.
name() +
"." + std::to_string(vlan));
59 sub_interface::mk_create_cmd(std::queue<cmd*>& q)
68 sub_interface::mk_delete_cmd(std::queue<cmd*>& q)
75 std::shared_ptr<sub_interface>
78 return std::dynamic_pointer_cast<
sub_interface>(singular_i());
81 std::shared_ptr<interface>
82 sub_interface::singular_i()
const 84 return m_db.find_or_add(
key(), *
this);
87 std::shared_ptr<sub_interface>
void release()
release/remove an interface form the singular store
~sub_interface()
Destructor.
HW::item< handle_t > m_hdl
The SW interface handle VPP has asigned to the interface.
virtual void sweep(void)
Sweep/reap the object if still stale.
sub_interface(const interface &parent, admin_state_t state, vlan_id_t vlan)
Construct a new object matching the desried state.
static std::shared_ptr< sub_interface > find(const key_t &k)
Find a subinterface from its key.
static singular_db< key_t, interface > m_db
A map of all interfaces key against the interface's name.
A functor class that creates an interface.
A cmd class that Delete an interface.
The admin state of the interface.
A representation of an interface in VPP.
const std::string & name() const
Return the interface type.
vhost_vring_state_t state
The VPP Object Model (VOM) library.
bool operator==(const sub_interface &s) const
comparison operator - for UT
std::string key_t
The key for interface's key.
std::shared_ptr< sub_interface > singular() const
Return the matching 'singular instance' of the sub-interface.
const key_t & key() const
Return the interface type.