srecord: input/filter/unsplit.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
unsplit.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 1998, 1999, 2001, 2002, 2005-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_UNSPLIT_H
21#define SRECORD_INPUT_FILTER_UNSPLIT_H
22
23#include <srecord/input/filter.h>
24#include <srecord/record.h>
25
26namespace srecord
27{
28
29/**
30 * The srecord::input_filter_unsplit class is used to represent a filter
31 * whoch explosed the deeper input source. This is the inverse of the
32 * srecord::input_filter_split class. This can be used to takes the images
33 * of thwo parallel EPROM images and create a unified image when they
34 * are interleaved rather than consecutive.
35 *
36 * @sa
37 * srecord::input_filter_split
38 */
39 class input_filter_unsplit:
40 public input_filter
41{
42public:
43 /**
44 * The destructor.
45 */
46 virtual ~input_filter_unsplit();
47
48private:
49 /**
50 * The constructor.
51 *
52 * @param deeper
53 * The deeper input source to be filtered.
54 * @param modulus
55 * The number of bytes wide each swathe is.
56 * @param offset
57 * The offset within the swathe.
58 * @param width
59 * The width of each stripe within the swathe.
60 */
61 input_filter_unsplit(const input::pointer &deeper, int modulus, int offset,
62 int width);
63
64public:
65 /**
66 * The create class method is used to create new dynamically
67 * allocated instances of this class.
68 *
69 * @param deeper
70 * The incoming data source to be filtered
71 * @param modulus
72 * The number of bytes wide each swathe is.
73 * @param offset
74 * The offset within the swathe.
75 * @param width
76 * The width of each stripe within the swathe.
77 */
78 static pointer create(const input::pointer &deeper, int modulus, int offset,
79 int width);
80
81protected:
82 // See base class for documentation.
83 bool read(record &record);
84
85private:
86 /**
87 * The modulus instance variable is used to remember the number of
88 * bytes wide each swathe is.
89 */
90 record::address_t modulus;
91
92 /**
93 * The offset instance variable is used to remember the offset
94 * within the swathe.
95 */
96 record::address_t offset;
97
98 /**
99 * The width instance variable is used to remember the width of
100 * each stripe within the swathe.
101 */
102 record::address_t width;
103
104 /**
105 * The buffer instance variable is used to remember the last lot
106 * of data read from the deeper inputs source, and currently being
107 * processed.
108 */
109 record buffer;
110
111 /**
112 * The buffer_pos instance variable is used to remember where we
113 * are up to in the "buffer" instance varaible.
114 */
115 size_t buffer_pos;
116
117 /**
118 * The default constructor. Do not use.
119 */
120 input_filter_unsplit();
121
122 /**
123 * The copy constructor. Do not use.
124 */
125 input_filter_unsplit(const input_filter_unsplit &);
126
127 /**
128 * The assignment operator. Do not use.
129 */
130 input_filter_unsplit &operator=(const input_filter_unsplit &);
131};
132
133};
134
135#endif // SRECORD_INPUT_FILTER_UNSPLIT_H
srecord::input_filter_unsplit::read
bool read(record &record)
The read method is used to read one record from the input.
srecord::input_filter_unsplit::create
static pointer create(const input::pointer &deeper, int modulus, int offset, int width)
The create class method is used to create new dynamically allocated instances of this class.
srecord::input_filter_unsplit::~input_filter_unsplit
virtual ~input_filter_unsplit()
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::record
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
srecord::record::address_t
uint32_t address_t
The type of record addresses.
Definition record.h:58
filter.h
srecord
Definition adler16.h:25
record.h