NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_io_compressedrecstore.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_IO_COMPRESSEDRECSTORE_H__
12#define __BE_IO_COMPRESSEDRECSTORE_H__
13
14#include <memory>
15#include <be_io_compressor.h>
16#include <be_io_recordstore.h>
17
18namespace BiometricEvaluation
19{
20 namespace IO
21 {
27 {
28 public:
50 const std::string &pathname,
51 const std::string &description,
52 const RecordStore::Kind &recordStoreType,
53 const std::string &compressorType);
54
76 const std::string &pathname,
77 const std::string &description,
78 const RecordStore::Kind &recordStoreType,
79 const Compressor::Kind &compressorType);
80
96 const std::string &pathname,
98
99 /*
100 * Destructor.
101 */
102
104
105 /*
106 * Implementation of the RecordStore interface.
107 */
108
109 /*
110 * We need the base class insert() and replace() as well
111 * otherwise, they are hidden by the declarations below.
112 */
115
116 uint64_t
117 getSpaceUsed() const override;
118 void sync() const override;
119 unsigned int getCount() const override;
120 std::string getPathname() const override;
121 std::string getDescription() const override;
123 const std::string &description) override;
124
125 void
127 const std::string &key,
128 const void *const data,
129 const uint64_t size)
130 override;
131
132 void
134 const std::string &key) override;
135
138 const std::string &key) const override;
139
140 uint64_t
142 const std::string &key) const override;
143
144 void
146 const std::string &key) const override;
147
150 int cursor = BE_RECSTORE_SEQ_NEXT)
151 override;
152
153 std::string
155 int cursor = BE_RECSTORE_SEQ_NEXT)
156 override;
157
158 void
160 const std::string &key)
161 override;
162
163 void
165 const std::string &pathname)
166 override;
167
179 const CompressedRecordStore &rhs) = delete;
180
197 const CompressedRecordStore &rhs) = delete;
198
199 private:
200 class Impl;
201 std::unique_ptr<CompressedRecordStore::Impl> pimpl;
202 };
203 }
204}
205#endif /* __BE_IO_COMPRESSEDRECSTORE_H__ */
Sibling-implemented IO::RecordStore with Compression.
uint64_t getSpaceUsed() const override
Obtain real storage utilization.
uint64_t length(const std::string &key) const override
Return the length of a record.
CompressedRecordStore & operator=(const CompressedRecordStore &rhs)=delete
Assignment operator (disabled).
void setCursorAtKey(const std::string &key) override
Set the sequence cursor to an arbitrary position within the RecordStore, starting at key.
void insert(const std::string &key, const void *const data, const uint64_t size) override
Insert a record into the store.
std::string sequenceKey(int cursor=BE_RECSTORE_SEQ_NEXT) override
Sequence through a RecordStore, returning the key.
Memory::uint8Array read(const std::string &key) const override
Read a complete record from a store.
void flush(const std::string &key) const override
Commit the record's data to storage.
void changeDescription(const std::string &description) override
Change the description of the RecordStore.
RecordStore::Record sequence(int cursor=BE_RECSTORE_SEQ_NEXT) override
Sequence through a RecordStore, returning the key/data pairs.
void sync() const override
Synchronize the entire record store to persistent storage.
CompressedRecordStore(const std::string &pathname, const std::string &description, const RecordStore::Kind &recordStoreType, const Compressor::Kind &compressorType)
Create a new CompressedRecordStore, read/write mode.
CompressedRecordStore(const std::string &pathname, IO::Mode mode=IO::Mode::ReadOnly)
Open an existing CompressedRecordStore.
unsigned int getCount() const override
Obtain the number of items in the RecordStore.
CompressedRecordStore(const std::string &pathname, const std::string &description, const RecordStore::Kind &recordStoreType, const std::string &compressorType)
Create a new CompressedRecordStore, read/write mode.
void remove(const std::string &key) override
Remove a record from the store.
std::string getDescription() const override
Obtain a textual description of the RecordStore.
void move(const std::string &pathname) override
Move the RecordStore.
CompressedRecordStore(const CompressedRecordStore &rhs)=delete
Copy constructor (disabled).
std::string getPathname() const override
Return the path name of the RecordStore.
Kind
Kinds of Compressors (for factory)
A class to represent a data storage mechanism.
virtual void insert(const std::string &key, const Memory::uint8Array &data)
Insert a record into the store.
Kind
Possible types of RecordStore.
static const int BE_RECSTORE_SEQ_NEXT
Tell sequence to sequence from current position.
virtual void replace(const std::string &key, const Memory::uint8Array &data)
Replace a complete record in a RecordStore.
Mode
Accessibility of object.
Definition: be_io.h:35
@ ReadOnly
Constant indicating the state of an object that manages some underlying file is accessible for readin...
This software was developed at the National Institute of Standards and Technology (NIST) by employees...