37#ifndef _OPENLCB_NONAUTHORITATIVEEVENTPRODUCER_HXX_
38#define _OPENLCB_NONAUTHORITATIVEEVENTPRODUCER_HXX_
63 std::function<
void(
unsigned,
bool)> state_callback =
nullptr)
89 uint64_t event_base_off, uint32_t size,
90 std::function<
void(
unsigned,
bool)> state_callback =
nullptr)
A BarrierNotifiable allows to create a number of child Notifiable and wait for all of them to finish.
static EventRegistry * instance()
Event producer for range of bits (event pairs) that is non-autoritative.
BitRangeNonAuthoritativeEventP(Node *node, uint64_t event_base, uint32_t size, std::function< void(unsigned, bool)> state_callback=nullptr)
Constructor.
void set(unsigned bit, bool new_value, WriteHelper *writer, BarrierNotifiable *done)
Requests the event associated with the current value of the bit to be produced (unconditionally).
unsigned size_
number of bits stored
void handle_identify_global(const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override
Handle an incoming identify global or addressed message.
uint64_t eventBaseOn_
base event ID for "on" range
void handle_event_report(const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override
Handle an incoming event.
void handle_consumer_identified(const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override
Handle an incoming consumer identified message.
uint64_t eventBaseOff_
base event ID for "off" range
void handle_identify_producer(const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override
Handle an incoming identify producer message.
BitRangeNonAuthoritativeEventP(Node *node, uint64_t event_base_on, uint64_t event_base_off, uint32_t size, std::function< void(unsigned, bool)> state_callback=nullptr)
Constructor.
~BitRangeNonAuthoritativeEventP()
Destructor.
std::function< void(unsigned, bool)> stateCallback_
Callback method that will be invoked when a consumer identified message is received with a known stat...
uint64_t eventBase_
base event ID of the full range
Node * node_
Node ID that this producer is attached to.
void send_query_consumer(unsigned bit, WriteHelper *writer, BarrierNotifiable *done)
Queries consumer and acquires the current state of the bit.
EventBaseType
Identifiers for the types of event range registration.
@ EVENT_BASE_ON
one unified range starting at eventBase_
@ EVENT_BASE_OFF
on range starting at eventBaseOn_
Structure used in registering event handlers.
static unsigned align_mask(EventId *event, unsigned size)
Computes the alignment mask for registering an event range.
Base class for NMRAnet nodes conforming to the asynchronous interface.
SimpleEventHandler ignores all non-essential callbacks.
A statically allocated buffer for sending one message to the OpenLCB bus.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Shared notification structure that is assembled for each incoming event-related message,...