Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
rtabmap::DBDriver Class Reference

#include <DBDriver.h>

Inheritance diagram for rtabmap::DBDriver:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void addLink (const Link &link)
void addStatisticsAfterRun (int stMemSize, int lastSignAdded, int processMemUsed, int databaseMemUsed, int dictionarySize, const ParametersMap &parameters) const
void asyncSave (Signature *s)
void asyncSave (VisualWord *vw)
void beginTransaction () const
void closeConnection (bool save=true)
void commit () const
void emptyTrashes (bool async=false)
void executeNoResult (const std::string &sql) const
void generateGraph (const std::string &fileName, const std::set< int > &ids=std::set< int >(), const std::map< int, Signature * > &otherSignatures=std::map< int, Signature * >())
void getAllLabels (std::map< int, std::string > &labels) const
void getAllLinks (std::multimap< int, Link > &links, bool ignoreNullLinks=true) const
void getAllNodeIds (std::set< int > &ids, bool ignoreChildren=false, bool ignoreBadSignatures=false) const
bool getCalibration (int signatureId, std::vector< CameraModel > &models, StereoCameraModel &stereoModel) const
std::string getDatabaseVersion () const
long getDepthImagesMemoryUsed () const
double getEmptyTrashesTime () const
long getImagesMemoryUsed () const
void getInvertedIndexNi (int signatureId, int &ni) const
long getLaserScansMemoryUsed () const
int getLastDictionarySize () const
void getLastNodeId (int &id) const
int getLastNodesSize () const
ParametersMap getLastParameters () const
void getLastWordId (int &id) const
long getMemoryUsed () const
void getNodeData (int signatureId, SensorData &data) const
void getNodeIdByLabel (const std::string &label, int &id) const
bool getNodeInfo (int signatureId, Transform &pose, int &mapId, int &weight, std::string &label, double &stamp, Transform &groundTruthPose) const
int getTotalDictionarySize () const
int getTotalNodesSize () const
const std::string & getUrl () const
long getUserDataMemoryUsed () const
void getWeight (int signatureId, int &weight) const
long getWordsMemoryUsed () const
bool isConnected () const
void load (VWDictionary *dictionary) const
void loadLastNodes (std::list< Signature * > &signatures) const
void loadLinks (int signatureId, std::map< int, Link > &links, Link::Type type=Link::kUndef) const
void loadNodeData (std::list< Signature * > &signatures) const
void loadSignatures (const std::list< int > &ids, std::list< Signature * > &signatures, std::set< int > *loadedFromTrash=0)
void loadWords (const std::set< int > &wordIds, std::list< VisualWord * > &vws)
bool openConnection (const std::string &url, bool overwritten=false)
virtual void parseParameters (const ParametersMap &parameters)
void removeLink (int from, int to)
void setTimestampUpdateEnabled (bool enabled)
void updateLink (const Link &link)
virtual ~DBDriver ()

Static Public Member Functions

static DBDrivercreate (const ParametersMap &parameters=ParametersMap())

Protected Member Functions

 DBDriver (const ParametersMap &parameters=ParametersMap())

Private Member Functions

