Public Types | Public Member Functions | Protected Member Functions | List of all members
warehouse_ros::DatabaseConnection Class Referenceabstract

#include <database_connection.h>

Inheritance diagram for warehouse_ros::DatabaseConnection:
Inheritance graph
[legend]

Public Types

typedef boost::shared_ptr< DatabaseConnectionPtr
 

Public Member Functions

virtual bool connect ()=0
 
virtual void dropDatabase (const std::string &db_name)=0
 Drop a db and all its collections. A DbClientConnection exception will be thrown if the database is not connected. More...
 
virtual bool isConnected ()=0
 Returns whether the database is connected. More...
 
virtual std::string messageType (const std::string &db_name, const std::string &collection_name)=0
 Return the ROS Message type of a given collection. More...
 
template<class M >
MessageCollection< M > openCollection (const std::string &db_name, const std::string &collection_name)
 Open a collection on the DB. The collection is created if it doesn't exist. A DbClientConnection exception will be thrown if the database is not connected. More...
 
template<class M >
MessageCollection< M >::Ptr openCollectionPtr (const std::string &db_name, const std::string &collection_name)
 Open a collection on the DB. The collection is created if it doesn't exist. A DbClientConnection exception will be thrown if the database is not connected. More...
 
virtual bool setParams (const std::string &host, unsigned port, float timeout=60.0)=0
 Set database connection params. More...
 
virtual bool setTimeout (float timeout)=0
 Set database connection params. More...
 
virtual ~DatabaseConnection ()
 

Protected Member Functions

virtual MessageCollectionHelper::Ptr openCollectionHelper (const std::string &db_name, const std::string &collection_name)=0
 

Detailed Description

Definition at line 46 of file database_connection.h.

Member Typedef Documentation

◆ Ptr

Definition at line 83 of file database_connection.h.

Constructor & Destructor Documentation

◆ ~DatabaseConnection()

virtual warehouse_ros::DatabaseConnection::~DatabaseConnection ( )
inlinevirtual

Definition at line 49 of file database_connection.h.

Member Function Documentation

◆ connect()

virtual bool warehouse_ros::DatabaseConnection::connect ( )
pure virtual

Setup the database connection. This call assumes setParams() has been previously called. Returns true if the connection was succesfully established.

Implemented in warehouse_ros::DBConnectionStub.

◆ dropDatabase()

virtual void warehouse_ros::DatabaseConnection::dropDatabase ( const std::string &  db_name)
pure virtual

Drop a db and all its collections. A DbClientConnection exception will be thrown if the database is not connected.

Implemented in warehouse_ros::DBConnectionStub.

◆ isConnected()

virtual bool warehouse_ros::DatabaseConnection::isConnected ( )
pure virtual

Returns whether the database is connected.

Implemented in warehouse_ros::DBConnectionStub.

◆ messageType()

virtual std::string warehouse_ros::DatabaseConnection::messageType ( const std::string &  db_name,
const std::string &  collection_name 
)
pure virtual

Return the ROS Message type of a given collection.

Implemented in warehouse_ros::DBConnectionStub.

◆ openCollection()

template<class M >
MessageCollection< M > warehouse_ros::DatabaseConnection::openCollection ( const std::string &  db_name,
const std::string &  collection_name 
)

Open a collection on the DB. The collection is created if it doesn't exist. A DbClientConnection exception will be thrown if the database is not connected.

Definition at line 43 of file database_connection_impl.hpp.

◆ openCollectionHelper()

virtual MessageCollectionHelper::Ptr warehouse_ros::DatabaseConnection::openCollectionHelper ( const std::string &  db_name,
const std::string &  collection_name 
)
protectedpure virtual

◆ openCollectionPtr()

template<class M >
MessageCollection< M >::Ptr warehouse_ros::DatabaseConnection::openCollectionPtr ( const std::string &  db_name,
const std::string &  collection_name 
)

Open a collection on the DB. The collection is created if it doesn't exist. A DbClientConnection exception will be thrown if the database is not connected.

Definition at line 51 of file database_connection_impl.hpp.

◆ setParams()

virtual bool warehouse_ros::DatabaseConnection::setParams ( const std::string &  host,
unsigned  port,
float  timeout = 60.0 
)
pure virtual

Set database connection params.

Implemented in warehouse_ros::DBConnectionStub.

◆ setTimeout()

virtual bool warehouse_ros::DatabaseConnection::setTimeout ( float  timeout)
pure virtual

Set database connection params.

Implemented in warehouse_ros::DBConnectionStub.


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


warehouse_ros
Author(s): Bhaskara Marthi , Connor Brew
autogenerated on Wed Oct 16 2024 02:42:07