39 lines
659 B
C++
39 lines
659 B
C++
#ifndef INVENTORY_DBSESSION_HH_
|
|
#define INVENTORY_DBSESSION_HH_
|
|
#include <string>
|
|
#include <stdexcept>
|
|
#include <functional>
|
|
#include <zdb.h>
|
|
#include "dbobjectptr.hh"
|
|
#include "dbobjectvec.hh"
|
|
#include "dbcontainer.hh"
|
|
#include "dboperations.hh"
|
|
|
|
namespace inventory {
|
|
namespace db {
|
|
|
|
class DBSession {
|
|
public:
|
|
DBSession() {}
|
|
DBSession(const char *url);
|
|
~DBSession();
|
|
|
|
Connection_T get_connection();
|
|
void return_connection(Connection_T);
|
|
|
|
void reset(const char *url);
|
|
|
|
private:
|
|
void create_connpool();
|
|
void destroy_connpool();
|
|
|
|
std::string m_url;
|
|
ConnectionPool_T m_pool;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#include "dboperations_impl.hh"
|
|
#endif
|