virtual void addLinkQuery (const Link &link) const =0
virtual bool connectDatabaseQuery (const std::string &url, bool overwritten=false)=0
virtual void disconnectDatabaseQuery (bool save=true)=0
virtual void executeNoResultQuery (const std::string &sql) const =0
virtual void getAllLabelsQuery (std::map< int, std::string > &labels) const =0
virtual void getAllLinksQuery (std::multimap< int, Link > &links, bool ignoreNullLinks) const =0
virtual void getAllNodeIdsQuery (std::set< int > &ids, bool ignoreChildren, bool ignoreBadSignatures) const =0
virtual bool getCalibrationQuery (int signatureId, std::vector< CameraModel > &models, StereoCameraModel &stereoModel) const =0
virtual bool getDatabaseVersionQuery (std::string &version) const =0
virtual long getDepthImagesMemoryUsedQuery () const =0
virtual long getImagesMemoryUsedQuery () const =0
virtual void getInvertedIndexNiQuery (int signatureId, int &ni) const =0
virtual long getLaserScansMemoryUsedQuery () const =0
virtual int getLastDictionarySizeQuery () const =0
virtual void getLastIdQuery (const std::string &tableName, int &id) const =0
virtual int getLastNodesSizeQuery () const =0
virtual ParametersMap getLastParametersQuery () const =0
virtual long getMemoryUsedQuery () const =0
virtual void getNodeIdByLabelQuery (const std::string &label, int &id) const =0
virtual bool getNodeInfoQuery (int signatureId, Transform &pose, int &mapId, int &weight, std::string &label, double &stamp, Transform &groundTruthPose) const =0
virtual int getTotalDictionarySizeQuery () const =0
virtual int getTotalNodesSizeQuery () const =0
virtual long getUserDataMemoryUsedQuery () const =0
virtual void getWeightQuery (int signatureId, int &weight) const =0
virtual long getWordsMemoryUsedQuery () const =0
virtual bool isConnectedQuery () const =0
virtual void loadLastNodesQuery (std::list< Signature * > &signatures) const =0
virtual void loadLinksQuery (int signatureId, std::map< int, Link > &links, Link::Type type=Link::kUndef) const =0
virtual void loadNodeDataQuery (std::list< Signature * > &signatures) const =0
virtual void loadQuery (VWDictionary *dictionary) const =0
virtual void loadSignaturesQuery (const std::list< int > &ids, std::list< Signature * > &signatures) const =0
virtual void loadWordsQuery (const std::set< int > &wordIds, std::list< VisualWord * > &vws) const =0
virtual void mainLoop ()
void saveOrUpdate (const std::vector< Signature * > &signatures) const
void saveOrUpdate (const std::vector< VisualWord * > &words) const
virtual void saveQuery (const std::list< Signature * > &signatures) const =0
virtual void saveQuery (const std::list< VisualWord * > &words) const =0
virtual void updateLinkQuery (const Link &link) const =0
virtual void updateQuery (const std::list< Signature * > &signatures, bool updateTimestamp) const =0
virtual void updateQuery (const std::list< VisualWord * > &words, bool updateTimestamp) const =0

Private Attributes

USemaphore _addSem
UMutex _dbSafeAccessMutex
double _emptyTrashesTime
bool _timestampUpdate
UMutex _transactionMutex
UMutex _trashesMutex
std::map< int, Signature * > _trashSignatures
std::map< int, VisualWord * > _trashVisualWords
std::string _url

Detailed Description

Definition at line 61 of file DBDriver.h.


Constructor & Destructor Documentation

Definition at line 54 of file DBDriver.cpp.

rtabmap::DBDriver::DBDriver ( const ParametersMap parameters = ParametersMap()) [protected]

Definition at line 47 of file DBDriver.cpp.


Member Function Documentation

void rtabmap::DBDriver::addLink ( const Link link)

Definition at line 392 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::addLinkQuery ( const Link link) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::addStatisticsAfterRun ( int  stMemSize,
int  lastSignAdded,
int  processMemUsed,
int  databaseMemUsed,
int  dictionarySize,
const ParametersMap parameters 
) const

Definition at line 845 of file DBDriver.cpp.

Definition at line 307 of file DBDriver.cpp.

Definition at line 320 of file DBDriver.cpp.

Definition at line 215 of file DBDriver.cpp.

Definition at line 64 of file DBDriver.cpp.

void rtabmap::DBDriver::commit ( ) const

Definition at line 222 of file DBDriver.cpp.

