srecord 1.65.0
 
Loading...
Searching...
No Matches
adler16.h
Go to the documentation of this file.
1//
2// srecord - Manipulate EPROM load files
3// Copyright (C) 2009-2011 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 (at
8// 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 GNU
13// 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 <http://www.gnu.org/licenses/>.
17//
18
19#ifndef SRECORD_INPUT_FILTER_MESSAGE_ADLER16_H
20#define SRECORD_INPUT_FILTER_MESSAGE_ADLER16_H
21
22#include <srecord/adler16.h>
23#include <srecord/endian.h>
25
26namespace srecord
27{
28
29/**
30 * The srecord::input_filter_message_adler16 class is used to represent the
31 * state of a checksum filter that inserts an Adler 16 checksum into
32 * the data.
33 */
34class input_filter_message_adler16:
36{
37public:
38 /**
39 * The destructor.
40 */
42
43private:
44 /**
45 * The constructor.
46 *
47 * @param deeper
48 * The incoming data source to be filtered
49 * @param address
50 * Where to place the checksum.
51 * @param end
52 * The byte order.
53 */
54 input_filter_message_adler16(const input::pointer &deeper,
55 unsigned long address, endian_t end);
56
57public:
58 /**
59 * The create class method is used to create new dynamically
60 * allocated instances of this class.
61 *
62 * @param deeper
63 * The incoming data source to be filtered
64 * @param address
65 * Where to place the checksum.
66 * @param end
67 * The byte order.
68 */
69 static pointer create(const input::pointer &deeper, unsigned long address,
70 endian_t end);
71
72protected:
73 // See base class for documentation.
75
76 // See base class for documentation.
77 const char *get_algorithm_name() const;
78
79private:
80 /**
81 * The address instance variable is used to remember where to place
82 * the Adler 16 checksum in memory.
83 */
84 unsigned long address;
85
86 /**
87 * The end instance variable is used to remember whether the byte
88 * order is big-endian or little-endian.
89 */
90 endian_t end;
91
92 /**
93 * The default constructor. Do not use.
94 */
95 input_filter_message_adler16();
96
97 /**
98 * The copy constructor. Do not use.
99 */
100 input_filter_message_adler16(const input_filter_message_adler16 &);
101
102 /**
103 * The assignment operator. Do not use.
104 */
105 input_filter_message_adler16 &operator=(
106 const input_filter_message_adler16 &);
107};
108
109};
110
111// vim: set ts=8 sw=4 et :
112#endif // SRECORD_INPUT_FILTER_MESSAGE_ADLER16_H
virtual ~input_filter_message_adler16()
The destructor.
static pointer create(const input::pointer &deeper, unsigned long address, endian_t end)
The create class method is used to create new dynamically allocated instances of this class.
void process(const memory &input, record &output)
The process method is used to process the data from the input.
const char * get_algorithm_name() const
The get_algorithm_name method is used in error messages.
input_filter_message(const input::pointer &deeper, bool naked=false)
The constructor.
The srecord::input class is used to represent an abstract EPROM load file source.
Definition input.h:39
std::shared_ptr< input > pointer
Definition input.h:41
The srecord::memory class is used to simulate memory contents.
Definition memory.h:40
The srecord::output class is used to represent an abstract output vector.
Definition output.h:39
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
endian_t
Definition endian.h:27