#include <database_connection.h>
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. 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 |
Definition at line 46 of file database_connection.h.
Definition at line 79 of file database_connection.h.
|
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.
|
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.
|
pure virtual |
Returns whether the database is connected.
Implemented in warehouse_ros::DBConnectionStub.
|
pure virtual |
Return the ROS Message type of a given collection.
Implemented in warehouse_ros::DBConnectionStub.
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.
|
protectedpure virtual |
Implemented in warehouse_ros::DBConnectionStub.
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.
|
pure virtual |
Set database connection params.
Implemented in warehouse_ros::DBConnectionStub.
|
pure virtual |
Set database connection params.
Implemented in warehouse_ros::DBConnectionStub.