|
Open Model Railroad Network (OpenMRN)
|
Public Types | |
| typedef std::function< void(message_type *)> | HandlerFn |
| Interface of the callback function. | |
Public Types inherited from FlowInterface< MessageType > | |
| typedef MessageType | message_type |
| Stores the message template type for external reference. | |
Public Member Functions | |
| GenericHandler (HandlerFn handler) | |
| Constructor. | |
| template<class T > | |
| GenericHandler (T *ptr, void(T::*fn)(message_type *)) | |
| Constructor to be called with an object member function. | |
| void | send (MessageType *message, unsigned priority) OVERRIDE |
| Overridden method for sending the message. | |
Public Member Functions inherited from FlowInterface< MessageType > | |
| virtual Pool * | pool () |
| 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 Attributes | |
| HandlerFn | handler_ |
| The configured handler callback. | |
Additional Inherited Members | |
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. | |
Definition at line 1186 of file StateFlow.hxx.
| typedef std::function<void(message_type *)> FlowInterface< MessageType >::GenericHandler::HandlerFn |
Interface of the callback function.
Definition at line 1191 of file StateFlow.hxx.
|
inline |
Constructor.
| handler | will be called upon every incoming message with the argument being set to the arrived message. The handler function is typically responsible for unref-ing the incoming message buffer. |
Definition at line 1196 of file StateFlow.hxx.
|
inline |
Constructor to be called with an object member function.
| ptr | is the object whose member function to call. |
| fn | is a member function on ptr, which will be called with each incoming message. |
Definition at line 1205 of file StateFlow.hxx.
|
inlinevirtual |
Overridden method for sending the message.
Implements FlowInterface< MessageType >.
Definition at line 1209 of file StateFlow.hxx.
|
private |
The configured handler callback.
Definition at line 1216 of file StateFlow.hxx.