FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
An Event command base class. More...
Public Types | |
typedef vapi::Event_registration< EVENT >::resp_type | event_t |
Typedef for the event type. More... | |
typedef vapi::Event_registration< EVENT > | reg_t |
typedef vapi::Result_set< typename reg_t::resp_type >::const_iterator | const_iterator |
Public Types inherited from VOM::rpc_cmd< HW::item< bool >, WANT > | |
typedef WANT | msg_t |
convenient typedef More... | |
Public Member Functions | |
event_cmd (HW::item< bool > &b) | |
Default constructor. More... | |
virtual | ~event_cmd () |
Default destructor. More... | |
const_iterator | begin () |
const_iterator | end () |
void | lock () |
void | unlock () |
void | flush () |
flush/free all the events thus far reeived. More... | |
virtual void | retire (connection &con)=0 |
Retire the command. More... | |
vapi_error_e | operator() (reg_t &dl) |
Public Member Functions inherited from VOM::rpc_cmd< HW::item< bool >, WANT > | |
rpc_cmd (HW::item< bool > &item) | |
Constructor taking the HW item that will be updated by the command. More... | |
virtual | ~rpc_cmd () |
Desructor. More... | |
HW::item< bool > & | item () |
return the HW item the command updates More... | |
const HW::item< bool > & | item () const |
return the const HW item the command updates More... | |
void | fulfill (const HW::item< bool > &d) |
Fulfill the commands promise. More... | |
rc_t | wait () |
Wait on the commands promise. More... | |
virtual void | succeeded () |
Called by the HW Command Q when it is disabled to indicate the command can be considered successful without issuing it to HW. More... | |
virtual vapi_error_e | operator() (WANT &reply) |
call operator used as a callback by VAPI when the reply is available More... | |
Public Member Functions inherited from VOM::cmd | |
cmd () | |
Default constructor. More... | |
virtual | ~cmd () |
Virtual destructor. More... | |
virtual rc_t | issue (connection &con)=0 |
Issue the command to VPP/HW. More... | |
virtual std::string | to_string () const =0 |
convert to string format for debug purposes More... | |
Protected Member Functions | |
virtual void | notify ()=0 |
Notify the command that data from VPP has arrived and been stored. More... | |
Protected Attributes | |
std::unique_ptr< vapi::Event_registration< EVENT > > | m_reg |
The VAPI event registration. More... | |
std::mutex | m_mutex |
Mutex protection for the events. More... | |
Protected Attributes inherited from VOM::rpc_cmd< HW::item< bool >, WANT > | |
HW::item< bool > & | m_hw_item |
A reference to an object's HW::item that the command will update. More... | |
std::promise< HW::item< bool > > | m_promise |
The promise that implements the synchronous issue. More... | |
An Event command base class.
Events are one of the sub-set of command type to VPP. A client performs a one time 'registration/subsription' to VPP for the event in question and then is notified asynchronously when those events occur. The model here then is that the lifetime of the event command represensts the during of the clients subscription. When the command is 'issued' the subscription begins, when it is 'retired' the subscription ends. For the subscription duration the client will be notified as events are recieved. The client can then 'pop' these events from this command object.
Definition at line 39 of file event_cmd.hpp.
typedef vapi::Result_set<typename reg_t::resp_type>::const_iterator VOM::event_cmd< WANT, EVENT >::const_iterator |
Definition at line 62 of file event_cmd.hpp.
typedef vapi::Event_registration<EVENT>::resp_type VOM::event_cmd< WANT, EVENT >::event_t |
Typedef for the event type.
Definition at line 58 of file event_cmd.hpp.
typedef vapi::Event_registration<EVENT> VOM::event_cmd< WANT, EVENT >::reg_t |
Definition at line 59 of file event_cmd.hpp.
|
inline |
Default constructor.
Definition at line 45 of file event_cmd.hpp.
|
inlinevirtual |
Default destructor.
Definition at line 53 of file event_cmd.hpp.
|
inline |
Definition at line 64 of file event_cmd.hpp.
|
inline |
Definition at line 66 of file event_cmd.hpp.
|
inline |
flush/free all the events thus far reeived.
Call with the lock held!
Definition at line 75 of file event_cmd.hpp.
|
inline |
Definition at line 68 of file event_cmd.hpp.
|
protectedpure virtual |
Notify the command that data from VPP has arrived and been stored.
The command should now inform its clients/listeners.
Implemented in VOM::interface_cmds::events_cmd, and VOM::dhcp_client_cmds::events_cmd.
|
inline |
Definition at line 83 of file event_cmd.hpp.
|
pure virtual |
Retire the command.
This is only appropriate for Event Commands As they persist until retired.
Reimplemented from VOM::rpc_cmd< HW::item< bool >, WANT >.
Implemented in VOM::interface_cmds::events_cmd, and VOM::dhcp_client_cmds::events_cmd.
|
inline |
Definition at line 69 of file event_cmd.hpp.
|
protected |
Mutex protection for the events.
Definition at line 105 of file event_cmd.hpp.
|
protected |
The VAPI event registration.
Definition at line 100 of file event_cmd.hpp.