"Abstract" interface for a binary network state.
More...
#include <NetworkState.hxx>
"Abstract" interface for a binary network state.
Definition at line 35 of file utils/NetworkState.hxx.
◆ State
| Enumerator |
|---|
| VALID | state is "valid"
|
| INVALID | state is "invalid"
|
| UNKNOWN | state is "unknown"
|
Definition at line 38 of file utils/NetworkState.hxx.
◆ ~NetworkState()
| virtual NetworkState::~NetworkState |
( |
| ) |
|
|
inlinevirtual |
◆ get_state()
| virtual State NetworkState::get_state |
( |
| ) |
|
|
pure virtual |
◆ initiate_query()
Queries and acquires the current state of the bit.
- Parameters
-
| done | is the notification callback. If it is NULL, the writer will be invoked inline and potentially block the calling thread. |
Implemented in openlcb::NetworkState.
◆ is_state_known()
| virtual bool NetworkState::is_state_known |
( |
| ) |
|
|
pure virtual |
Get an indication as to if the state is known.
- Returns
- true if known, else false
Implemented in openlcb::NetworkState.
◆ reset()
| virtual void NetworkState::reset |
( |
| ) |
|
|
pure virtual |
◆ set_callback()
| virtual void NetworkState::set_callback |
( |
std::function< void()> |
cb | ) |
|
|
pure virtual |
Set the change notification callback.
- Parameters
-
| cb | will be involked every time the state is changed (both from local calls as well as from the network stack) |
Implemented in openlcb::NetworkState.
◆ set_state()
| virtual void NetworkState::set_state |
( |
bool |
state, |
|
|
Notifiable * |
done |
|
) |
| |
|
pure virtual |
Set the state.
- Parameters
-
| state | new state value |
| done | is the notification callback. If it is NULL, the writer will be invoked inline and potentially block the calling thread. |
Implemented in openlcb::NetworkState.
◆ toggle()
| virtual void NetworkState::toggle |
( |
Notifiable * |
done | ) |
|
|
pure virtual |
Toggle the state.
- Parameters
-
| done | is the notification callback. If it is NULL, the writer will be invoked inline and potentially block the calling thread. |
Implemented in openlcb::NetworkState.
The documentation for this class was generated from the following file: