Public Types | Public Member Functions | Protected Member Functions
warehouse_ros::DatabaseConnection Class Reference

#include <database_connection.h>

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

List of all members.

Public Types

typedef boost::shared_ptr
< DatabaseConnection
Ptr

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.
virtual bool isConnected ()=0
 Returns whether the database is connected.
virtual std::string messageType (const std::string &db_name, const std::string &collection_name)=0
 Return the ROS Message type of a given collection.
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.
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.
virtual bool setParams (const std::string &host, unsigned port, float timeout=60.0)=0
 Set database connection params.
virtual bool setTimeout (float timeout)=0
 Set database connection params.

Protected Member Functions

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

Detailed Description

Definition at line 47 of file database_connection.h.


Member Typedef Documentation

Definition at line 81 of file database_connection.h.


Member Function Documentation

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.

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.

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

Returns whether the database is connected.

Implemented in warehouse_ros::DBConnectionStub.

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.

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 44 of file database_connection_impl.hpp.

virtual MessageCollectionHelper::Ptr warehouse_ros::DatabaseConnection::openCollectionHelper ( const std::string &  db_name,
const std::string &  collection_name 
) [protected, pure virtual]
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 53 of file database_connection_impl.hpp.

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.

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 Thu Jun 23 2016 05:36:41