Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
CallableFlow< RequestType > Class Template Reference
Inheritance diagram for CallableFlow< RequestType >:
StateFlow< Buffer< RequestType >, QList< 1 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Public Member Functions

 CallableFlow (Service *s)
 Creates a callable flow.
 
- Public Member Functions inherited from StateFlow< Buffer< RequestType >, QList< 1 > >
 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.
 
virtual Action entry () override=0
 Entry into the StateFlow activity.
 
- 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.
 

Protected Types

using Action = StateFlowBase::Action
 

Protected Member Functions

RequestType * request ()
 
bool has_request ()
 
Action return_ok ()
 Terminates the flow and returns the request buffer to the caller with an error code of OK (zero).
 
Action wait_and_return_ok ()
 Waits to be notified before moving onto the next state for termination.
 
Action wait_done ()
 Terminates the flow and returns the request buffer to the caller with an error code of OK (zero).
 
Action return_with_error (int error)
 Terminates the flow and returns the request buffer to the caller with an specific error code.
 
- 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.
 

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.
 

Detailed Description

template<class RequestType>
class CallableFlow< RequestType >

Definition at line 57 of file CallableFlow.hxx.

Member Typedef Documentation

◆ Action

template<class RequestType >
using CallableFlow< RequestType >::Action = StateFlowBase::Action
protected

Definition at line 64 of file CallableFlow.hxx.

Constructor & Destructor Documentation

◆ CallableFlow()

template<class RequestType >
CallableFlow< RequestType >::CallableFlow ( Service s)
inline

Creates a callable flow.

Parameters
sdefines the service we are operating upon.

Definition at line 61 of file CallableFlow.hxx.

Member Function Documentation

◆ has_request()

template<class RequestType >
bool CallableFlow< RequestType >::has_request ( )
inlineprotected
Returns
true if there is an active request, i.e., when request() is allowed to be called.

Definition at line 84 of file CallableFlow.hxx.

◆ request()

template<class RequestType >
RequestType * CallableFlow< RequestType >::request ( )
inlineprotected
Returns
the current request we are working on. This function may be called only if there is an active request. If unsure, use {} to verify it first.

Definition at line 69 of file CallableFlow.hxx.

◆ return_ok()

template<class RequestType >
Action CallableFlow< RequestType >::return_ok ( )
inlineprotected

Terminates the flow and returns the request buffer to the caller with an error code of OK (zero).

Definition at line 91 of file CallableFlow.hxx.

◆ return_with_error()

template<class RequestType >
Action CallableFlow< RequestType >::return_with_error ( int  error)
inlineprotected

Terminates the flow and returns the request buffer to the caller with an specific error code.

Definition at line 111 of file CallableFlow.hxx.

◆ wait_and_return_ok()

template<class RequestType >
Action CallableFlow< RequestType >::wait_and_return_ok ( )
inlineprotected

Waits to be notified before moving onto the next state for termination.

Definition at line 97 of file CallableFlow.hxx.

◆ wait_done()

template<class RequestType >
Action CallableFlow< RequestType >::wait_done ( )
inlineprotected

Terminates the flow and returns the request buffer to the caller with an error code of OK (zero).

Definition at line 104 of file CallableFlow.hxx.


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