Class DatabaseConnection

Inheritance Relationships

Base Type

  • public warehouse_ros::DatabaseConnection

Class Documentation

class DatabaseConnection : public warehouse_ros::DatabaseConnection

Public Functions

DatabaseConnection() = default
inline explicit DatabaseConnection(sqlite3_ptr db)
inline bool setParams(const std::string &host, unsigned, float = 60.0) override

Set database connection params.

inline bool setTimeout(float) override

Set database connection params.

bool connect() override

Setup the database connection. This call assumes setParams() has been previously called. Returns true if the connection was succesfully established.

bool isConnected() override

Returns whether the database is connected.

void dropDatabase(const std::string &db_name) override

Drop a db and all its collections. A DbClientConnection exception will be thrown if the database is not connected.

std::string messageType(const std::string &db_name, const std::string &collection_name) override

Return the ROS Message type of a given collection.

Public Static Attributes

static const int BUSY_WAIT_MILLISECS = 20
static const int BUSY_MAX_RETRIES = 10

Protected Functions

warehouse_ros::MessageCollectionHelper::Ptr openCollectionHelper(const std::string &db_name, const std::string &collection_name) override
void initDb()
std::vector<std::string> getTablesOfDatabase(const std::string &db_name)
bool schemaVersionSet()