srecord: memory/walker/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, 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_MEMORY_WALKER_ADLER16_H
21#define SRECORD_MEMORY_WALKER_ADLER16_H
22
23#include <srecord/adler16.h>
24#include <srecord/memory/walker.h>
25
26namespace srecord
27{
28
29/**
30 * The srecord::memory_walker_adler16 class is used to represent the parse
31 * state of a memory walker which calculates a running ADLER16 checksum.
32 */
33 class memory_walker_adler16:
34 public memory_walker
35{
36public:
37 typedef std::shared_ptr<memory_walker_adler16> pointer;
38
39 /**
40 * The destructor.
41 */
42 virtual ~memory_walker_adler16();
43
44private:
45 /**
46 * The default constructor. It is private on putpose, use the
47 * #create method instead.
48 */
49 memory_walker_adler16();
50
51public:
52 /**
53 * The create class method is used to create new dynamically
54 * allocated instances of this class.
55 */
56 static pointer create();
57
58 /**
59 * The get method is used to get the ADLER16 checksum once all memory
60 * chunks have been processed by calls to our observe method.
61 */
62 unsigned get() const;
63
64protected:
65 // See base class for documentation.
66 void observe(unsigned long, const void *, int);
67
68private:
69 /**
70 * The checksum instance variable is used to remember the running
71 * state of the ADLER16 checksum calculation.
72 */
73 adler16 checksum;
74
75 /**
76 * The copy constructor. Do not use.
77 */
78 memory_walker_adler16(const memory_walker_adler16 &);
79
80 /**
81 * The assignment operator. Do not use.
82 */
83 memory_walker_adler16 &operator=(const memory_walker_adler16 &);
84};
85
86};
87
88#endif // SRECORD_MEMORY_WALKER_ADLER16_H
adler16.h
srecord::adler16
The adler16 class is used to represent the running value of a 16-bit Adler checksum of series of byte...
Definition adler16.h:33
srecord::memory_walker_adler16::get
unsigned get() const
The get method is used to get the ADLER16 checksum once all memory chunks have been processed by call...
srecord::memory_walker_adler16::pointer
std::shared_ptr< memory_walker_adler16 > pointer
Definition adler16.h:37
srecord::memory_walker_adler16::~memory_walker_adler16
virtual ~memory_walker_adler16()
The destructor.
srecord::memory_walker_adler16::observe
void observe(unsigned long, const void *, int)
The observe method is used by the memory walker to provide data.
srecord::memory_walker_adler16::create
static pointer create()
The create class method is used to create new dynamically allocated instances of this class.
srecord::memory_walker::memory_walker
memory_walker()
The default constructor.
srecord
Definition adler16.h:25
walker.h