|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __VOM_RPC_CMD_H__
17 #define __VOM_RPC_CMD_H__
39 template <
typename HWITEM,
typename MSG>
84 std::future_status status;
85 std::future<HWITEM> result;
88 status = result.wait_for(std::chrono::seconds(5));
90 if (status != std::future_status::ready) {
115 int retval = reply.get_response().get_payload().retval;
rc_t wait()
Wait on the commands promise.
The VPP Object Model (VOM) library.
const static rc_t OK
The HW write was successfull.
static const rc_t & from_vpp_retval(int32_t rv)
Get the rc_t from the VPP API value.
A base class for all RPC commands to VPP.
const HWITEM & item() const
return the const HW item the command updates
HWITEM & m_hw_item
A reference to an object's HW::item that the command will update.
std::promise< HWITEM > m_promise
The promise that implements the synchronous issue.
rpc_cmd(HWITEM &item)
Constructor taking the HW item that will be updated by the command.
virtual std::string to_string() const =0
convert to string format for debug purposes
A representation of the connection to VPP.
virtual vapi_error_e operator()(MSG &reply)
call operator used as a callback by VAPI when the reply is available
const static rc_t TIMEOUT
HW write timedout - VPP did not respond within a timely manner.
const static log_level_t DEBUG
virtual void retire(connection &con)
Retire/cancel a long running command.
MSG msg_t
convenient typedef
HWITEM & item()
return the HW item the command updates
virtual void succeeded()
Called by the HW Command Q when it is disabled to indicate the command can be considered successful w...
virtual ~rpc_cmd()
Desructor.
Error codes that VPP will return during a HW write.
void fulfill(const HWITEM &d)
Fulfill the commands promise.
A representation of a method call to VPP.