Regina Calculation Engine
|
Stores the location and description of one of Regina's in-built census databases. More...
#include <census/ncensus.h>
Public Member Functions | |
NCensusDB (const std::string &filename, const std::string &desc) | |
Creates a new reference to one of Regina's census databases. More... | |
const std::string & | filename () const |
Returns the filename where this database is stored. More... | |
const std::string & | desc () const |
Returns a human-readable description of this database. More... | |
bool | lookup (const std::string &isoSig, NCensusHits *hits) const |
Searches for the given isomorphism signature in this database. More... | |
Stores the location and description of one of Regina's in-built census databases.
A census database stores a list of key-value pairs. The keys are isomorphism signatures of triangulations (as returned by NTriangulation::isoSig(), for instance), and the values are human-readable names (typically the names of the triangulations and/or the names of the underlying manifolds). An isomorphism signature may appear multiple times (with different names) within the same database.
The format used to store census databases is an internal implementation detail that may change in future releases of Regina. End users should only search census databases using high-level routines such as NCensus::lookup() and NCensusDB::lookup().
|
inline |
Creates a new reference to one of Regina's census databases.
This constructor will not run any checks (e.g., it will not verify that the database exists, or that it is stored in the correct format). Note that even if the database does not exist, the lookup() routine will fail gracefully.
filename | the filename where the database is stored. |
desc | a human-readable description of the database. See the desc() routine for further information on how this description might be used. |
|
inline |
Returns a human-readable description of this database.
The description could (for instance) be shown to users when giving a list of all available databases, or when identifying in which particular database a match was found.
|
inline |
Returns the filename where this database is stored.
bool regina::NCensusDB::lookup | ( | const std::string & | isoSig, |
NCensusHits * | hits | ||
) | const |
Searches for the given isomorphism signature in this database.
All matches (if any) will be appended to the given list of hits.
Note that the database will be opened and closed every time this routine is called.
isoSig | the isomorphism signature to search for. |
hits | the list of hits to which all matches will be appended. |
true
if the lookup was correctly performed, or false
if some error occurred (e.g., the database could not be opened). Note in particular that if there were no matches but no errors, then the return value will be true
.