91 return (item_data == i.item_data);
99 item_data = other.item_data;
100 item_rc = other.item_rc;
108 T&
data() {
return (item_data); }
113 const T&
data()
const {
return (item_data); }
137 bool need_hw_update =
false;
150 need_hw_update = (item_data != desired.
data() ||
rc_t::OK !=
rc());
152 item_data = desired.
data();
154 return (need_hw_update);
162 std::ostringstream os;
165 <<
"rc:" << item_rc.
to_string() <<
" data:" << item_data.to_string()
210 virtual void enqueue(std::shared_ptr<cmd> c);
215 virtual void enqueue(std::queue<cmd*>& c);
243 std::deque<std::shared_ptr<cmd>> m_queue;
250 std::map<cmd*, std::shared_ptr<cmd>> m_pending;
260 std::unique_ptr<std::thread> m_rx_thread;
297 static void enqueue(std::shared_ptr<cmd>
c);
302 static void enqueue(std::queue<cmd*>& c);
323 static cmd_q* m_cmdQ;
334 static void disable();
340 static void enable();
sll srl srl sll sra u16x4 i
static void connect()
Blocking Connect to VPP.
bool update(const item &desired)
update the item to the desired state.
A HW::item is data that is either to be written to or read from VPP/HW.
static rc_t write()
Write/Execute all commands hitherto enqueued.
Error codes that VPP will return during a HW write.
bool operator==(const item< T > &i) const
Comparison operator.
std::string to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
~item()=default
Destructor.
rc_t rc() const
Get the HW return code.
A representation of the connection to VPP.
The pipe to VPP into which we write the commands.
item(const T &data)
Constructor.
static void init()
Initialise the HW.
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
The interface to writing objects into VPP OM.
item(rc_t rc)
Constructor.
item & operator=(const item &other)
Copy assignment.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
static const rc_t UNSET
The value un-set.
const T & data() const
Const reference to the data.
const std::string & to_string() const
convert to string format for debug purposes
item(const T &data, rc_t rc)
Constructor.
static bool poll()
Blocking pool of the HW connection.