ATLAS Offline Software
Loading...
Searching...
No Matches
ISessionTool.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_ISESSIONTOOL_H
6#define POOLSVC_ISESSIONTOOL_H
7
9#include "PoolSvc/IDatabase.h"
11
12#include <string>
13#include <memory>
14
15namespace Gaudi {
16 class IFileCatalog;
17}
18class Placement;
19class Token;
20namespace pool {
22 class IStorageSvc;
23}
24
31
32class ISessionTool : virtual public AthAlgTool
33{
34 public:
35
37 virtual void setupFC( Gaudi::IFileCatalog& fileCatalog, int ageLimit = -1 ) = 0;
38
41 virtual bool disconnectAll() = 0;
42
44 virtual bool start( Io::IoFlag type = Io::READ ) = 0;
45
47 virtual bool commit() = 0;
48
50 virtual bool commitAndHold() = 0;
51
53 virtual Io::IoFlag openMode() const = 0;
54
56 virtual std::unique_ptr<pool::IDatabase>
57 databaseHandle( const std::string& dbName, pool::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 pool::MicroSessionManager& microSessionManager( long technology ) = 0;
85
87 virtual pool::IStorageSvc& getStorageSvc( long technology ) = 0;
88
89 virtual void closeSession() = 0;
90
91 virtual ~ISessionTool() = default;
92};
93
94#endif
TTypeAdapter RootType
Definition RootType.h:211
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual bool start(Io::IoFlag type=Io::READ)=0
Starts a new transaction. Returns the success of the operation.
virtual ~ISessionTool()=default
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
virtual pool::IStorageSvc & getStorageSvc(long technology)=0
Return StorageSvc for a given technology used in this session.
virtual pool::MicroSessionManager & microSessionManager(long technology)=0
Returns the technology given a technology type.
virtual std::unique_ptr< pool::IDatabase > databaseHandle(const std::string &dbName, pool::DatabaseSpecification::NameType dbNameType)=0
Returns a pointer to a database object. The user acquires ownership of that object.
virtual void setupFC(Gaudi::IFileCatalog &fileCatalog, int ageLimit=-1)=0
Use this FileCatalog and DB ageing value for this session.
virtual bool commitAndHold()=0
Commits the holds transaction.
virtual bool commit()=0
Commits the transaction.
virtual Io::IoFlag openMode() const =0
Returns the transaction type.
virtual void closeSession()=0
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 * readObject(const Token &token, void *object=0)=0
Retrieves an object from persistent store and return with type information The handle to the reflecti...
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
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...
=============================================================================
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:24