This class provides the mechanism to connect to a MongoDB and reads needed ROS parameters when appropriate. More...
#include <moveit_message_storage.h>
Public Member Functions | |
const std::string & | getDatabaseHost () const |
unsigned int | getDatabasePort () const |
MoveItMessageStorage (const std::string &host="", const unsigned int port=0, double wait_seconds=5.0) | |
Initialize the storage to connect to a specified host and port for the MongoDB. If defaults are used for the parameters (empty host name, 0 port), the constructor looks for ROS params specifying which host/port to use. NodeHandle::searchParam() is used starting from ~ to look for warehouse_port and warehouse_host. If these params are not found either, a final attempt is made to look for the param values under /moveit_warehouse/warehouse_*. If no values are found, the defaults are left to be the ones MongoDB uses. If wait_seconds is above 0, then a maximum number of seconds can elapse until connection is successful, or a runtime exception is thrown. | |
virtual | ~MoveItMessageStorage () |
Protected Member Functions | |
void | drop (const std::string &db) |
void | filterNames (const std::string ®ex, std::vector< std::string > &names) const |
Keep only the names that match regex. | |
Protected Attributes | |
std::string | db_host_ |
unsigned int | db_port_ |
double | timeout_ |
This class provides the mechanism to connect to a MongoDB and reads needed ROS parameters when appropriate.
Definition at line 48 of file moveit_message_storage.h.
moveit_warehouse::MoveItMessageStorage::MoveItMessageStorage | ( | const std::string & | host = "" , |
const unsigned int | port = 0 , |
||
double | wait_seconds = 5.0 |
||
) |
Initialize the storage to connect to a specified host and port for the MongoDB. If defaults are used for the parameters (empty host name, 0 port), the constructor looks for ROS params specifying which host/port to use. NodeHandle::searchParam() is used starting from ~ to look for warehouse_port and warehouse_host. If these params are not found either, a final attempt is made to look for the param values under /moveit_warehouse/warehouse_*. If no values are found, the defaults are left to be the ones MongoDB uses. If wait_seconds is above 0, then a maximum number of seconds can elapse until connection is successful, or a runtime exception is thrown.
Definition at line 41 of file moveit_message_storage.cpp.
Definition at line 72 of file moveit_message_storage.cpp.
void moveit_warehouse::MoveItMessageStorage::drop | ( | const std::string & | db | ) | [protected] |
Definition at line 76 of file moveit_message_storage.cpp.
void moveit_warehouse::MoveItMessageStorage::filterNames | ( | const std::string & | regex, |
std::vector< std::string > & | names | ||
) | const [protected] |
Keep only the names that match regex.
Definition at line 82 of file moveit_message_storage.cpp.
const std::string& moveit_warehouse::MoveItMessageStorage::getDatabaseHost | ( | ) | const [inline] |
Definition at line 61 of file moveit_message_storage.h.
unsigned int moveit_warehouse::MoveItMessageStorage::getDatabasePort | ( | ) | const [inline] |
Definition at line 66 of file moveit_message_storage.h.
std::string moveit_warehouse::MoveItMessageStorage::db_host_ [protected] |
Definition at line 78 of file moveit_message_storage.h.
unsigned int moveit_warehouse::MoveItMessageStorage::db_port_ [protected] |
Definition at line 79 of file moveit_message_storage.h.
double moveit_warehouse::MoveItMessageStorage::timeout_ [protected] |
Definition at line 80 of file moveit_message_storage.h.