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

StateFlow that accepts dcc::Packet structures and sends them to a local device driver for producing the track signal. More...

#include <LocalTrackIf.hxx>

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

Public Member Functions

 LocalTrackIfSelect (Service *service, int pool_size)
 Constructs a TrackInterface from an fd to the mainline.
 
- Public Member Functions inherited from dcc::LocalTrackIf
 LocalTrackIf (Service *service, int pool_size)
 Constructs a TrackInterface from an fd to the mainline.
 
FixedPoolpool () OVERRIDE
 
void set_fd (int fd)
 You must call this function before sending any packets.
 
- 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.
 
- Protected Member Functions inherited from dcc::LocalTrackIf
Action finish ()
 
- 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

StateFlowSelectHelper helper_ {this}
 Helper class for select() ing the target device.
 
- Protected Attributes inherited from dcc::LocalTrackIf
int fd_
 Filedes of the device to which we are writing the generated packets.
 
FixedPool pool_
 Packet pool from which to allocate packets.
 

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 sends them to a local device driver for producing the track signal.

The device driver must support the select() model.

Definition at line 96 of file LocalTrackIf.hxx.

Constructor & Destructor Documentation

◆ LocalTrackIfSelect()

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

Constructs a TrackInterface from an fd to the mainline.

Parameters
serviceUsually the main executor.
pool_sizewill determine how many packets the current flow's alloc() will have.

Definition at line 105 of file LocalTrackIf.hxx.

Member Function Documentation

◆ entry()

StateFlowBase::Action dcc::LocalTrackIfSelect::entry ( )
protectedvirtual

Entry into the StateFlow activity.

Pure virtual which must be defined by derived class.

Returns
function pointer to next state

Reimplemented from dcc::LocalTrackIf.

Definition at line 81 of file LocalTrackIf.cxx.

Member Data Documentation

◆ helper_

StateFlowSelectHelper dcc::LocalTrackIfSelect::helper_ {this}
protected

Helper class for select() ing the target device.

Definition at line 114 of file LocalTrackIf.hxx.


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