srecord 1.65.0
 
Loading...
Searching...
No Matches
srecord::output_filter_reblock Class Reference

The output_filter_reblock class is used to represent a filter that repacks output records so that they exactly align with the output format's preferred block size. More...

#include <reblock.h>

Inheritance diagram for srecord::output_filter_reblock:
Collaboration diagram for srecord::output_filter_reblock:

Public Types

typedef std::shared_ptr< output_filter_reblockpointer
 
- Public Types inherited from srecord::output
typedef std::shared_ptr< outputpointer
 

Public Member Functions

virtual ~output_filter_reblock ()
 The destructor.
 
- Public Member Functions inherited from srecord::output_filter
virtual ~output_filter ()
 The destructor.
 
- Public Member Functions inherited from srecord::output
virtual ~output ()
 The destructor.
 
virtual void write_header (const record *=0)
 The write_header method is used to write a header record to the output.
 
virtual void write_data (unsigned long, const void *, size_t)
 The write_data method is used to write data to the output.
 
virtual void write_execution_start_address (const record *=0)
 The write_execution_start_address method is used to write an execution start address record to the output.
 
virtual void fatal_error (const char *fmt,...) const FORMAT_PRINTF(2
 The fatal_error method is used to report fatal errors.
 
virtual void virtual void fatal_error_v (const char *fmt, va_list ap) const
 The fatal_error_v method is used to report fatal errors.
 
virtual void fatal_error_errno (const char *fmt,...) const FORMAT_PRINTF(2
 The fatal_error_errno method is used to report fatal errors, and append the string equivalent of errno.
 
virtual void virtual void fatal_error_errno_v (const char *fmt, va_list ap) const
 The fatal_error_errno_v method is used to report fatal errors.
 
virtual void warning (const char *fmt,...) const FORMAT_PRINTF(2
 The warning method is used to likely but non-fatal errors.
 
virtual void virtual void warning_v (const char *fmt, va_list ap) const
 The warning_v method is used to report likely but non-fatal errors.
 

Static Public Member Functions

static pointer create (const output::pointer &deeper, bool align=false)
 The create class method is used to create new dynamically allocated instanced of this class.
 

Protected Member Functions

void write (const record &r)
 The write method is used to write a recordonto an output.
 
void line_length_set (int)
 The set_line_length method is used to set the maximum length of an output line, for those formats for which this is a meaningful concept, and the line length is at all controllable.
 
void address_length_set (int)
 The address_length_set method is used to set the minimum number of bytes to be written for addresses in the output, for those formats for which this is a meaningful concept, and the address length is at all controllable.
 
int preferred_block_size_get (void) const
 The preferred_block_size_get method is used to get the proferred block size of the output fformat.
 
bool preferred_block_size_set (int nbytes)
 The preferred_block_size_set method is is to set a precific number of bytes for the preferred block size.
 
- Protected Member Functions inherited from srecord::output_filter
 output_filter (const output::pointer &deeper)
 The constructor.
 
const std::string filename () const
 The filename method is used to determine the name of the output file.
 
const char * format_name () const
 The format_name method is used to obtain the name of this output format.
 
void notify_upper_bound (unsigned long addr)
 The notify_upper_bound method is used to notify the output class of the upper bound (highest address plus one) of the output to come.
 
void command_line (arglex_tool *cmdln)
 The command_line method is used by arglex_srec::get_output when parsing the command line, to give the format an opportunity to grab extra arguments off the command line.
 
- Protected Member Functions inherited from srecord::output
 output ()
 The default constructor.
 

Detailed Description

The output_filter_reblock class is used to represent a filter that repacks output records so that they exactly align with the output format's preferred block size.

This can also be used to remove artifacts of whatever the SRecord internal memory chunk size happens to be.

Definition at line 34 of file reblock.h.

Member Typedef Documentation

◆ pointer

Definition at line 38 of file reblock.h.

Constructor & Destructor Documentation

◆ ~output_filter_reblock()

virtual srecord::output_filter_reblock::~output_filter_reblock ( )
virtual

The destructor.

Member Function Documentation

◆ create()

static pointer srecord::output_filter_reblock::create ( const output::pointer & deeper,
bool align = false )
static

The create class method is used to create new dynamically allocated instanced of this class.

Parameters
deeperWhere to send our filtered output.
alignWhether or not to align data records on block boundaries (that is, to use non-optimal short writes after holes to force alignment).

◆ write()

void srecord::output_filter_reblock::write ( const record & rec)
protectedvirtual

The write method is used to write a recordonto an output.

Derived classes must implement this method.

Parameters
recThe record to be written.

Reimplemented from srecord::output_filter.

◆ line_length_set()

void srecord::output_filter_reblock::line_length_set ( int cols)
protectedvirtual

The set_line_length method is used to set the maximum length of an output line, for those formats for which this is a meaningful concept, and the line length is at all controllable.

Derived classes must implement this method.

Parameters
colsThe page width in fixed width text columns.

Reimplemented from srecord::output_filter.

◆ address_length_set()

void srecord::output_filter_reblock::address_length_set ( int nbytes)
protectedvirtual

The address_length_set method is used to set the minimum number of bytes to be written for addresses in the output, for those formats for which this is a meaningful concept, and the address length is at all controllable.

Derived classes must implement this method.

Parameters
nbytesThe number of byte to use for the address (2..4).

Reimplemented from srecord::output_filter.

◆ preferred_block_size_get()

int srecord::output_filter_reblock::preferred_block_size_get ( void ) const
protectedvirtual

The preferred_block_size_get method is used to get the proferred block size of the output fformat.

Often, but not always, influenced by the line_lebgth_set method. Derived classes must implement this method.

Reimplemented from srecord::output_filter.

◆ preferred_block_size_set()

bool srecord::output_filter_reblock::preferred_block_size_set ( int nbytes)
protectedvirtual

The preferred_block_size_set method is is to set a precific number of bytes for the preferred block size.

Parameters
nbytesThe exact number of bytes to be returned by the preferred_block_size_get method.
Returns
There are format-specific limitations on block sizes, this method will return true if the setting was acceptable, false if the format is incapable of using the specified block size.

Reimplemented from srecord::output_filter.


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