srecord 1.65.0
 
Loading...
Searching...
No Matches
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
25namespace 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 */
32class input_generator_constant:
33 public input_generator
34{
35public:
36 /**
37 * The destructor.
38 */
40
41private:
42 /**
43 * The constructor.
44 */
45 input_generator_constant(const interval &range, unsigned char datum);
46
47public:
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
54protected:
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
64private:
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 */
74 input_generator_constant();
75
76 /**
77 * The copy constructor. Do not use.
78 */
79 input_generator_constant(const input_generator_constant &);
80
81 /**
82 * The assignment operator. Do not use.
83 */
84 input_generator_constant &operator=(const input_generator_constant &);
85};
86
87};
88
89// vim: set ts=8 sw=4 et :
90#endif // SRECORD_INPUT_GENERATOR_CONSTANT_H
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.
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.
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.
input_generator(const interval &range)
The constructor.
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