srecord  1.65.0
constant.h
Go to the documentation of this file.
1 //
2 // srecord - The "srecord" program.
3 // Copyright (C) 2007, 2008, 2010, 2011 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this program. If not, see
17 // <http://www.gnu.org/licenses/>.
18 //
19 
20 #ifndef SRECORD_INPUT_GENERATOR_CONSTANT_H
21 #define SRECORD_INPUT_GENERATOR_CONSTANT_H
22 
24 
25 namespace srecord
26 {
27 
28 /**
29  * The srecord::input_generator_constant class is used to represent the
30  * state of a data generator which supplies constant bytes.
31  */
33  public input_generator
34 {
35 public:
36  /**
37  * The destructor.
38  */
40 
41 private:
42  /**
43  * The constructor.
44  */
45  input_generator_constant(const interval &range, unsigned char datum);
46 
47 public:
48  /**
49  * The create class method is used to create new dynamically
50  * allocated instances of this class.
51  */
52  static pointer create(const interval &range, unsigned char datum);
53 
54 protected:
55  // See base class for documentation.
56  std::string filename() const;
57 
58  // See base class for documentation.
59  const char *get_file_format_name() const;
60 
61  // See base class for documentation.
62  unsigned char generate_data(unsigned long address);
63 
64 private:
65  /**
66  * The datum instance variable is used to remember the constant
67  * byte value to be generated.
68  */
69  unsigned char datum;
70 
71  /**
72  * The default constructor. Do not use.
73  */
75 
76  /**
77  * The copy constructor. Do not use.
78  */
80 
81  /**
82  * The assignment operator. Do not use.
83  */
85 };
86 
87 };
88 
89 // vim: set ts=8 sw=4 et :
90 #endif // SRECORD_INPUT_GENERATOR_CONSTANT_H
The srecord::input_generator_constant class is used to represent the state of a data generator which ...
Definition: constant.h:34
std::string filename() const
The filename method is used to get the name of the input file being processed.
static pointer create(const interval &range, unsigned char datum)
The create class method is used to create new dynamically allocated instances of this class.
const char * get_file_format_name() const
The get_file_format_name method is used to find out the name of the file format being read.
virtual ~input_generator_constant()
The destructor.
unsigned char generate_data(unsigned long address)
The generate_data method is used to manufacture data for a specific address.
The srecord::input_generator class is used to represent the state of generating data from whole cloth...
Definition: generator.h:35
std::shared_ptr< input > pointer
Definition: input.h:41
The interval class is used to represent a set of integer values, usually composed of runs of adjacent...
Definition: interval.h:36