srecord  1.65.0
crop.h
Go to the documentation of this file.
1 //
2 // srecord - manipulate eprom load files
3 // Copyright (C) 1998, 1999, 2001, 2002, 2005-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_CROP_H
21 #define SRECORD_INPUT_FILTER_CROP_H
22 
23 #include <srecord/interval.h>
24 #include <srecord/input/filter.h>
25 #include <srecord/record.h>
26 
27 namespace srecord {
28 
29 /**
30  * The srecord::input_filter_crop filter is used to crop the data by
31  * selecting portions of the address range to be passed through.
32  */
34  public input_filter
35 {
36 public:
37  /**
38  * The destructor.
39  */
40  virtual ~input_filter_crop();
41 
42 private:
43  /**
44  * The constructor.
45  *
46  * @param deeper
47  * The input source to be cropped.
48  * @param range
49  * The address range to be preserved. The rest will be
50  * ignored.
51  */
52  input_filter_crop(const input::pointer &deeper, const interval &range);
53 
54 public:
55  /**
56  * The create class method is used to create new dynamically
57  * allocated instances of this class.
58  *
59  * @param deeper
60  * The incoming data source to be filtered
61  * @param range
62  * The address range to be preserved. The rest will be
63  * ignored.
64  */
65  static pointer create(const input::pointer &deeper, const interval &range);
66 
67 protected:
68  // See base class for documentation.
69  bool read(record &record);
70 
71 private:
72  /**
73  * The range instance variable is used to remember the address
74  * range to be preserved.
75  */
76  interval range;
77 
78  /**
79  * The dat instance variable is used to remember the current input
80  * data record being filtered.
81  */
82  record data;
83 
84  /**
85  * The data_range instance variable is used to remember the address
86  * range in the incoming data.
87  */
88  interval data_range;
89 
90  /**
91  * The default constructor. Do not use.
92  */
94 
95  /**
96  * The copy constructor. Do not use.
97  */
99 
100  /**
101  * The assignment operator. Do not use.
102  */
103  input_filter_crop &operator=(const input_filter_crop &);
104 };
105 
106 };
107 
108 #endif // SRECORD_INPUT_FILTER_CROP_H
The srecord::input_filter_crop filter is used to crop the data by selecting portions of the address r...
Definition: crop.h:35
bool read(record &record)
The read method is used to read one record from the input.
virtual ~input_filter_crop()
The destructor.
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.
The srecord::input_filter class is an abstract interface for all of the various filters that can be a...
Definition: filter.h:37
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
The srecord::record class is used to represent a data record read from a file.
Definition: record.h:35