Class that wraps the warehouse ROS API. More...
#include <warehouse_client.h>
Public Member Functions | |
std::string | dbName () const |
std::vector< std::string > | listCollections () const |
Get list of collections currently in db. | |
template<class M > | |
Collection< M > | setupCollection (const string &collection, const string &topic, const StringVec &indexed, const StringVec &additional_metadata) |
template<class M > | |
Collection< M > | setupCollection (const string &collection, const StringVec &indexed, const StringVec &additional_metadata) |
template<class M > | |
Collection< M > | setupCollection (const std::string &collection, const StringVec &indexed_fields=StringVec(), const StringVec &additional_metadata_fields=StringVec()) |
template<class M > | |
Collection< M > | setupCollection (const std::string &collection, const std::string &topic, const StringVec &indexed_fields=StringVec(), const StringVec &additional_metadata_fields=StringVec()) |
Connect to a collection in the warehouse. Create the collection if. | |
WarehouseClient (const string &db) | |
Empty constructor. | |
Private Attributes | |
const std::string | db_ |
ros::ServiceClient | list_collections_client_ |
boost::mutex | mutex_ |
ros::NodeHandle | nh_ |
ros::ServiceClient | setup_client_ |
Class that wraps the warehouse ROS API.
Threadsafe. Does it's own spinning and callback queue management, so external code doesn't need to add any additional spinner threads.
Definition at line 64 of file warehouse_client.h.
warehouse::WarehouseClient::WarehouseClient | ( | const string & | db | ) |
Empty constructor.
db | The name of the database in the warehouse that this client will talk to |
Definition at line 51 of file warehouse_client.cpp.
string warehouse::WarehouseClient::dbName | ( | ) | const |
Name | of the db this client talks to |
Definition at line 74 of file warehouse_client.cpp.
vector< string > warehouse::WarehouseClient::listCollections | ( | ) | const |
Get list of collections currently in db.
Definition at line 62 of file warehouse_client.cpp.
Collection<M> warehouse::WarehouseClient::setupCollection | ( | const string & | collection, | |
const string & | topic, | |||
const StringVec & | indexed, | |||
const StringVec & | additional_metadata | |||
) | [inline] |
Definition at line 65 of file warehouse_client_impl.h.
Collection<M> warehouse::WarehouseClient::setupCollection | ( | const string & | collection, | |
const StringVec & | indexed, | |||
const StringVec & | additional_metadata | |||
) | [inline] |
Definition at line 55 of file warehouse_client_impl.h.
Collection<M> warehouse::WarehouseClient::setupCollection | ( | const std::string & | collection, | |
const StringVec & | indexed_fields = StringVec() , |
|||
const StringVec & | additional_metadata_fields = StringVec() | |||
) | [inline] |
it doesn't exist, otherwise, check that the type and indexed fields match.
M | Type of message |
WarehouseClientException | if the service call fails at the ROS level (e.g., the warehouse node doesn't exist) | |
SetupCollectionException | if the service call returns with an error |
Collection<M> warehouse::WarehouseClient::setupCollection | ( | const std::string & | collection, | |
const std::string & | topic, | |||
const StringVec & | indexed_fields = StringVec() , |
|||
const StringVec & | additional_metadata_fields = StringVec() | |||
) | [inline] |
Connect to a collection in the warehouse. Create the collection if.
Connect to a collection in the warehouse. Create the collection if it doesn't exist, otherwise, check that the type and indexed fields match. This version uses an existing ROS topic as the source for new messages.
M | Type of message |
topic | Topic on which collection will listen for new messages |
WarehouseClientException | if the service call fails at the ROS level (e.g., the warehouse node doesn't exist) | |
SetupCollectionException | if the service call returns with an error |
const std::string warehouse::WarehouseClient::db_ [private] |
Definition at line 111 of file warehouse_client.h.
ros::ServiceClient warehouse::WarehouseClient::list_collections_client_ [mutable, private] |
Definition at line 114 of file warehouse_client.h.
boost::mutex warehouse::WarehouseClient::mutex_ [mutable, private] |
Definition at line 110 of file warehouse_client.h.
ros::NodeHandle warehouse::WarehouseClient::nh_ [private] |
Definition at line 112 of file warehouse_client.h.
ros::ServiceClient warehouse::WarehouseClient::setup_client_ [private] |
Definition at line 113 of file warehouse_client.h.