srecord  1.65.0
and.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_AND_H
21 #define SRECORD_INPUT_FILTER_AND_H
22 
23 #include <srecord/input/filter.h>
24 
25 namespace srecord {
26 
27 /**
28  * The srecord::input_filter_and clas sis used to represent the input state
29  * of a filter which bit-wise ANDs all incoming data bytes with a fixed
30  * value.
31  */
33  public input_filter
34 {
35 public:
36  /**
37  * The destructor.
38  */
39  virtual ~input_filter_and();
40 
41 private:
42  /**
43  * The constructor.
44  *
45  * @param deeper
46  * The deeper input to be used as a data source.
47  * @param mask
48  * The value to be bit-wise ANDed with each incoming data byte.
49  */
50  input_filter_and(const input::pointer &deeper, int mask);
51 
52 public:
53  /**
54  * The create class method is used to create new dynamically
55  * allocated instances of this class.
56  *
57  * @param deeper
58  * The incoming data source to be filtered
59  * @param mask
60  * The value to be bit-wise ANDed with each incoming data byte.
61  */
62  static pointer create(const input::pointer &deeper, int mask);
63 
64 protected:
65  // See base class for documentation.
66  bool read(record &record);
67 
68 private:
69  /**
70  * The value instance variable is used to remember the value to be
71  * bit-wise ANDed with each incoming data byte.
72  */
73  int value;
74 
75  /**
76  * The default constructor. Do not use.
77  */
79 
80  /**
81  * The copy constructor. Do not use.
82  */
84 
85  /**
86  * The assignment operator. Do not use.
87  */
88  input_filter_and &operator=(const input_filter_and &);
89 };
90 
91 };
92 
93 #endif // SRECORD_INPUT_FILTER_AND_H
The srecord::input_filter_and clas sis used to represent the input state of a filter which bit-wise A...
Definition: and.h:34
virtual ~input_filter_and()
The destructor.
static pointer create(const input::pointer &deeper, int mask)
The create class method is used to create new dynamically allocated instances of this class.
bool read(record &record)
The read method is used to read one record from the input.
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