srecord: input/filter/message/adler16.h Source File

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>
24#include <srecord/input/filter/message.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 */
34 class input_filter_message_adler16:
35 public input_filter_message
36{
37public:
38 /**
39 * The destructor.
40 */
41 virtual ~input_filter_message_adler16();
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.
74 void process(const memory &input, record &output);
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
adler16.h
srecord::input_filter_message_adler16::~input_filter_message_adler16
virtual ~input_filter_message_adler16()
The destructor.
srecord::input_filter_message_adler16::create
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.
srecord::input_filter_message_adler16::process
void process(const memory &input, record &output)
The process method is used to process the data from the input.
srecord::input_filter_message_adler16::get_algorithm_name
const char * get_algorithm_name() const
The get_algorithm_name method is used in error messages.
srecord::input_filter_message::input_filter_message
input_filter_message(const input::pointer &deeper, bool naked=false)
The constructor.
srecord::input
The srecord::input class is used to represent an abstract EPROM load file source.
Definition input.h:39
srecord::input::pointer
std::shared_ptr< input > pointer
Definition input.h:41
srecord::memory
The srecord::memory class is used to simulate memory contents.
Definition memory.h:40
srecord::output
The srecord::output class is used to represent an abstract output vector.
Definition output.h:39
srecord::record
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
endian.h
message.h
srecord
Definition adler16.h:25
srecord::endian_t
endian_t
Definition endian.h:27