All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HSEPData::DBEnvironment Class Referenceabstract

This is, basically, a database session. More...

#include <DBBase.h>

+ Inheritance diagram for HSEPData::DBEnvironment:
+ Collaboration diagram for HSEPData::DBEnvironment:

Public Member Functions

 DBEnvironment ()
 
virtual ~DBEnvironment ()
 
virtual ErrorCode connect (string &pConnectionStringRef, string &pUserRef, string &pPasswordRef)=0
 Connects to the specified destination using the provided credentials.
 
virtual DBStatementcreateStatementPtr (string &pQueryRef)=0
 Given the specified query name, creates a DBStatement that will be linked to the session.
 
virtual ErrorCode setSchema (string &pNewSchemaRef)=0
 When the database works with "schemas", permits to define the right one to work with.
 
bool synchronizes () const
 Indicates if the session will or not to shynchronize.
 
void addSyncTo (string pSyncTo)
 Indicates where the synchronization will go.
 
string & syncToRef ()
 Returns a reference to the synchronization destination.
 
void addSyncPath (string pSyncPath)
 Indicates where the "for read" synchronization material will be stored.
 
string & syncPathRef ()
 Returns a reference to the path where synchronization material will be stored.
 
void addID (int pNewID)
 Includes a numeric ID (to be used by connection pools).
 
int id ()
 Returns the numeric ID previously stored, or zero if no one was defined.
 
- Public Member Functions inherited from HSEP::HSEPObject
string & lastErrorRef ()
 Returns a reference to the last stored error message.
 
ErrorCode lastCode ()
 Returns the last stored code.
 
bool valid ()
 Permits to know if the object has a valid internal state.
 
string & typeRef ()
 Permits to know the type of this particular object.
 

Protected Attributes

bool aSynchronizes
 
string aSyncTo
 
string aSyncPath
 
int aID
 

Additional Inherited Members

- Protected Member Functions inherited from HSEP::HSEPObject
 HSEPObject (const char *pType)
 Constructor, providing the base for the state controlling instance.
 
virtual ~HSEPObject ()
 
void setLastError (string &pErrorMsgRef)
 Assigns an error message text to the last executed operation.
 
void setLastError (const string &pErrorMsgRef)
 Assigns an error message text to the last executed operation.
 
void setLastError (const char *pErrorMsg)
 Assigns an error message text to the last executed operation.
 
void setValid ()
 Defines that the object has a valid state.
 
void setInvalid ()
 Defines that the object has an invalid state.
 
void setLastCode (const ErrorCode pErrorCode)
 Defines the internal result code for the object.
 

Detailed Description

This is, basically, a database session.

Definition at line 300 of file DBBase.h.

Constructor & Destructor Documentation

HSEPData::DBEnvironment::DBEnvironment ( )
inline

Definition at line 307 of file DBBase.h.

virtual HSEPData::DBEnvironment::~DBEnvironment ( )
inlinevirtual

Definition at line 312 of file DBBase.h.

Member Function Documentation

void HSEPData::DBEnvironment::addID ( int  pNewID)
inline

Includes a numeric ID (to be used by connection pools).

Parameters
pNewID

Definition at line 390 of file DBBase.h.

Referenced by HSEPData::DB::loadInstances().

+ Here is the caller graph for this function:

void HSEPData::DBEnvironment::addSyncPath ( string  pSyncPath)
inline

Indicates where the "for read" synchronization material will be stored.

Parameters
pSyncPath

Definition at line 374 of file DBBase.h.

Referenced by HSEPData::DB::loadInstances().

+ Here is the caller graph for this function:

void HSEPData::DBEnvironment::addSyncTo ( string  pSyncTo)
inline

Indicates where the synchronization will go.

Todo:
To permit more than one synchronization destinations.
Parameters
pSyncTo

Definition at line 356 of file DBBase.h.

Referenced by HSEPData::DB::loadInstances().

+ Here is the caller graph for this function:

virtual ErrorCode HSEPData::DBEnvironment::connect ( string &  pConnectionStringRef,
string &  pUserRef,
string &  pPasswordRef 
)
pure virtual

Connects to the specified destination using the provided credentials.

Todo:
To generalize the connection credential to use other types of data (for example, security certificates).
Parameters
pConnectionStringRefThe connection string
pUserRefThe database user
pPasswordRefThe database password
Returns

Implemented in HSEPDataSqLite::SqLiteEnvironment.

Referenced by HSEPData::DBDrvLib::getEnvironmentPtr().

+ Here is the caller graph for this function:

virtual DBStatement* HSEPData::DBEnvironment::createStatementPtr ( string &  pQueryRef)
pure virtual

Given the specified query name, creates a DBStatement that will be linked to the session.

Parameters
pQueryRef
Returns
The statement
nullptr when no statement was created. Must check the instance error methods in such case.

Implemented in HSEPDataSqLite::SqLiteEnvironment.

int HSEPData::DBEnvironment::id ( )
inline

Returns the numeric ID previously stored, or zero if no one was defined.

Returns

Definition at line 398 of file DBBase.h.

virtual ErrorCode HSEPData::DBEnvironment::setSchema ( string &  pNewSchemaRef)
pure virtual

When the database works with "schemas", permits to define the right one to work with.

Parameters
pNewSchemaRef
Returns

Implemented in HSEPDataSqLite::SqLiteEnvironment.

Referenced by HSEPData::DBDrvLib::getEnvironmentPtr().

+ Here is the caller graph for this function:

bool HSEPData::DBEnvironment::synchronizes ( ) const
inline

Indicates if the session will or not to shynchronize.

Returns

Definition at line 347 of file DBBase.h.

Referenced by HSEPData::QueryRunner::execute().

+ Here is the caller graph for this function:

string& HSEPData::DBEnvironment::syncPathRef ( )
inline

Returns a reference to the path where synchronization material will be stored.

Returns

Definition at line 382 of file DBBase.h.

string& HSEPData::DBEnvironment::syncToRef ( )
inline

Returns a reference to the synchronization destination.

Returns

Definition at line 365 of file DBBase.h.

Referenced by HSEPData::QueryRunner::execute().

+ Here is the caller graph for this function:

Member Data Documentation

int HSEPData::DBEnvironment::aID
protected

Definition at line 305 of file DBBase.h.

bool HSEPData::DBEnvironment::aSynchronizes
protected

Definition at line 302 of file DBBase.h.

string HSEPData::DBEnvironment::aSyncPath
protected

Definition at line 304 of file DBBase.h.

string HSEPData::DBEnvironment::aSyncTo
protected

Definition at line 303 of file DBBase.h.


The documentation for this class was generated from the following file: