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

srecord 1.65.0

Loading...
Searching...
No Matches
crc32.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 2000-2003, 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_MESSAGE_CRC32_H
21#define SRECORD_INPUT_FILTER_MESSAGE_CRC32_H
22
23#include <srecord/crc32.h>
24#include <srecord/endian.h>
25#include <srecord/input/filter/message.h>
26
27namespace srecord
28{
29
30/**
31 * The srecord::input_filter_message_crc32 class is used to represent the
32 * state of a checksum filter that inserts a CRC32 into the data.
33 */
34 class input_filter_message_crc32:
35 public input_filter_message
36{
37public:
38 /**
39 * The destructor.
40 */
41 virtual ~input_filter_message_crc32();
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_crc32(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 command_line(arglex_tool *cmdln);
75
76 // See base class for documentation.
77 void process(const memory &input, record &output);
78
79 // See base class for documentation.
80 const char *get_algorithm_name() const;
81
82private:
83 /**
84 * The address instance variable is used to remember where to place
85 * the CRC in memory.
86 */
87 unsigned long address;
88
89 /**
90 * The end instance variable is used to remember whether the byte
91 * order is big-endian or little-endian.
92 */
93 endian_t end;
94
95 /**
96 * The seed_mode instance variable is used to remember what the
97 * user wants for the initial seed. The default is to use the
98 * standard CCITT seed.
99 */
100 crc32::seed_mode_t seed_mode;
101
102 /**
103 * The default constructor. Do not use.
104 */
105 input_filter_message_crc32();
106
107 /**
108 * The copy constructor. Do not use.
109 */
110 input_filter_message_crc32(const input_filter_message_crc32 &);
111
112 /**
113 * The assignment operator. Do not use.
114 */
115 input_filter_message_crc32 &operator=(const input_filter_message_crc32 &);
116};
117
118};
119
120#endif // SRECORD_INPUT_FILTER_MESSAGE_CRC32_H
srecord::arglex_tool
The srecord::arglex_tool is used to parse command line with srec-specific arguments.
Definition tool.h:41
srecord::crc32::seed_mode_t
seed_mode_t
Definition crc32.h:36
srecord::input_filter_message_crc32::~input_filter_message_crc32
virtual ~input_filter_message_crc32()
The destructor.
srecord::input_filter_message_crc32::command_line
void command_line(arglex_tool *cmdln)
The command_line method is used by arglex_srec::get_input when parsing the command line,...
srecord::input_filter_message_crc32::get_algorithm_name
const char * get_algorithm_name() const
The get_algorithm_name method is used in error messages.
srecord::input_filter_message_crc32::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_crc32::process
void process(const memory &input, record &output)
The process method is used to process the data from the input.
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
crc32.h
endian.h
message.h
srecord
Definition adler16.h:25
srecord::endian_t
endian_t
Definition endian.h:27