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

Public Member Functions

 Displayer (Service *s)
 
Action entry () override
 Entry into the StateFlow activity.
 
Action render ()
 
- Public Member Functions inherited from StateFlow< Buffer< Chunk >, 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 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

bool has_one_number ()
 
bool line_prefer_end ()
 
bool fits_next_line ()
 
char * output_limit ()
 

Private Attributes

char * endp_
 Pointer in the buffer to the terminating null.
 
char * thisLineLimit_
 Pointer in the buffer where the current line should end the latest.
 
uint16_t nextOfs_
 Index into the input number array where to continue rendering.
 
char output [320]
 Output buffer where we render the numbers.
 

Static Private Attributes

static constexpr uint8_t MIN_LINE = 60
 Desired length of a line.
 

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

Definition at line 77 of file NumberDumper.hxx.

Constructor & Destructor Documentation

◆ Displayer()

NumberDumper::Displayer::Displayer ( Service s)
inline

Definition at line 80 of file NumberDumper.hxx.

Member Function Documentation

◆ entry()

Action NumberDumper::Displayer::entry ( )
inlineoverridevirtual

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 87 of file NumberDumper.hxx.

◆ fits_next_line()

bool NumberDumper::Displayer::fits_next_line ( )
inlineprivate
Returns
true if we can fit the next line within the buffer.

Definition at line 156 of file NumberDumper.hxx.

◆ has_one_number()

bool NumberDumper::Displayer::has_one_number ( )
inlineprivate
Returns
true if we still have a numbers' worth of buffer.

Definition at line 144 of file NumberDumper.hxx.

◆ line_prefer_end()

bool NumberDumper::Displayer::line_prefer_end ( )
inlineprivate
Returns
true if this line end should be a physical line end

Definition at line 150 of file NumberDumper.hxx.

◆ output_limit()

char * NumberDumper::Displayer::output_limit ( )
inlineprivate
Returns
pointer to the end of the physical buffer.

Definition at line 162 of file NumberDumper.hxx.

◆ render()

Action NumberDumper::Displayer::render ( )
inline

Definition at line 93 of file NumberDumper.hxx.

Member Data Documentation

◆ endp_

char* NumberDumper::Displayer::endp_
private

Pointer in the buffer to the terminating null.

Definition at line 168 of file NumberDumper.hxx.

◆ MIN_LINE

constexpr uint8_t NumberDumper::Displayer::MIN_LINE = 60
staticconstexprprivate

Desired length of a line.

Definition at line 176 of file NumberDumper.hxx.

◆ nextOfs_

uint16_t NumberDumper::Displayer::nextOfs_
private

Index into the input number array where to continue rendering.

Definition at line 172 of file NumberDumper.hxx.

◆ output

char NumberDumper::Displayer::output[320]
private

Output buffer where we render the numbers.

Definition at line 174 of file NumberDumper.hxx.

◆ thisLineLimit_

char* NumberDumper::Displayer::thisLineLimit_
private

Pointer in the buffer where the current line should end the latest.

Definition at line 170 of file NumberDumper.hxx.


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