Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
dcc::FakeTrackIf Class Reference

StateFlow that accepts dcc::Packet structures and drops them to the floor. More...

#include <FakeTrackIf.hxx>

Inheritance diagram for dcc::FakeTrackIf:
StateFlow< Buffer< dcc::Packet >, QList< 1 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Public Member Functions

 FakeTrackIf (Service *service, int pool_size)
 Constructor.
 
FixedPoolpool () OVERRIDE
 
- Public Member Functions inherited from StateFlow< Buffer< dcc::Packet >, 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.
 
- Public Member Functions inherited from FlowInterface< MessageType >
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 Member Functions

Action entry () OVERRIDE
 Entry into the StateFlow activity.
 
Action finish ()
 Do nothing.
 
- 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.
 

Protected Attributes

FixedPool pool_
 Pool of unallocated packets.
 
StateFlowTimer timer_ {this}
 Helper object for timing.
 

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

StateFlow that accepts dcc::Packet structures and drops them to the floor.

Definition at line 47 of file FakeTrackIf.hxx.

Constructor & Destructor Documentation

◆ FakeTrackIf()

dcc::FakeTrackIf::FakeTrackIf ( Service service,
int  pool_size 
)
inline

Constructor.

Parameters
servicedefines which executor *this should be running on.
pool_sizehow many packets we should generate ahead of time.

Definition at line 54 of file FakeTrackIf.hxx.

Member Function Documentation

◆ entry()

Action dcc::FakeTrackIf::entry ( )
inlineprotectedvirtual

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 66 of file FakeTrackIf.hxx.

◆ finish()

Action dcc::FakeTrackIf::finish ( )
inlineprotected

Do nothing.

Returns
next action.

Definition at line 72 of file FakeTrackIf.hxx.

◆ pool()

FixedPool * dcc::FakeTrackIf::pool ( )
inlinevirtual
Returns
the buffer pool to use for sending messages to this flow. This is to be used as a hint, the caller is allowed to send buffers from different source.
Todo:
(stbaker) change this to Pool* once it supports async alloc.

Reimplemented from FlowInterface< MessageType >.

Definition at line 60 of file FakeTrackIf.hxx.

Member Data Documentation

◆ pool_

FixedPool dcc::FakeTrackIf::pool_
protected

Pool of unallocated packets.

Definition at line 78 of file FakeTrackIf.hxx.

◆ timer_

StateFlowTimer dcc::FakeTrackIf::timer_ {this}
protected

Helper object for timing.

Definition at line 80 of file FakeTrackIf.hxx.


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