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