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
26typedef void *gcry_md_hd_t;
27#endif
28
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 */
39class memory_walker_gcrypt:
40 public memory_walker
41{
42public:
43 /**
44 * The destructor.
45 */
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
virtual ~memory_walker_gcrypt()
The destructor.
void observe(unsigned long, const void *, int)
The observe method is used by the memory walker to provide data.
static pointer create(gcry_md_hd_t handle)
The create class method is used to create new dynamically allocated instances of this class.
memory_walker()
The default constructor.
std::shared_ptr< memory_walker > pointer
Definition walker.h:36
void * gcry_md_hd_t
Definition gcrypt.h:26