srecord 1.65.0
 
Loading...
Searching...
No Matches
random.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_RANDOM_H
21#define SRECORD_INPUT_GENERATOR_RANDOM_H
22
24
25namespace srecord
26{
27
28/**
29 * The srecord::input_generator_random class is used to represent a factory
30 * which manufactures random data.
31 */
32class input_generator_random:
33 public input_generator
34{
35public:
36 /**
37 * The destructor.
38 */
40
41private:
42 /**
43 * The constructor.
44 */
45 input_generator_random(const interval &range);
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);
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 default constructor. Do not use.
67 */
68 input_generator_random();
69
70 /**
71 * The copy constructor. Do not use.
72 */
73 input_generator_random(const input_generator_random &);
74
75 /**
76 * The assignment operator. Do not use.
77 */
78 input_generator_random &operator=(const input_generator_random &);
79};
80
81};
82
83// vim: set ts=8 sw=4 et :
84#endif // SRECORD_INPUT_GENERATOR_RANDOM_H
virtual ~input_generator_random()
The destructor.
unsigned char generate_data(unsigned long address)
The generate_data method is used to manufacture data for a specific address.
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)
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.
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