virtual bool rtabmap::DBDriver::connectDatabaseQuery ( const std::string &  url,
bool  overwritten = false 
) [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

DBDriver * rtabmap::DBDriver::create ( const ParametersMap parameters = ParametersMap()) [static]

Definition at line 41 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::disconnectDatabaseQuery ( bool  save = true) [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::emptyTrashes ( bool  async = false)

Definition at line 236 of file DBDriver.cpp.

void rtabmap::DBDriver::executeNoResult ( const std::string &  sql) const

Definition at line 229 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::executeNoResultQuery ( const std::string &  sql) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::generateGraph ( const std::string &  fileName,
const std::set< int > &  ids = std::set<int>(),
const std::map< int, Signature * > &  otherSignatures = std::map<int, Signature *>() 
)

Definition at line 882 of file DBDriver.cpp.

void rtabmap::DBDriver::getAllLabels ( std::map< int, std::string > &  labels) const

Definition at line 826 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::getAllLabelsQuery ( std::map< int, std::string > &  labels) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getAllLinks ( std::multimap< int, Link > &  links,
bool  ignoreNullLinks = true 
) const

Definition at line 714 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::getAllLinksQuery ( std::multimap< int, Link > &  links,
bool  ignoreNullLinks 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getAllNodeIds ( std::set< int > &  ids,
bool  ignoreChildren = false,
bool  ignoreBadSignatures = false 
) const

Definition at line 675 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::getAllNodeIdsQuery ( std::set< int > &  ids,
bool  ignoreChildren,
bool  ignoreBadSignatures 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

bool rtabmap::DBDriver::getCalibration ( int  signatureId,
std::vector< CameraModel > &  models,
StereoCameraModel stereoModel 
) const

Definition at line 567 of file DBDriver.cpp.

virtual bool rtabmap::DBDriver::getCalibrationQuery ( int  signatureId,
std::vector< CameraModel > &  models,
StereoCameraModel stereoModel 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 200 of file DBDriver.cpp.

virtual bool rtabmap::DBDriver::getDatabaseVersionQuery ( std::string &  version) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 127 of file DBDriver.cpp.

virtual long rtabmap::DBDriver::getDepthImagesMemoryUsedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

double rtabmap::DBDriver::getEmptyTrashesTime ( ) const [inline]

Definition at line 78 of file DBDriver.h.

Definition at line 119 of file DBDriver.cpp.

virtual long rtabmap::DBDriver::getImagesMemoryUsedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getInvertedIndexNi ( int  signatureId,
int &  ni 
) const

Definition at line 771 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::getInvertedIndexNiQuery ( int  signatureId,
int &  ni 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 135 of file DBDriver.cpp.

virtual long rtabmap::DBDriver::getLaserScansMemoryUsedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 167 of file DBDriver.cpp.

virtual int rtabmap::DBDriver::getLastDictionarySizeQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

virtual void rtabmap::DBDriver::getLastIdQuery ( const std::string &  tableName,
int &  id 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getLastNodeId ( int &  id) const

Definition at line 741 of file DBDriver.cpp.

Definition at line 159 of file DBDriver.cpp.

virtual int rtabmap::DBDriver::getLastNodesSizeQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 191 of file DBDriver.cpp.

virtual ParametersMap rtabmap::DBDriver::getLastParametersQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getLastWordId ( int &  id) const

Definition at line 756 of file DBDriver.cpp.

Definition at line 110 of file DBDriver.cpp.

virtual long rtabmap::DBDriver::getMemoryUsedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getNodeData ( int  signatureId,
SensorData data 
) const

Definition at line 537 of file DBDriver.cpp.

void rtabmap::DBDriver::getNodeIdByLabel ( const std::string &  label,
int &  id 
) const

Definition at line 791 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::getNodeIdByLabelQuery ( const std::string &  label,
int &  id 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

bool rtabmap::DBDriver::getNodeInfo ( int  signatureId,
Transform pose,
int &  mapId,
int &  weight,
std::string &  label,
double &  stamp,
Transform groundTruthPose 
) const

Definition at line 592 of file DBDriver.cpp.

virtual bool rtabmap::DBDriver::getNodeInfoQuery ( int  signatureId,
Transform pose,
int &  mapId,
int &  weight,
std::string &  label,
double &  stamp,
Transform groundTruthPose 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 183 of file DBDriver.cpp.

virtual int rtabmap::DBDriver::getTotalDictionarySizeQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 175 of file DBDriver.cpp.

virtual int rtabmap::DBDriver::getTotalNodesSizeQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

const std::string& rtabmap::DBDriver::getUrl ( ) const [inline]

Definition at line 70 of file DBDriver.h.

Definition at line 143 of file DBDriver.cpp.

virtual long rtabmap::DBDriver::getUserDataMemoryUsedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::getWeight ( int  signatureId,
int &  weight 
) const

Definition at line 655 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::getWeightQuery ( int  signatureId,
int &  weight 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 151 of file DBDriver.cpp.

virtual long rtabmap::DBDriver::getWordsMemoryUsedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

Definition at line 100 of file DBDriver.cpp.

virtual bool rtabmap::DBDriver::isConnectedQuery ( ) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::load ( VWDictionary dictionary) const

Definition at line 409 of file DBDriver.cpp.

void rtabmap::DBDriver::loadLastNodes ( std::list< Signature * > &  signatures) const

Definition at line 416 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::loadLastNodesQuery ( std::list< Signature * > &  signatures) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::loadLinks ( int  signatureId,
std::map< int, Link > &  links,
Link::Type  type = Link::kUndef 
) const

Definition at line 625 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::loadLinksQuery ( int  signatureId,
std::map< int, Link > &  links,
Link::Type  type = Link::kUndef 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::loadNodeData ( std::list< Signature * > &  signatures) const

Definition at line 517 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::loadNodeDataQuery ( std::list< Signature * > &  signatures) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

virtual void rtabmap::DBDriver::loadQuery ( VWDictionary dictionary) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::loadSignatures ( const std::list< int > &  ids,
std::list< Signature * > &  signatures,
std::set< int > *  loadedFromTrash = 0 
)

Definition at line 423 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::loadSignaturesQuery ( const std::list< int > &  ids,
std::list< Signature * > &  signatures 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::loadWords ( const std::set< int > &  wordIds,
std::list< VisualWord * > &  vws 
)

Definition at line 476 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::loadWordsQuery ( const std::set< int > &  wordIds,
std::list< VisualWord * > &  vws 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::mainLoop ( ) [private, virtual]

Pure virtual method mainLoop(). The inner loop of the thread. This method is called repetitively until the thread is killed. Note that if kill() is called in mainLoopBegin(), mainLoop() is not called, terminating immediately the thread.

See also:
mainLoop()
kill()

Implements UThread.

Definition at line 209 of file DBDriver.cpp.

bool rtabmap::DBDriver::openConnection ( const std::string &  url,
bool  overwritten = false 
)

Definition at line 86 of file DBDriver.cpp.

void rtabmap::DBDriver::parseParameters ( const ParametersMap parameters) [virtual]

Reimplemented in rtabmap::DBDriverSqlite3.

Definition at line 60 of file DBDriver.cpp.

void rtabmap::DBDriver::removeLink ( int  from,
int  to 
)

Definition at line 398 of file DBDriver.cpp.

void rtabmap::DBDriver::saveOrUpdate ( const std::vector< Signature * > &  signatures) const [private]

Definition at line 332 of file DBDriver.cpp.

void rtabmap::DBDriver::saveOrUpdate ( const std::vector< VisualWord * > &  words) const [private]

Definition at line 362 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::saveQuery ( const std::list< Signature * > &  signatures) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

virtual void rtabmap::DBDriver::saveQuery ( const std::list< VisualWord * > &  words) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

void rtabmap::DBDriver::setTimestampUpdateEnabled ( bool  enabled) [inline]

Definition at line 79 of file DBDriver.h.

void rtabmap::DBDriver::updateLink ( const Link link)

Definition at line 402 of file DBDriver.cpp.

virtual void rtabmap::DBDriver::updateLinkQuery ( const Link link) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

virtual void rtabmap::DBDriver::updateQuery ( const std::list< Signature * > &  signatures,
bool  updateTimestamp 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.

virtual void rtabmap::DBDriver::updateQuery ( const std::list< VisualWord * > &  words,
bool  updateTimestamp 
) const [private, pure virtual]

Implemented in rtabmap::DBDriverSqlite3.


Member Data Documentation

Definition at line 198 of file DBDriver.h.

Definition at line 197 of file DBDriver.h.

Definition at line 199 of file DBDriver.h.

Definition at line 201 of file DBDriver.h.

Definition at line 193 of file DBDriver.h.

Definition at line 196 of file DBDriver.h.

std::map<int, Signature *> rtabmap::DBDriver::_trashSignatures [private]

Definition at line 194 of file DBDriver.h.

Definition at line 195 of file DBDriver.h.

std::string rtabmap::DBDriver::_url [private]

Definition at line 200 of file DBDriver.h.


The documentation for this class was generated from the following files:


rtabmap
Author(s): Mathieu Labbe
autogenerated on Sat Jul 23 2016 11:44:32