Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::EventCallerFlow Class Reference

Control flow that calls individual event handlers one at a time and waits until the done callback is invoked before calling the next event handler. More...

#include <EventServiceImpl.hxx>

Inheritance diagram for openlcb::EventCallerFlow:
StateFlow< Buffer< EventHandlerCall >, QList< 5 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Public Member Functions

 EventCallerFlow (Service *service)
 
- Public Member Functions inherited from StateFlow< Buffer< EventHandlerCall >, QList< 5 > >
 StateFlow (Service *service)
 Constructor.
 
- Public Member Functions inherited from TypedStateFlow< MessageType, Base >
 TypedStateFlow (Service *service)
 Constructor.
 
virtual ~TypedStateFlow ()
 Destructor.
 
void send (MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE
 Sends a message to the state flow for processing.
 
- Public Member Functions inherited from FlowInterface< MessageType >
virtual Poolpool ()
 
virtual MessageType * type_helper ()
 This function is never user in the code, but GDB can use it to infer the correct message types.
 
MessageType * alloc ()
 Synchronously allocates a message buffer from the pool of this flow.
 
void alloc_async (Executable *target)
 Asynchronously allocates a message buffer from the pool of this flow.
 

Private Member Functions

virtual Action entry () OVERRIDE
 Entry into the StateFlow activity.
 
Action call_done ()
 

Private Attributes

BarrierNotifiable n_
 

Additional Inherited Members

- Public Types inherited from TypedStateFlow< MessageType, Base >
typedef Base::Action Action
 Allows using Action without having StateFlowBase:: prefix in front of it.
 
- Public Types inherited from FlowInterface< MessageType >
typedef MessageType message_type
 Stores the message template type for external reference.
 
- Static Public Member Functions inherited from FlowInterface< MessageType >
static MessageType * cast_alloc (QMember *entry)
 Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type.
 
- Protected Member Functions inherited from TypedStateFlow< MessageType, Base >
void release () OVERRIDE
 Unrefs the current buffer.
 
void return_buffer ()
 For state flows that are operated using invoke_subflow_and_wait this is a way to hand back the buffer to the caller.
 
MessageType * message ()
 
MessageType * transfer_message ()
 Releases ownership of the current message.
 

Detailed Description

Control flow that calls individual event handlers one at a time and waits until the done callback is invoked before calling the next event handler.

In essence this control flow behaves as a global lock for the event handlers being called. This global lock is necessary, because the event handlers are using global buffers for holding the outgoing packets.

Definition at line 77 of file EventServiceImpl.hxx.

Constructor & Destructor Documentation

◆ EventCallerFlow()

openlcb::EventCallerFlow::EventCallerFlow ( Service service)
inline

Definition at line 80 of file EventServiceImpl.hxx.

Member Function Documentation

◆ call_done()

StateFlowBase::Action openlcb::EventCallerFlow::call_done ( )
private

Definition at line 83 of file EventService.cxx.

◆ entry()

StateFlowBase::Action openlcb::EventCallerFlow::entry ( )
privatevirtual

Entry into the StateFlow activity.

Pure virtual which must be defined by derived class.

Returns
function pointer to next state

Implements TypedStateFlow< MessageType, Base >.

Definition at line 70 of file EventService.cxx.

Member Data Documentation

◆ n_

BarrierNotifiable openlcb::EventCallerFlow::n_
private

Definition at line 87 of file EventServiceImpl.hxx.


The documentation for this class was generated from the following files: