ATLAS Offline Software
Loading...
Searching...
No Matches
ISession.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INCLUDE_PERSISTENCYSVC_ISESSION_H
6#define INCLUDE_PERSISTENCYSVC_ISESSION_H
7
10
12
13#include <string>
14#include <memory>
15
16class Placement;
17class Token;
18
19namespace pool {
20
21 // forward declarations
24 class IFileCatalog;
25
26 namespace PersistencySvc {
27
29 class ISession;
30 std::unique_ptr<ISession> createSession( IFileCatalog& catalog );
31
39
40 class ISession : public ITransaction {
41 public:
43 virtual void setDefaultConnectionPolicy( const DatabaseConnectionPolicy& policy ) = 0;
44
47
50 virtual bool disconnectAll() = 0;
51
53 virtual ITransaction& transaction() = 0;
54 virtual const ITransaction& transaction() const = 0;
55
57 virtual std::unique_ptr<IDatabase> databaseHandle( const std::string& dbName,
58 DatabaseSpecification::NameType dbNameType ) = 0;
59
71 virtual void* readObject( const Token& token, void* object = 0 ) = 0;
72
82 virtual Token* registerForWrite( const Placement& place, const void* object, const RootType& type ) = 0;
83
85 virtual IFileCatalog& fileCatalog() = 0;
86
88 virtual const ITechnologySpecificAttributes& technologySpecificAttributes( long technology ) const = 0;
90
92 virtual ~ISession() = default;
93 };
94 }
95}
96#endif
TTypeAdapter RootType
Definition RootType.h:211
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition Placement.h:19
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21
DatabaseConnectionPolicy is a class holding information on the policy to be followed whenever a datab...
ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes.
ITransaction is the interface class for user (macroscopic transactions) Every operation with the pool...
virtual Type type() const =0
Returns the transaction type.
ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a...
Definition ISession.h:40
virtual ITransaction & transaction()=0
Returns the transaction interface.
virtual const ITransaction & transaction() const =0
virtual std::unique_ptr< IDatabase > databaseHandle(const std::string &dbName, DatabaseSpecification::NameType dbNameType)=0
Returns a pointer to a database object. The user acquires ownership of that object.
virtual void * readObject(const Token &token, void *object=0)=0
Retrieves an object from persistent store and return with type information The handle to the reflecti...
virtual const ITechnologySpecificAttributes & technologySpecificAttributes(long technology) const =0
Returns the object holding the technology specific attributes for a given technology domain.
virtual Token * registerForWrite(const Placement &place, const void *object, const RootType &type)=0
registerForWrite registers an object for writing to the persistent medium higher level interactions w...
virtual void setDefaultConnectionPolicy(const DatabaseConnectionPolicy &policy)=0
Sets the default policy when databases are opened/connected.
virtual IFileCatalog & fileCatalog()=0
Returns the file catalog in use.
virtual ~ISession()=default
virtual destructor for the interface
virtual const DatabaseConnectionPolicy & defaultConnectionPolicy() const =0
Retrieves the default connection policy.
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
virtual ITechnologySpecificAttributes & technologySpecificAttributes(long technology)=0
std::unique_ptr< ISession > createSession(IFileCatalog &catalog)
Framework include files.
Definition libname.h:15
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:23