srecord  1.65.0
sequence.h
Go to the documentation of this file.
1 //
2 // srecord - manipulate eprom load files
3 // Copyright (C) 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_SEQUENCE_H
21 #define SRECORD_INPUT_FILTER_SEQUENCE_H
22 
23 #include <srecord/input/filter.h>
24 
25 namespace srecord
26 {
27 
28 /**
29  * The srecord::input_filter_sequence class is used to represent an input
30  * filter which does not change the data in any way, but issues
31  * warnings if the data is not instrictly ascending address order.
32  */
34  public input_filter
35 {
36 public:
37  /**
38  * The destructor.
39  */
41 
42 private:
43  /**
44  * The constructor.
45  */
47 
48 public:
49  /**
50  * The create class method is used to create new dynamically
51  * allocated instances of this class.
52  */
53  static pointer create(input::pointer deeper);
54 
55 protected:
56  // See base class for documentation.
57  bool read(record &record);
58 
59 private:
60  /**
61  * The last_address instance variable is used to remember the high
62  * water mark for data record addresses to date. Records with data
63  * addresses less than this cause an "out of sequence" warning.
64  * It is check and updated by the read() method.
65  */
66  unsigned long last_address;
67 
68  /**
69  * The warned instance variable is used to remember whether or not
70  * an "out of sequence" warning has already been issued for this
71  * file.
72  *
73  * We only issue a single warning, because the linker in some
74  * embedded too chains emit zillions of these as they walk across
75  * object files updating segemnts in parallel.
76  */
77  bool warned;
78 
79  /**
80  * The default constructor. Do not use.
81  */
83 
84  /**
85  * The copy constructor. Do not use.
86  */
88 
89  /**
90  * The assignment operator. Do not use.
91  */
92  input_filter_sequence &operator=(const input_filter_sequence &);
93 };
94 
95 };
96 
97 #endif // SRECORD_INPUT_FILTER_SEQUENCE_H
The srecord::input_filter_sequence class is used to represent an input filter which does not change t...
Definition: sequence.h:35
virtual ~input_filter_sequence()
The destructor.
bool read(record &record)
The read method is used to read one record from the input.
static pointer create(input::pointer deeper)
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 srecord::record class is used to represent a data record read from a file.
Definition: record.h:35