Nail to Nail Fingerprint Capture Challenge
API for participant-specific one-to-many template generation and template matching.
|
A class to represent a data storage mechanism. More...
#include <be_io_recordstore.h>
Classes | |
struct | Record |
Public Types | |
enum class | Kind { BerkeleyDB , Archive , File , SQLite , Compressed , List , Default = BerkeleyDB } |
Possible types of RecordStore. More... | |
using | Record = Record |
using | iterator = IO::RecordStoreIterator |
Public Member Functions | |
virtual std::string | getDescription () const =0 |
Obtain a textual description of the RecordStore. More... | |
virtual unsigned int | getCount () const =0 |
Obtain the number of items in the RecordStore. More... | |
virtual std::string | getPathname () const =0 |
Return the path name of the RecordStore. More... | |
virtual void | move (const std::string &pathname)=0 |
Move the RecordStore. More... | |
virtual void | changeDescription (const std::string &description)=0 |
Change the description of the RecordStore. More... | |
virtual uint64_t | getSpaceUsed () const =0 |
Obtain real storage utilization. More... | |
virtual void | sync () const =0 |
Synchronize the entire record store to persistent storage. More... | |
virtual void | insert (const std::string &key, const Memory::uint8Array &data) |
Insert a record into the store. More... | |
virtual void | insert (const std::string &key, const void *const data, const uint64_t size)=0 |
Insert a record into the store. More... | |
virtual void | remove (const std::string &key)=0 |
Remove a record from the store. More... | |
virtual Memory::uint8Array | read (const std::string &key) const =0 |
Read a complete record from a store. More... | |
virtual void | replace (const std::string &key, const Memory::uint8Array &data) |
Replace a complete record in a RecordStore. More... | |
virtual void | replace (const std::string &key, const void *const data, const uint64_t size) |
Replace a complete record in a RecordStore. More... | |
virtual uint64_t | length (const std::string &key) const =0 |
Return the length of a record. More... | |
virtual void | flush (const std::string &key) const =0 |
Commit the record's data to storage. More... | |
virtual RecordStore::Record | sequence (int cursor=BE_RECSTORE_SEQ_NEXT)=0 |
Sequence through a RecordStore, returning the key/data pairs. More... | |
virtual std::string | sequenceKey (int cursor=BE_RECSTORE_SEQ_NEXT)=0 |
Sequence through a RecordStore, returning the key. More... | |
virtual void | setCursorAtKey (const std::string &key)=0 |
Set the sequence cursor to an arbitrary position within the RecordStore, starting at key. More... | |
virtual bool | containsKey (const std::string &key) const |
Determines whether the RecordStore contains an element with the specified key. More... | |
virtual iterator | begin () noexcept |
virtual iterator | end () noexcept |
Static Public Member Functions | |
static bool | isRecordStore (const std::string &pathname) |
Determine if a location appears to be a RecordStore. More... | |
static std::shared_ptr< RecordStore > | openRecordStore (const std::string &pathname, IO::Mode mode=Mode::ReadOnly) |
Open an existing RecordStore and return a managed pointer to the the object representing that store. More... | |
static std::shared_ptr< RecordStore > | createRecordStore (const std::string &pathname, const std::string &description, const IO::RecordStore::Kind &kind) |
Create a new RecordStore and return a managed pointer to the the object representing that store. More... | |
static void | removeRecordStore (const std::string &pathname) |
Remove a RecordStore by deleting all persistant data associated with the store. More... | |
static void | mergeRecordStores (const std::string &mergePathname, const std::string &description, const IO::RecordStore::Kind &kind, const std::vector< std::string > &pathnames, const std::function< bool()> &interrupt=[]() {return(false);}) |
Create a new RecordStore that contains the contents of several other RecordStores. More... | |
Static Public Attributes | |
static const std::string | INVALIDKEYCHARS |
The set of prohibited characters in a key: '/', '\', '*', '&'. | |
static const int | BE_RECSTORE_SEQ_START = 1 |
Tell sequence() to sequence from beginning. | |
static const int | BE_RECSTORE_SEQ_NEXT = 2 |
Tell sequence to sequence from current position. | |
A class to represent a data storage mechanism.
A RecordStore is an abstraction that associates keys with a specific data item. Implementations of this abstraction can store the records in any format supported by the operating system, such as files or databases, rooted in the file system.
Certain characters are prohibited in the key string. See IO::RecordStore::INVALIDKEYCHARS. A key string cannot begin with the space character.
|
strong |
Possible types of RecordStore.
Enumerator | |
---|---|
BerkeleyDB | DBRecordStore. |
Archive | ArchiveRecordStore. |
File | FileRecordStore. |
SQLite | SQLiteRecordStore. |
Compressed | CompressedRecordStore. |
List | ListRecordStore. |
Default | "Default" RecordStore kind |
|
virtualnoexcept |
|
pure virtual |
Change the description of the RecordStore.
[in] | description | The new description. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
virtual |
Determines whether the RecordStore contains an element with the specified key.
key | The key to locate. |
|
static |
Create a new RecordStore and return a managed pointer to the the object representing that store.
The allocated object will be automatically freed when the returned pointer goes out of scope. Applications should not delete the object.
[in] | pathname | The directory of the store to be created. |
[in] | description | The description of the store to be created. |
[in] | kind | The kind of RecordStore to be created. |
Error::ObjectDoesNotExist | The RecordStore does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
virtualnoexcept |
|
pure virtual |
Commit the record's data to storage.
[in] | key | The key of the record to be flushed. |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Obtain the number of items in the RecordStore.
|
pure virtual |
Obtain a textual description of the RecordStore.
|
pure virtual |
Return the path name of the RecordStore.
|
pure virtual |
Obtain real storage utilization.
The amount of disk space used, for example. This is the actual space allocated by the underlying storage mechanism, in bytes.
Error::StrategyError | An error occurred when using the underlying storage system. |
|
virtual |
Insert a record into the store.
[in] | key | The key of the record to be inserted. |
[in] | data | The data for the record. |
Error::ObjectExists | A record with the given key is already present. |
Error::StrategyError | The RecordStore is opened read-only, or an error occurred when using the underlying storage system. |
|
pure virtual |
Insert a record into the store.
[in] | key | The key of the record to be inserted. |
[in] | data | The data for the record. |
[in] | size | The size of the record, in bytes. |
Error::ObjectExists | A record with the given key is already present. |
Error::StrategyError | The RecordStore is opened read-only, or an error occurred when using the underlying storage system. |
|
static |
Determine if a location appears to be a RecordStore.
pathname | The path name of the location to check. |
pathname
appears to point to a RecordStore, false otherwise.
|
pure virtual |
Return the length of a record.
[in] | key | The key of the record. |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
static |
Create a new RecordStore that contains the contents of several other RecordStores.
[in] | mergePathname | The path name of the new RecordStore that will be created. |
[in] | description | The text used to describe the new RecordStore. |
[in] | kind | The kind of the new, merged RecordStore. |
[in] | pathnames | Vector of path names to RecordStores to open. These are the RecordStores that will be merged to create the new RecordStore. |
[in] | interrupt | A function to be called during long operations to determine whether to interrupt and return. |
Error::ObjectExists | A RecordStore at mergePathname already exists. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Move the RecordStore.
The RecordStore can be moved to a new path in the file system.
[in] | pathname | The new path of the RecordStore. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
static |
Open an existing RecordStore and return a managed pointer to the the object representing that store.
Applications can open existing record stores without the need to know what type of RecordStore it is.
The allocated object will be automatically freed when the returned pointer goes out of scope. Applications should not delete the object.
[in] | pathname | The path name of the store to be opened. |
[in] | mode | The type of access a client of this RecordStore has. |
Error::ObjectDoesNotExist | The RecordStore does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Read a complete record from a store.
The AutoArray will be resized to match the size of the data.
[in] | key | The key of the record to be read. |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Remove a record from the store.
[in] | key | The key of the record to be removed. |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
static |
Remove a RecordStore by deleting all persistant data associated with the store.
[in] | pathname | The name of the existing RecordStore. |
Error::ObjectDoesNotExist | A record with the given key does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
virtual |
Replace a complete record in a RecordStore.
[in] | key | The key of the record to be replaced. |
[in] | data | The data for the record. |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | The RecordStore is opened read-only, or an error occurred when using the underlying storage system. |
|
virtual |
Replace a complete record in a RecordStore.
[in] | key | The key of the record to be replaced. |
[in] | data | The data for the record. |
[in] | size | The size of the record, in bytes. |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | The RecordStore is opened read-only, or an error occurred when using the underlying storage system. |
|
pure virtual |
Sequence through a RecordStore, returning the key/data pairs.
Sequencing means to start at some point in the store and return the record, then repeatedly calling the function to return the next record. The starting point is typically the first record, and is set to that when the RecordStore object is created. The starting point can be reset by calling this method with the cursor parameter set to BE_RECSTORE_SEQ_START.
[in] | cursor | The location within the sequence of the key/data pair to return. |
Error::ObjectDoesNotExist | End of sequencing. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Sequence through a RecordStore, returning the key.
Sequencing means to start at some point in the store and return the key, then repeatedly calling the function to return the next key. The starting point is typically the first record, and is set to that when the RecordStore object is created. The starting point can be reset by calling this method with the cursor parameter set to BE_RECSTORE_SEQ_START.
[in] | cursor | The location within the sequence of the key/data pair to return. |
Error::ObjectDoesNotExist | End of sequencing. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Set the sequence cursor to an arbitrary position within the RecordStore, starting at key.
Key will be the first record returned from the next call to sequence().
[in] | key | The key of the record which will be returned by the first subsequent call to sequence(). |
Error::ObjectDoesNotExist | A record for the key does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
pure virtual |
Synchronize the entire record store to persistent storage.
Error::StrategyError | An error occurred when using the underlying storage system. |