5#ifndef POOLSVC_USERDATABASE_H
6#define POOLSVC_USERDATABASE_H
33 const std::string& name,
58 virtual Io::IoFlag
openMode()
const override;
61 virtual const std::string&
fid()
override;
64 virtual const std::string&
pfn()
override;
73 virtual std::vector< std::string >
containers()
override;
85 const std::type_info& typeInfo,
86 const std::string& option )
override;
91 const std::type_info& typeInfo,
92 const std::string& option )
override;
This class provides a token that identifies in a unique way objects on the persistent storage.
APRMessaging(const std::string &name)
DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a give...
IContainer is the base class for container objects.
IDatabase is the base class for database objects.
Token * writeObject(const std::string &containerName, long minorTechnology, const void *object, const RootType &type)
Writes an object and returns a token.
virtual const std::string & pfn() override
Returns the physical file name of this database.
UserDatabase(UserSession &session, const std::string &name, const DatabaseSpecification::NameType nameType)
Constructor.
std::string m_the_fid
Other names used.
Io::IoFlag m_transactionType
Transaction type (read/update).
virtual FileDescriptor * fileDescriptor() override final
Expose FileDescriptor object for the technology specific DB implementation.
virtual void disconnect() override
Disconnects from the database.
std::string m_name
The database name.
virtual bool attributeOfType(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option) override
The method returning the attribute data given a name.
virtual void connectForWrite() override
Connects explicitly to the database for write/update operations.
virtual bool setAttributeOfType(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option) override
The method setting the attribute data given a name.
DatabaseRegistry & m_registry
Reference to the database registry.
bool m_alreadyConnected
Flag indicating whether a connection has been already made once.
bool checkInRegistry()
Checks in the registry if the database handler already exists.
virtual std::vector< std::string > containers() override
Returns the names of the containers in this database.
IFileCatalog & m_catalog
Reference to the file catalog.
UserSession & m_session
Reference to the session.
DatabaseSpecification::NameType m_nameType
The database name spacification.
long m_technology
The technology identifier of the database.
virtual Io::IoFlag openMode() const override
Returns the opening mode. It can be used to check whether the database is connected.
virtual IContainer * containerHandle(const std::string &name) override
Returns a pointer to a container object. The user acquires ownership of that object.
void * readObject(const Token &token, void *object=0)
Reads an object given a token.
virtual ~UserDatabase()
Destructor.
virtual bool setTechnology(long technology) override
Sets the technology identifier for this database.
Io::IoFlag m_openMode
Current open mode.
virtual const std::string & fid() override
Returns the file identifier of this database.
bool m_technologySet
Checks if the technology identifier has been set.
virtual void connectForRead() override
Connects explicitly to the database for read operations.
DatabaseHandler * m_databaseHandler
The underlying database handler.
UserSession is an implementation of the ISession interface.
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...