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 POOLSVC_ISESSION_H
6#define POOLSVC_ISESSION_H
7
8#include "PoolSvc/IDatabase.h"
9
11
12#include <string>
13#include <memory>
14
15class Placement;
16class Token;
17
18namespace pool {
19
20 // forward declarations
22 class IFileCatalog;
23 class IStorageSvc;
24
26 class ISession;
27 std::unique_ptr<ISession> createSession( IFileCatalog& catalog, int ageLimit = -1 );
28
35
36 class ISession {
37 public:
40 virtual bool disconnectAll() = 0;
41
43 virtual bool start( Io::IoFlag type = Io::READ ) = 0;
44
46 virtual bool commit() = 0;
47
49 virtual bool commitAndHold() = 0;
50
52 virtual Io::IoFlag type() const = 0;
53
55 virtual std::unique_ptr<IDatabase> databaseHandle( const std::string& dbName,
56 DatabaseSpecification::NameType dbNameType ) = 0;
57
69 virtual void* readObject( const Token& token, void* object = 0 ) = 0;
70
80 virtual Token* registerForWrite( const Placement& place, const void* object, const RootType& type ) = 0;
81
83 virtual MicroSessionManager& microSessionManager( long technology ) = 0;
84
86 virtual IStorageSvc& getStorageSvc( long technology ) = 0;
87
89 virtual ~ISession() = default;
90 };
91}
92#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:20
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:22
ISession is the interface class for user (macroscopic) sessions Every connection to a database and ob...
Definition ISession.h:36
virtual Io::IoFlag type() const =0
Returns the transaction type.
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 MicroSessionManager & microSessionManager(long technology)=0
Returns the technology given a technology type.
virtual bool start(Io::IoFlag type=Io::READ)=0
Starts a new transaction. Returns the success of the operation.
virtual ~ISession()=default
virtual destructor for the interface
virtual IStorageSvc & getStorageSvc(long technology)=0
Return StorageSvc for a given technology used in this session.
virtual bool commit()=0
Commits the transaction.
virtual bool commitAndHold()=0
Commits the holds transaction.
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
The IStorageSvc interface is able to handle user request for.
Definition IStorageSvc.h:48
MicroSessionManager is a class taking care of starting sessions for a given major technology and mana...
Framework include files.
Definition libname.h:15
std::unique_ptr< ISession > createSession(IFileCatalog &catalog, int ageLimit=-1)
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:24