cpsp::HCoreDatabasePGSQL Class Reference
#include <HCoreDatabasePGSQL.hh>
Detailed Description
The HCoreDatabasePGSQL provides an interface to a PostGreSQL database.It handles the access to HCore objects from the database.
Definition at line 35 of file HCoreDatabasePGSQL.hh.
Public Member Functions | |
bool | connect (const std::string &dbAtServer, const std::string &dbName=DEF_DBNAME, const std::string &user=DEF_USERNAME, const std::string &password=DEF_PASSWORD) |
bool | disconnect () |
virtual unsigned int | getActCoreSize () |
virtual unsigned int | getActMaxHHcontacts () |
virtual unsigned int | getActMinHHcontacts () |
virtual bool | getNextCore (HCore &toFill) |
HCoreDatabasePGSQL (const std::string &hostName, const std::string &dbName=DEF_DBNAME, const std::string &user=DEF_USERNAME, const std::string &password=DEF_PASSWORD) | |
HCoreDatabasePGSQL () | |
virtual bool | initCoreAccess (const biu::LatticeDescriptor &latDescr, const unsigned int size, const unsigned int minContacts=0, const unsigned int maxContacts=INT_MAX) |
bool | isConnected () const |
virtual void | setActMinHHcontacts (const unsigned int minContacts) |
virtual | ~HCoreDatabasePGSQL () |
Protected Member Functions | |
void | closeCursor () |
Protected Attributes | |
bool | connected |
unsigned int | coreSize |
bool | cursorOpen |
unsigned int | maxHH |
unsigned int | minHH |
Static Private Attributes | |
static const std::string | DEF_DBNAME = "bitest" |
static const std::string | DEF_PASSWORD = "R00mO14" |
static const std::string | DEF_USERNAME = "mmann" |
Constructor & Destructor Documentation
cpsp::HCoreDatabasePGSQL::HCoreDatabasePGSQL | ( | ) |
Definition at line 40 of file HCoreDatabasePGSQL.cc.
cpsp::HCoreDatabasePGSQL::HCoreDatabasePGSQL | ( | const std::string & | hostName, | |
const std::string & | dbName = DEF_DBNAME , |
|||
const std::string & | user = DEF_USERNAME , |
|||
const std::string & | password = DEF_PASSWORD | |||
) |
Definition at line 45 of file HCoreDatabasePGSQL.cc.
cpsp::HCoreDatabasePGSQL::~HCoreDatabasePGSQL | ( | ) | [virtual] |
Definition at line 54 of file HCoreDatabasePGSQL.cc.
Member Function Documentation
void cpsp::HCoreDatabasePGSQL::closeCursor | ( | ) | [protected] |
bool cpsp::HCoreDatabasePGSQL::connect | ( | const std::string & | dbAtServer, | |
const std::string & | dbName = DEF_DBNAME , |
|||
const std::string & | user = DEF_USERNAME , |
|||
const std::string & | password = DEF_PASSWORD | |||
) |
Opens the connection to the PostGreSQL database server and closes all currently open connections.
Definition at line 60 of file HCoreDatabasePGSQL.cc.
bool cpsp::HCoreDatabasePGSQL::disconnect | ( | ) |
Closes the current connection to a PostGreSQL database server.
Definition at line 119 of file HCoreDatabasePGSQL.cc.
virtual unsigned int cpsp::HCoreDatabasePGSQL::getActCoreSize | ( | ) | [inline, virtual] |
Returns the core size of the HCore objects returned by getNextCore().
Implements cpsp::HCoreDatabase.
Definition at line 74 of file HCoreDatabasePGSQL.hh.
virtual unsigned int cpsp::HCoreDatabasePGSQL::getActMaxHHcontacts | ( | ) | [inline, virtual] |
Returns the maximal number of contacts of the HCore objects returned by getNextCore().
Implements cpsp::HCoreDatabase.
Definition at line 88 of file HCoreDatabasePGSQL.hh.
virtual unsigned int cpsp::HCoreDatabasePGSQL::getActMinHHcontacts | ( | ) | [inline, virtual] |
Returns the minimal number of contacts of the HCore objects returned by getNextCore().
Implements cpsp::HCoreDatabase.
Definition at line 78 of file HCoreDatabasePGSQL.hh.
bool cpsp::HCoreDatabasePGSQL::getNextCore | ( | HCore & | toFill | ) | [virtual] |
Fills succesively all HCore objects in the ranges given by initAccess(...) in descending order according to the number of contacts.
- Returns:
- returns whether or not filling was successfull and if the filled HCore toFill is valid or not.
Implements cpsp::HCoreDatabase.
Definition at line 225 of file HCoreDatabasePGSQL.cc.
bool cpsp::HCoreDatabasePGSQL::initCoreAccess | ( | const biu::LatticeDescriptor & | latDescr, | |
const unsigned int | size, | |||
const unsigned int | minContacts = 0 , |
|||
const unsigned int | maxContacts = INT_MAX | |||
) | [virtual] |
Initializes the database access to control the HCore objects returned by getNextCore()
Implements cpsp::HCoreDatabase.
Definition at line 161 of file HCoreDatabasePGSQL.cc.
bool cpsp::HCoreDatabasePGSQL::isConnected | ( | ) | const [inline, virtual] |
Returns if the connection to a PostGreSQL database server is open or not.
Implements cpsp::HCoreDatabase.
Definition at line 99 of file HCoreDatabasePGSQL.hh.
virtual void cpsp::HCoreDatabasePGSQL::setActMinHHcontacts | ( | const unsigned int | minContacts | ) | [inline, virtual] |
Sets the minimal number of contacts of the HCore objects returned by getNextCore().
Implements cpsp::HCoreDatabase.
Definition at line 82 of file HCoreDatabasePGSQL.hh.
Field Documentation
bool cpsp::HCoreDatabasePGSQL::connected [protected] |
unsigned int cpsp::HCoreDatabasePGSQL::coreSize [protected] |
bool cpsp::HCoreDatabasePGSQL::cursorOpen [protected] |
== true if the the sql-cursor is open and ready to read data
Definition at line 46 of file HCoreDatabasePGSQL.hh.
const std::string cpsp::HCoreDatabasePGSQL::DEF_DBNAME = "bitest" [static, private] |
Definition at line 38 of file HCoreDatabasePGSQL.hh.
const std::string cpsp::HCoreDatabasePGSQL::DEF_PASSWORD = "R00mO14" [static, private] |
Definition at line 38 of file HCoreDatabasePGSQL.hh.
const std::string cpsp::HCoreDatabasePGSQL::DEF_USERNAME = "mmann" [static, private] |
Definition at line 38 of file HCoreDatabasePGSQL.hh.
unsigned int cpsp::HCoreDatabasePGSQL::maxHH [protected] |
unsigned int cpsp::HCoreDatabasePGSQL::minHH [protected] |
Definition at line 43 of file HCoreDatabasePGSQL.hh.
The documentation for this class was generated from the following files:
- src/cpsp/HCoreDatabasePGSQL.hh
- src/cpsp/HCoreDatabasePGSQL.cc