srecord  1.65.0
srecord::input_generator Class Referenceabstract

The srecord::input_generator class is used to represent the state of generating data from whole cloth. More...

#include <generator.h>

Inheritance diagram for srecord::input_generator:
Collaboration diagram for srecord::input_generator:

Public Member Functions

virtual ~input_generator ()
 The destructor. More...
 
 input_generator (const interval &range)
 The constructor. More...
 
- Public Member Functions inherited from srecord::input
virtual ~input ()
 The destructor. More...
 
virtual void fatal_error (const char *,...) const FORMAT_PRINTF(2
 The fatal_error method is used to report problems parsing the file. More...
 
virtual void virtual void fatal_error_errno (const char *,...) const FORMAT_PRINTF(2
 The fatal_error_errno method is used to report problems reading the input file. More...
 
virtual void virtual void virtual void warning (const char *,...) const FORMAT_PRINTF(2
 The warning method is used to report potential (but non-fatal) problems parsing the file. More...
 
virtual void virtual void virtual void virtual std::string filename (void) const =0
 The filename method is used to get the name of the input file being processed. More...
 
virtual std::string filename_and_line (void) const
 The filename_and_line method is used to get the name and current line number within the file. More...
 
virtual const char * get_file_format_name (void) const =0
 The get_file_format_name method is used to find out the name of the file format being read. More...
 
void set_quit (quit &)
 The set_quit method is used to set the disposition of the error messages, and the "exit" implementation. More...
 
void reset_quit (void)
 The reset_quit method is used to cause the disposition of the error messages, and the "exit" back to the default. More...
 
virtual void command_line (srecord::arglex_tool *cmdln)
 The command_line method is used by arglex_srec::get_input when parsing the command line, to give a format or filter an opportunity to grab extra arguments off the command line. More...
 

Static Public Member Functions

static input::pointer create (arglex_tool *cmdln)
 The create class method may be used to create new instances of input data generators. More...
 

Protected Member Functions

bool read (record &record)
 The read method is used to read one record from the input. More...
 
void disable_checksum_validation ()
 The disable_checksum_validation method is used to have this input stream ignore checksum errors. More...
 
virtual unsigned char generate_data (unsigned long address)=0
 The generate_data method is used to manufacture data for a specific address. More...
 
- Protected Member Functions inherited from srecord::input
 input ()
 The default constructor. More...
 

Additional Inherited Members

- Public Types inherited from srecord::input
typedef std::shared_ptr< inputpointer
 

Detailed Description

The srecord::input_generator class is used to represent the state of generating data from whole cloth.

Definition at line 33 of file generator.h.

Constructor & Destructor Documentation

◆ ~input_generator()

virtual srecord::input_generator::~input_generator ( )
virtual

The destructor.

◆ input_generator()

srecord::input_generator::input_generator ( const interval range)

The constructor.

Parameters
rangeThe data range over which data is to be generated.

Member Function Documentation

◆ create()

static input::pointer srecord::input_generator::create ( arglex_tool cmdln)
static

The create class method may be used to create new instances of input data generators.

Parameters
cmdlnThe command line arguments, for deciding what to generate.

◆ read()

bool srecord::input_generator::read ( record rec)
protectedvirtual

The read method is used to read one record from the input.

It returns 0 at the end of the input, and 1 if a record is read successfully.

See the srecord::record documentation (header file) for details of the various record types.

Note: there is no guarantee that a header record will appear first, or that a execution start address record will appear last.

Parameters
recWhere to put the returned data.
Returns
bool; true if data was read, false if at end-of-file

Implements srecord::input.

◆ disable_checksum_validation()

void srecord::input_generator::disable_checksum_validation ( )
protectedvirtual

The disable_checksum_validation method is used to have this input stream ignore checksum errors.

Implements srecord::input.

◆ generate_data()

virtual unsigned char srecord::input_generator::generate_data ( unsigned long  address)
protectedpure virtual

The generate_data method is used to manufacture data for a specific address.

Parameters
addressThe address to generate data for.
Returns
one byte of data

Implemented in srecord::input_generator_repeat, srecord::input_generator_random, and srecord::input_generator_constant.


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