NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_memory_indexedbuffer.h
Go to the documentation of this file.
1/*
2 * This software was developed at the National Institute of Standards and
3 * Technology (NIST) by employees of the Federal Government in the course
4 * of their official duties. Pursuant to title 17 Section 105 of the
5 * United States Code, this software is not subject to copyright protection
6 * and is in the public domain. NIST assumes no responsibility whatsoever for
7 * its use by other parties, and makes no guarantees, expressed or implied,
8 * about its quality, reliability, or any other characteristic.
9 */
10
11#ifndef __BE_MEMORY_INDEXEDBUFFER__
12#define __BE_MEMORY_INDEXEDBUFFER__
13
14#include <be_memory_autoarray.h>
15
16namespace BiometricEvaluation
17{
18 namespace Memory
19 {
34 {
35 public:
38
49 const uint8_t *data,
50 uint64_t size);
51
60 const uint8Array &aa);
61
64 const IndexedBuffer &copy) = default;
65
73 uint32_t
75 const;
76
88 uint32_t
90 const;
91
102 void
104 uint64_t index);
105
118 uint8_t
120
133 uint16_t
135
149 uint16_t
151
165 uint32_t
167
181 uint32_t
183
197 uint64_t
199
216 uint64_t
218 void *buf,
219 uint64_t len);
220
228 virtual const uint8_t*
230 const;
231
233#ifdef __MIC__
234 virtual ~IndexedBuffer() noexcept = default;
235#else
236 virtual ~IndexedBuffer() = default;
237#endif
238
239
240 private:
242 const uint8_t * const _data;
243
245 const uint64_t _size;
246
248 uint64_t _index;
249 };
250 }
251}
252#endif /* __BE_MEMORY_INDEXEDBUFFER__ */
Wrap a memory buffer with an index.
IndexedBuffer(const IndexedBuffer &copy)=default
Copy constructor (default).
uint64_t scan(void *buf, uint64_t len)
Obtain the next 'n' elements of the buffer and increment the current index value by n.
uint32_t scanU32Val()
Obtain the next four elements of the buffer and increment the current index value by four.
void setIndex(uint64_t index)
Set the current index into the buffer.
uint8_t scanU8Val()
Obtain the next element of the buffer and increment the current index value.
uint16_t scanU16Val()
Obtain the next two elements of the buffer and increment the current index value.
virtual ~IndexedBuffer()=default
Destructor (default).
virtual const uint8_t * get() const
Returns a pointer to the managed buffer.
uint32_t scanBeU32Val()
Obtain the next four elements of the buffer, scanned as a big-endian value, and increment the current...
IndexedBuffer(const uint8Array &aa)
Wrap an existing uint8Array.
uint64_t scanU64Val()
Obtain the next eight elements of the buffer and increment the current index value by eight.
uint32_t getIndex() const
Obtain the current index into the buffer.
uint16_t scanBeU16Val()
Obtain the next two elements of the buffer, scanned as a big-endian value, and increment the current ...
uint32_t getSize() const
Obtain the current size of the buffer.
IndexedBuffer(const uint8_t *data, uint64_t size)
Wrap an existing buffer of a given length.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...