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
28 class ISession;
29 std::unique_ptr<ISession> createSession( IFileCatalog& catalog );
30
38
39 class ISession : public ITransaction {
40 public:
42 virtual void setDefaultConnectionPolicy( const DatabaseConnectionPolicy& policy ) = 0;
43
46
49 virtual bool disconnectAll() = 0;
50
52 virtual ITransaction& transaction() = 0;
53 virtual const ITransaction& transaction() const = 0;
54
56 virtual std::unique_ptr<IDatabase> databaseHandle( const std::string& dbName,
57 DatabaseSpecification::NameType dbNameType ) = 0;
58
70 virtual void* readObject( const Token& token, void* object = 0 ) = 0;
71
81 virtual Token* registerForWrite( const Placement& place, const void* object, const RootType& type ) = 0;
82
84 virtual IFileCatalog& fileCatalog() = 0;
85
87 virtual const ITechnologySpecificAttributes& technologySpecificAttributes( long technology ) const = 0;
89
91 virtual ~ISession() = default;
92 };
93}
94#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...
ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a...
Definition ISession.h:39
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 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 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 ITransaction & transaction()=0
Returns the transaction interface.
virtual const ITechnologySpecificAttributes & technologySpecificAttributes(long technology) const =0
Returns the object holding the technology specific attributes for a given technology domain.
virtual const ITransaction & transaction() const =0
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 void setDefaultConnectionPolicy(const DatabaseConnectionPolicy &policy)=0
Sets the default policy when databases are opened/connected.
virtual ITechnologySpecificAttributes & technologySpecificAttributes(long technology)=0
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
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.
Framework include files.
Definition libname.h:15
std::unique_ptr< ISession > createSession(IFileCatalog &catalog)
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:23