srecord
1.65.0
bitnot.h
Go to the documentation of this file.
1
//
2
// srecord - manipulate eprom load files
3
// Copyright (C) 2000-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_CHECKSUM_BITNOT_H
21
#define SRECORD_INPUT_FILTER_CHECKSUM_BITNOT_H
22
23
#include <
srecord/input/filter/checksum.h
>
24
25
namespace
srecord
{
26
27
/**
28
* The srecord::input_filter_checksum_bitnot class is used to represent the
29
* state of a checksum filter that inserts a bitnot sum into the data.
30
*/
31
class
input_filter_checksum_bitnot
:
32
public
input_filter_checksum
33
{
34
public
:
35
/**
36
* The destructor.
37
*/
38
virtual
~input_filter_checksum_bitnot
();
39
40
private
:
41
/**
42
* The constructor.
43
*
44
* @param deeper
45
* The deeper input source being checksummed.
46
* @param address
47
* The address to place the checksum.
48
* @param length
49
* The number of bytes of checksum to be placed into the result.
50
* @param end
51
* The byte order.
52
* @param width
53
* The width of the values being summed. Usually 1 byte, but
54
* wider combinations are possible. If you use something
55
* wider, it is assumed that they are alligned on multiples of
56
* that width, no provision for an offset is provided.
57
*/
58
input_filter_checksum_bitnot
(
input::pointer
deeper,
int
address,
59
int
length
,
endian_t
end
,
int
width
= 1);
60
61
public
:
62
/**
63
* The create class method is used to create new dynamically
64
* allocated instances of this class.
65
*
66
* @param deeper
67
* The incoming data source to be filtered
68
* @param address
69
* The address to place the checksum.
70
* @param length
71
* The number of bytes of checksum to be placed into the result.
72
* @param end
73
* The byte order.
74
* @param width
75
* The width of the values being summed. Usually 1 byte, but
76
* wider combinations are possible. If you use something
77
* wider, it is assumed that they are alligned on multiples of
78
* that width, no provision for an offset is provided.
79
*/
80
static
pointer
create
(
const
input::pointer
&deeper,
int
address,
81
int
length
,
endian_t
end
,
int
width
= 1);
82
83
protected
:
84
// See base class for documentation.
85
sum_t
calculate
();
86
87
private
:
88
89
/**
90
* The default constructor. Do not use.
91
*/
92
input_filter_checksum_bitnot
();
93
94
/**
95
* The copy constructor. Do not use.
96
*/
97
input_filter_checksum_bitnot
(
const
input_filter_checksum_bitnot
&);
98
99
/**
100
* The assignment operator. Do not use.
101
*/
102
input_filter_checksum_bitnot
&operator=(
103
const
input_filter_checksum_bitnot
&);
104
};
105
106
};
107
108
#endif
// SRECORD_INPUT_FILTER_CHECKSUM_BITNOT_H
checksum.h
srecord::input_filter_checksum_bitnot
The srecord::input_filter_checksum_bitnot class is used to represent the state of a checksum filter t...
Definition:
bitnot.h:33
srecord::input_filter_checksum_bitnot::~input_filter_checksum_bitnot
virtual ~input_filter_checksum_bitnot()
The destructor.
srecord::input_filter_checksum_bitnot::calculate
sum_t calculate()
The calculate method is used to calculate the checksum to be written into the output,...
srecord::input_filter_checksum_bitnot::create
static pointer create(const input::pointer &deeper, int address, int length, endian_t end, int width=1)
The create class method is used to create new dynamically allocated instances of this class.
srecord::input_filter_checksum
The srecord::input_filter_checksum class is an abstraction of various checksums to be ammplied to inp...
Definition:
checksum.h:37
srecord::input_filter_checksum::sum_t
unsigned long sum_t
Definition:
checksum.h:69
srecord::input_filter_checksum::length
int length
The length instance variable is used to remember how many bytes of checksum are to be emitted.
Definition:
checksum.h:81
srecord::input_filter_checksum::end
endian_t end
The end instance variable is used to remember whether the summation for the checksum is bigendian or ...
Definition:
checksum.h:87
srecord::input_filter_checksum::width
int width
The width instance variable is used to remember the swathe width as the incoming bytes are added to t...
Definition:
checksum.h:100
srecord::input::pointer
std::shared_ptr< input > pointer
Definition:
input.h:41
srecord
Definition:
adler16.h:25
srecord::endian_t
endian_t
Definition:
endian.h:27
input
filter
checksum
bitnot.h
Generated by
1.9.1