|
Open Model Railroad Network (OpenMRN)
|
Represents a bit of state using two events. More...
#include <EventHandlerTemplates.hxx>
Public Member Functions | |
| BitEventInterface (uint64_t event_on, uint64_t event_off) | |
| virtual EventState | get_current_state ()=0 |
| returns the current hardware state: true for ON, false for OFF. | |
| virtual EventState | get_requested_state () |
| Get the requested state. | |
| virtual void | set_state (bool new_value)=0 |
| Updates the hardware for the new event state. | |
| uint64_t | event_on () |
| returns the event ID for representing the state transition OFF->ON. | |
| uint64_t | event_off () |
| returns the event ID for representing the state transition ON->OFF. | |
| virtual Node * | node ()=0 |
| returns the OpenLCB virtual node from which to send the respective events when the bit changes. | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (BitEventInterface) | |
Private Attributes | |
| uint64_t | event_on_ |
| uint64_t | event_off_ |
Represents a bit of state using two events.
This class is used as an implementation plugin to various event producers and consumers. It encapsulates application-specific information about the event bit:
See BitEventProducer, BitEventConsumer, BitEventPC.
Definition at line 181 of file EventHandlerTemplates.hxx.
|
inline |
Definition at line 184 of file EventHandlerTemplates.hxx.
|
inline |
returns the event ID for representing the state transition ON->OFF.
Definition at line 213 of file EventHandlerTemplates.hxx.
|
inline |
returns the event ID for representing the state transition OFF->ON.
Definition at line 207 of file EventHandlerTemplates.hxx.
|
pure virtual |
returns the current hardware state: true for ON, false for OFF.
Implemented in openlcb::DistributedBit, openlcb::NetworkInitializedBit, openlcb::MemoryBit< T >, openlcb::MemoryBit< uint8_t >, and openlcb::GPIOBit.
|
inlinevirtual |
Get the requested state.
@TODO(stbaker): document the difference between requested state and current state.
Reimplemented in openlcb::DistributedBit.
Definition at line 196 of file EventHandlerTemplates.hxx.
|
pure virtual |
returns the OpenLCB virtual node from which to send the respective events when the bit changes.
Implemented in openlcb::DistributedBit, openlcb::NetworkInitializedBit, openlcb::MemoryBit< T >, openlcb::MemoryBit< uint8_t >, and openlcb::GPIOBit.
|
pure virtual |
Updates the hardware for the new event state.
| new_value | is true for state ON, false for state OFF. |
Implemented in openlcb::DistributedBit, openlcb::NetworkInitializedBit, openlcb::CallbackNetworkInitializedBit, openlcb::MemoryBit< T >, openlcb::MemoryBit< uint8_t >, and openlcb::GPIOBit.
|
private |
Definition at line 224 of file EventHandlerTemplates.hxx.
|
private |
Definition at line 223 of file EventHandlerTemplates.hxx.