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...
 

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

Definition at line 79 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 43 of file database_connection_impl.hpp.

virtual MessageCollectionHelper::Ptr warehouse_ros::DatabaseConnection::openCollectionHelper ( const std::string &  db_name,
const std::string &  collection_name 
)
protectedpure 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 51 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 Fri Jun 7 2019 21:44:23