srecord: memory/walker/fletcher32.h Source File

srecord 1.65.0

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