srecord: input/filter/random_fill.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
random_fill.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 1998, 1999, 2001, 2002, 2004, 2006-2008, 2010 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_FILTER_RANDOM_FILL_H
21#define SRECORD_INPUT_FILTER_RANDOM_FILL_H
22
23#include <srecord/interval.h>
24#include <srecord/input/filter.h>
25#include <srecord/record.h>
26
27namespace srecord
28{
29
30/**
31 * The srecord::input_filter_random_fill class is used to represent a filter
32 * which replaces in set data locations with random data.
33 */
34 class input_filter_random_fill:
35 public input_filter
36{
37public:
38 /**
39 * The destructor.
40 */
41 virtual ~input_filter_random_fill();
42
43private:
44 /**
45 * The constructor.
46 *
47 * @param deeper
48 * The incoming data source to be filtered
49 * @param range
50 * the addres srange to be filled.
51 */
52 input_filter_random_fill(const input::pointer &deeper,
53 const interval &range);
54
55public:
56 /**
57 * The create class method is used to create new dynamically
58 * allocated instances of this class.
59 *
60 * @param deeper
61 * The incoming data source to be filtered
62 * @param range
63 * the addres srange to be filled.
64 */
65 static pointer create(const input::pointer &deeper, const interval &range);
66
67protected:
68 // See base class for documentation.
69 bool read(record &record);
70
71private:
72 /**
73 * The range instance variable is used to remember the range of
74 * addresses to be filled. As fill blocks are produced the range
75 * is reduced.
76 */
77 interval range;
78
79 /**
80 * The generate method is used to genetate fill records.
81 */
82 bool generate(record &record);
83
84 /**
85 * The default constructor. Do not use.
86 */
87 input_filter_random_fill();
88
89 /**
90 * The copy constructor. Do not use.
91 */
92 input_filter_random_fill(const input_filter_random_fill &);
93
94 /**
95 * The assignment operator. Do not use.
96 */
97 input_filter_random_fill &operator=(const input_filter_random_fill &);
98};
99
100};
101
102#endif // SRECORD_INPUT_FILTER_RANDOM_FILL_H
srecord::input_filter_random_fill::read
bool read(record &record)
The read method is used to read one record from the input.
srecord::input_filter_random_fill::create
static pointer create(const input::pointer &deeper, const interval &range)
The create class method is used to create new dynamically allocated instances of this class.
srecord::input_filter_random_fill::~input_filter_random_fill
virtual ~input_filter_random_fill()
The destructor.
srecord::input_filter::input_filter
input_filter(input::pointer deeper)
The constructor.
srecord::input::pointer
std::shared_ptr< input > pointer
Definition input.h:41
srecord::interval
The interval class is used to represent a set of integer values, usually composed of runs of adjacent...
Definition interval.h:36
srecord::record
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
filter.h
interval.h
srecord
Definition adler16.h:25
record.h