NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_io_filerecstore.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#ifndef __BE_FILERECSTORE_H__
11#define __BE_FILERECSTORE_H__
12
13#include <be_io_recordstore.h>
14
15/*
16 * This file contains the class declaration for an implementation of a
17 * RecordStore using a on-disk database.
18 */
19namespace BiometricEvaluation {
20
21 namespace IO {
22
35 public:
36
51 const std::string &pathname,
52 const std::string &description);
53
69 const std::string &name,
71
73
74 /*
75 * Methods that implement the RecordStore interface.
76 */
77
78 /*
79 * We need the base class insert() and replace() as well
80 * otherwise, they are hidden by the declarations below.
81 */
84
85 void insert(
86 const std::string &key,
87 const void *const data,
88 const uint64_t size)
89 override;
90
91 void remove(
92 const std::string &key)
93 override;
94
96 const std::string &key) const override;
97
98 void replace(
99 const std::string &key,
100 const void *const data,
101 const uint64_t size) override final;
102
103 uint64_t length(
104 const std::string &key) const override;
105
106 void flush(
107 const std::string &key) const override;
108
110 int cursor = BE_RECSTORE_SEQ_NEXT)
111 override;
112
113 std::string
115 int cursor = BE_RECSTORE_SEQ_NEXT)
116 override;
117
119 const std::string &key)
120 override;
121
122 void move(
123 const std::string &pathname)
124 override;
125
126 uint64_t getSpaceUsed() const override;
127 void sync() const override;
128 unsigned int getCount() const override;
129 std::string getPathname() const override;
130 std::string getDescription() const override;
132 const std::string &description) override;
133
134 /* Prevent copying of FileRecordStore objects */
137 delete;
138 protected:
139 private:
140 class Impl;
141 std::unique_ptr<FileRecordStore::Impl> pimpl;
142 };
143 }
144}
145#endif /* __BE_FILERECSTORE_H__ */
A class to represent the record store data storage mechanism implemented as files for each record.
FileRecordStore & operator=(const FileRecordStore &)=delete
std::string getDescription() const override
Obtain a textual description of the RecordStore.
void remove(const std::string &key) override
Remove a record from the store.
void sync() const override
Synchronize the entire record store to persistent storage.
FileRecordStore(const std::string &pathname, const std::string &description)
Create a new FileRecordStore, read/write mode.
void changeDescription(const std::string &description) override
Change the description of the RecordStore.
void insert(const std::string &key, const void *const data, const uint64_t size) override
Insert a record into the store.
void move(const std::string &pathname) override
Move the RecordStore.
unsigned int getCount() const override
Obtain the number of items in the RecordStore.
uint64_t getSpaceUsed() const override
Obtain real storage utilization.
void setCursorAtKey(const std::string &key) override
Set the sequence cursor to an arbitrary position within the RecordStore, starting at key.
FileRecordStore(const FileRecordStore &)=delete
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.
std::string sequenceKey(int cursor=BE_RECSTORE_SEQ_NEXT) override
Sequence through a RecordStore, returning the key.
uint64_t length(const std::string &key) const override
Return the length of a record.
std::string getPathname() const override
Return the path name of the RecordStore.
FileRecordStore(const std::string &name, IO::Mode mode=IO::Mode::ReadOnly)
Open an existing FileRecordStore.
RecordStore::Record sequence(int cursor=BE_RECSTORE_SEQ_NEXT) override
Sequence through a RecordStore, returning the key/data pairs.
void replace(const std::string &key, const void *const data, const uint64_t size) override final
Replace a complete record in a RecordStore.
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.
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...