22 const std::string&
fid,
23 const std::string&
pfn,
24 Io::IoFlag accessmode ):
31 throw std::runtime_error(
"Could not connect to the database (APR: \" DatabaseHandler::DatabaseHandler \" from \" PersistencySvc \")" );
37 Io::IoFlag mode = Io::INVALID;
65std::vector< std::string >
68 std::vector< std::string > result;
69 std::vector<const Token*> containerTokens;
71 if( !dbH.
containers(containerTokens,
false).isSuccess() ) {
73 log << MSG::ERROR <<
"Could not retrieve the list of containers." <<
endmsg;
75 for ( std::vector<const Token*>::const_iterator iToken = containerTokens.begin();
76 iToken != containerTokens.end(); ++iToken ) {
87 std::vector< std::string > allContainers = this->
containers();
88 for ( std::vector< std::string >::const_iterator iName = allContainers.begin();
89 iName != allContainers.end(); ++iName ) {
90 if ( *iName == containerName ) {
130 long minorTechnology,
135 if ( !
object )
return token;
149 token ).isSuccess() ) {
160 void* result(
object );
178 const std::type_info& typeInfo,
179 const std::string& option )
183 if( !dbH.
getOption(databaseOption).isSuccess() )
return false;
184 return databaseOption.
i_getValue(typeInfo, data).isSuccess();
191 const std::type_info& typeInfo,
192 const std::string& option )
195 if( !databaseOption.
i_setValue( typeInfo,
const_cast<void*
>( data ) ).isSuccess() )
return false;
197 return dbH.
setOption(databaseOption).isSuccess();
This file contains the class definition for the Token class (migrated from POOL).
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
This class provides a token that identifies in a unique way objects on the persistent storage.
const Guid & classID() const
Access database identifier.
Token & setClassID(const Guid &cl_id)
Access database identifier.
Container is an implementation of the IContainer interface.
Token * writeObject(const std::string &containerName, long minorTechnology, const void *object, const RootType &type)
Writes an object and returns a token.
FileDescriptor m_fileDescriptor
File descriptor for this database.
bool commitAndHoldTransaction()
Commits and holds the transaction.
void * readObject(const Token &token, void *object=0)
Reads an object given a token.
std::vector< std::string > containers()
Gives the list of containers.
bool attribute(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option)
Returns an attribute.
bool disconnectTransaction()
Disconnects the transaction.
long m_technology
Technology identifier.
bool commitTransaction()
Commits the transaction.
const std::string & pfn() const
Returns the physical file name.
Io::IoFlag accessMode() const
Returns the access mode.
long technology() const
Returns the technology identifier.
~DatabaseHandler()
Destructor. Disconnects from the database.
Io::IoFlag m_accessMode
Current access mode.
IContainer * container(const std::string &containerName)
Returns a container handle.
bool setAttribute(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option)
Sets an attrtibute.
DatabaseHandler(IStorageSvc &storageSvc, long technology, const std::string &fid, const std::string &pfn, Io::IoFlag accessmode)
Constructor. Connects to the database.
const std::string & fid() const
Returns the file identifier.
IStorageSvc & m_storageSvc
IStorageSvc reference.
Description: Handle managing a DbDatabaseObj, a generic Database object.
StatusCode getOption(DbOption &refOpt)
Access options.
StatusCode containers(std::vector< const Token * > &conts, bool intern=false)
Allow access to all known containers.
StatusCode setOption(const DbOption &refOpt)
Set options.
Description: Definition an option to be supplied to database objects.
StatusCode i_setValue(const std::type_info &typ, const void *value)
Set the option value.
StatusCode i_getValue(const std::type_info &typ, void *value) const
Read the option value.
static Guid guid(const RootType &id)
Determine Guid (normalized string form) from reflection type.
IContainer is the base class for container objects.
The IStorageSvc interface is able to handle user request for.
const Guid & shapeID() const
Access database identifier.