|
QDP++
|
A wrapper over maps. More...
#include <qdp_map_obj_disk.h>
Public Types | |
| typedef std::iostream::pos_type | pos_type |
| typedef std::iostream::off_type | off_type |
Public Member Functions | |
| MapObjectDisk () | |
| Empty constructor. | |
| ~MapObjectDisk () | |
| Finalizes object. | |
| void | setDebug (int level) |
| Set debugging level. | |
| int | getDebug () const |
| Get debugging level. | |
| void | open (const std::string &file, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
| Open a file. | |
| bool | fileExists (const std::string &file) const |
| Check if a DB file exists before opening. | |
| void | close () |
| Close the file. | |
| int | insert (const K &key, const V &val) |
| int | get (const K &key, V &val) const |
| void | flush () |
| Destructor. | |
| bool | exist (const K &key) const |
| unsigned int | size () const |
| void | keys (std::vector< K > &keys_) const |
| Dump keys. | |
| int | insertUserdata (const std::string &user_data) |
| int | getUserdata (std::string &user_data) const |
| Public Member Functions inherited from QDP::MapObject< K, V > | |
| virtual | ~MapObject () |
| Virtual Destructor. | |
A wrapper over maps.
Definition at line 36 of file qdp_map_obj_disk.h.
| typedef std::iostream::off_type QDP::MapObjectDisk< K, V >::off_type |
Definition at line 123 of file qdp_map_obj_disk.h.
| typedef std::iostream::pos_type QDP::MapObjectDisk< K, V >::pos_type |
Definition at line 122 of file qdp_map_obj_disk.h.
|
inline |
Empty constructor.
Definition at line 40 of file qdp_map_obj_disk.h.
| QDP::MapObjectDisk< K, V >::~MapObjectDisk | ( | ) |
Finalizes object.
Destructor.
Definition at line 431 of file qdp_map_obj_disk.h.
References QDP::close().
| void QDP::MapObjectDisk< K, V >::close | ( | ) |
|
virtual |
Does this key exist in the store
| key | a key object |
Implements QDP::MapObject< K, V >.
Definition at line 733 of file qdp_map_obj_disk.h.
References QDP::BinaryBufferWriter::str(), and QDP::write().
|
inline |
Check if a DB file exists before opening.
Definition at line 55 of file qdp_map_obj_disk.h.
References QDP::MapObjDiskEnv::checkForNewFile().
|
virtual |
Destructor.
Flush database in memory to disk
Implements QDP::MapObject< K, V >.
Definition at line 440 of file qdp_map_obj_disk.h.
|
virtual |
Get data for a given key
| key | user supplied key |
| data | after the call data will be populated |
Lookup an item in the map.
Implements QDP::MapObject< K, V >.
Definition at line 642 of file qdp_map_obj_disk.h.
References QDP::QDPIO::cout, QDP::StopWatch::getTimeInSeconds(), QDP::QDP_abort(), QDP::read(), QDP::StopWatch::reset(), QDP::StopWatch::start(), QDP::StopWatch::stop(), QDP::BinaryBufferWriter::str(), and QDP::write().
|
inline |
Get debugging level.
Definition at line 49 of file qdp_map_obj_disk.h.
|
virtual |
Get user user data from the metadata database
| user_data | user supplied buffer to store user data |
Implements QDP::MapObject< K, V >.
Definition at line 513 of file qdp_map_obj_disk.h.
|
virtual |
Insert a pair of data and key into the database
| key | a key |
| val | a user provided data |
Insert a value into the Map.
Implements QDP::MapObject< K, V >.
Definition at line 543 of file qdp_map_obj_disk.h.
References QDP::QDPIO::cout, QDP::StopWatch::getTimeInSeconds(), QDP::StopWatch::reset(), QDP::StopWatch::start(), QDP::StopWatch::stop(), QDP::BinaryBufferWriter::str(), and QDP::write().
|
virtual |
Insert user data into the metadata database
| user_data | user supplied data |
Insert user data into the metadata database
Implements QDP::MapObject< K, V >.
Definition at line 483 of file qdp_map_obj_disk.h.
|
virtual |
Dump keys.
Return all available keys to user
| keys | user suppled an empty vector which is populated by keys after this call. |
Implements QDP::MapObject< K, V >.
Definition at line 460 of file qdp_map_obj_disk.h.
References QDP::read().
| void QDP::MapObjectDisk< K, V >::open | ( | const std::string & | file, |
| std::ios_base::openmode | mode = std::ios_base::in | std::ios_base::out ) |
Open a file.
Definition at line 237 of file qdp_map_obj_disk.h.
References QDP::MapObjDiskEnv::checkForNewFile().
| void QDP::MapObjectDisk< K, V >::setDebug | ( | int | level | ) |
Set debugging level.
Definition at line 202 of file qdp_map_obj_disk.h.
|
inlinevirtual |
The number of elements
Implements QDP::MapObject< K, V >.
Definition at line 96 of file qdp_map_obj_disk.h.