Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
EventHandlerTemplates.hxx File Reference

Go to the source code of this file.

Classes

class  openlcb::ProxyEventHandler
 A proxy event handler has a single helper function that gets every event handler call with an indication of which call it is. More...
 
class  openlcb::SimpleEventHandler
 SimpleEventHandler ignores all non-essential callbacks. More...
 
class  openlcb::FixedEventProducer< EVENT_ID >
 Class that advertises an event ID to be produced. More...
 
class  openlcb::BitEventInterface
 Represents a bit of state using two events. More...
 
class  openlcb::DistributedBit
 Implementation of the BitEventInterface that has accessors to the desired and actual state, but does not perform callback on change. More...
 
class  openlcb::NetworkInitializedBit
 A network-initialized bit is a tri-state bit implementation that starts up in the UNKNOWN state until either a local state set or a remote state set occurs. More...
 
class  openlcb::CallbackNetworkInitializedBit
 Speciallization of NetworkInitializedBit that adds callback support when the state changes. More...
 
class  openlcb::MemoryBit< T >
 Simple implementation of a BitEventInterface when the true state ofthe variable is mapped in memory (e.g. More...
 
class  openlcb::GPIOBit
 Simple implementation of the BitEventInterface for going through GPIO ports. More...
 
class  openlcb::BitEventHandler
 Base class for single-bit producer and consumer objects. More...
 
class  openlcb::BitEventProducer
 Event handler for a single-bit producer, e.g. More...
 
class  openlcb::BitEventConsumer
 Event handler for a single-bit consumer, e.g. More...
 
class  openlcb::BitEventPC
 Producer-Consumer event handler for a single bit represented by two event IDs. More...
 
class  openlcb::BitRangeEventPC
 Producer-Consumer event handler for a sequence of bits represented by a dense block of consecutive event IDs. More...
 
class  openlcb::BitRangeEventP
 Producer event handler for a sequence of bits represented by a dense block of consecutive event IDs. More...
 
class  openlcb::ByteRangeEventC
 Consumer event handler for a sequence of bytes represented by a dense block of consecutive event IDs. More...
 
class  openlcb::ByteRangeEventP
 TODO(balazs.racz): Add another class here, ByteRangeEventPC. More...
 

Namespaces

namespace  openlcb
 

Macros

#define DEFPROXYFN(FN)
 Defines an event handler function as a proxy implementation to the single HandlerFn.
 
#define IGNOREFN(FN)
 Defines an event handler function as ignored.
 

Functions

uint64_t openlcb::EncodeRange (uint64_t begin, unsigned size)
 Creates a single encoded event range from the beginning of the range and the number fo events to cover.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Defines partial implementations for event handlers that are usable for multiple event handler types.

Author
Balazs Racz
Date
19 October 2013

Definition in file EventHandlerTemplates.hxx.

Macro Definition Documentation

◆ DEFPROXYFN

#define DEFPROXYFN (   FN)
Value:
virtual void FN(const EventRegistryEntry &registry_entry, \
EventReport *event, BarrierNotifiable *done) override \
{ \
HandlerFn(&EventHandler::FN, registry_entry, event, done); \
}
A BarrierNotifiable allows to create a number of child Notifiable and wait for all of them to finish.

Defines an event handler function as a proxy implementation to the single HandlerFn.

Parameters
FNC++ name of the function to proxy.

Definition at line 72 of file EventHandlerTemplates.hxx.

◆ IGNOREFN

#define IGNOREFN (   FN)
Value:
virtual void FN(const EventRegistryEntry &registry_entry, \
EventReport *event, BarrierNotifiable *done) override \
{ \
done->notify(); \
}

Defines an event handler function as ignored.

Parameters
FNname of the function to define.

Definition at line 100 of file EventHandlerTemplates.hxx.