Fawkes API  Fawkes Development Version
fawkes::MongoDBAspect Class Reference

Thread aspect to access MongoDB. More...

#include <>>

Inheritance diagram for fawkes::MongoDBAspect:

Public Member Functions

 MongoDBAspect (const char *config_prefix=0)
 Constructor. More...
 
virtual ~MongoDBAspect ()
 Virtual empty destructor. More...
 
const char * mongodb_config_name () const
 Get MongoDB configuration name. More...
 
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread. More...
 

Protected Attributes

mongo::DBClientBase * mongodb_client
 MongoDB client to use to interact with the database. More...
 
MongoDBConnCreatormongodb_connmgr
 Connection manager to retrieve more client connections from if necessary. More...
 

Friends

class MongoDBAspectIniFin
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Aspect
void add_aspect (const char *name)
 Add an aspect to a thread. More...
 

Detailed Description

Thread aspect to access MongoDB.

Give this aspect to your thread to gain access to MongoDB. This will setup the mongodb_client member with an active, auto-recovering connection to MongoDB (can be any kind of connection, single server, replicat set, or sync cluster).

Author
Tim Niemueller

Definition at line 40 of file mongodb.h.

Constructor & Destructor Documentation

◆ MongoDBAspect()

fawkes::MongoDBAspect::MongoDBAspect ( const char *  config_name = 0)

Constructor.

Parameters
config_nameoptional configuration name from which the configuration for the database is read from the global configuration.

Definition at line 68 of file mongodb.cpp.

References fawkes::Aspect::add_aspect().

◆ ~MongoDBAspect()

fawkes::MongoDBAspect::~MongoDBAspect ( )
virtual

Virtual empty destructor.

Definition at line 76 of file mongodb.cpp.

References mongodb_client, and mongodb_connmgr.

Member Function Documentation

◆ mongodb_config_name()

const char * fawkes::MongoDBAspect::mongodb_config_name ( ) const
inline

Get MongoDB configuration name.

Returns
MongoDB path name for the configuration settings from the global configuration. Note that this may return 0 if the default configuration should be used.

Definition at line 48 of file mongodb.h.

Referenced by fawkes::MongoDBAspectIniFin::init().

Member Data Documentation

◆ mongodb_client

mongo::DBClientBase * fawkes::MongoDBAspect::mongodb_client
protected

MongoDB client to use to interact with the database.

If database name, user and password were given to constructor, authentication has been executed (and only on success the aspect is considered to be successfully initialized).

Definition at line 51 of file mongodb.h.

Referenced by fawkes::MongoDBAspectIniFin::finalize(), PointCloudDBRetrieveThread::init(), PointCloudDBMergeThread::init(), MongoLogImagesThread::init(), MongoLogPointCloudThread::init(), MongoLogLoggerThread::log_error(), MongoRRDThread::loop(), MongoLogLoggerThread::loop(), MongoLogTransformsThread::loop(), PointCloudDBStoreThread::loop(), MongoLogPointCloudThread::loop(), MongoLogBlackboardThread::run(), and ~MongoDBAspect().

◆ mongodb_connmgr

fawkes::MongoDBConnCreator * fawkes::MongoDBAspect::mongodb_connmgr
protected

Connection manager to retrieve more client connections from if necessary.

Definition at line 52 of file mongodb.h.

Referenced by MongoLogBlackboardThread::bb_interface_created(), MongoLogBlackboardThread::finalize(), MongoLogBlackboardThread::init(), and ~MongoDBAspect().


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