srecord: memory/walker/gcrypt.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
gcrypt.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_GCRYPT_H
20#define SRECORD_MEMORY_WALKER_GCRYPT_H
21
22#include <config.h>
23#ifdef HAVE_LIBGCRYPT
24#include <gcrypt.h>
25#else
26 typedef void *gcry_md_hd_t;
27#endif
28
29#include <srecord/memory/walker.h>
30
31namespace srecord
32{
33
34/**
35 * The srecord::memory_walker_gcrypt class is used to represent walking
36 * memory and passing it to the gcrypt library in order to calculate a
37 * message digest.
38 */
39 class memory_walker_gcrypt:
40 public memory_walker
41{
42public:
43 /**
44 * The destructor.
45 */
46 virtual ~memory_walker_gcrypt();
47
48private:
49 /**
50 * The constructor.
51 * It is private on purpose, use the #create class method instead.
52 *
53 * @param handle
54 * used to access the libgcrypt handle to the message digest
55 * being calculated.
56 */
57 memory_walker_gcrypt(gcry_md_hd_t handle);
58
59public:
60 /**
61 * The create class method is used to create new dynamically
62 * allocated instances of this class.
63 *
64 * @param handle
65 * used to access the libgcrypt handle to the message digest
66 * being calculated.
67 */
68 static pointer create(gcry_md_hd_t handle);
69
70protected:
71 // See base class for documentation.
72 void observe(unsigned long, const void *, int);
73
74private:
75 /**
76 * The handle instance variable is used to access the libgcrypt
77 * handle to the message digest being calculated.
78 */
79 gcry_md_hd_t handle;
80
81 /**
82 * The default constructor. Do not use.
83 */
84 memory_walker_gcrypt();
85
86 /**
87 * The copy constructor. Do not use.
88 */
89 memory_walker_gcrypt(const memory_walker_gcrypt &);
90
91 /**
92 * The assignment operator. Do not use.
93 */
94 memory_walker_gcrypt &operator=(const memory_walker_gcrypt &);
95};
96
97};
98
99// vim: set ts=8 sw=4 et :
100#endif // SRECORD_MEMORY_WALKER_GCRYPT_H
srecord::memory_walker_gcrypt::~memory_walker_gcrypt
virtual ~memory_walker_gcrypt()
The destructor.
srecord::memory_walker_gcrypt::observe
void observe(unsigned long, const void *, int)
The observe method is used by the memory walker to provide data.
srecord::memory_walker_gcrypt::create
static pointer create(gcry_md_hd_t handle)
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::memory_walker::pointer
std::shared_ptr< memory_walker > pointer
Definition walker.h:36
gcrypt.h
gcry_md_hd_t
void * gcry_md_hd_t
Definition gcrypt.h:26
srecord
Definition adler16.h:25
walker.h