ATLAS Offline Software
Loading...
Searching...
No Matches
SessionTool.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_SESSIONTOOL_H
6#define POOLSVC_SESSIONTOOL_H
7
9
10#include <map>
11
12namespace pool {
13 class DatabaseRegistry;
14}
15
20{
21 public:
23 explicit SessionTool(const std::string& type,
24 const std::string& name,
25 const IInterface* parent);
26
27
28
30 virtual ~SessionTool();
31
32 SessionTool (const SessionTool&) = delete;
34
35 virtual void setupFC( Gaudi::IFileCatalog& fileCatalog, int ageLimit ) override final;
36
48 virtual void* readObject( const Token& token, void* object = 0 ) override final;
49
50
60 virtual Token* registerForWrite( const Placement& place, const void* object, const RootType& type ) override final;
61
62
63 // Signatures needed for the PersistencySvc
64 pool::DatabaseRegistry& registry() {return *m_registry; }
65
69 virtual bool disconnectAll() override final;
70
72 virtual bool start( Io::IoFlag type = Io::READ ) override final;
73
75 virtual bool commit() override final;
76
78 virtual bool commitAndHold() override final;
79
81 virtual Io::IoFlag openMode() const override final { return m_transactionType; }
82
84 virtual std::unique_ptr<pool::IDatabase>
85 databaseHandle( const std::string& dbName, pool::DatabaseSpecification::NameType dbNameType ) override final;
86
88 virtual Gaudi::IFileCatalog& fileCatalog();
89
91 virtual pool::IStorageSvc& getStorageSvc( long technology ) override final;
92
94 pool::MicroSessionManager& microSessionManager( long technology ) override final;
95
96 void closeSession() override final;
97 StatusCode finalize() override final;
98
99 private:
100 Gaudi::IFileCatalog* m_catalog;
102 std::unique_ptr<pool::DatabaseRegistry> m_registry;
104 std::map< long, std::unique_ptr<pool::MicroSessionManager> > m_technologies;
105 };
106
107
108#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
virtual bool commitAndHold() override final
Commits and holds the transaction.
Gaudi::IFileCatalog * m_catalog
virtual std::unique_ptr< pool::IDatabase > databaseHandle(const std::string &dbName, pool::DatabaseSpecification::NameType dbNameType) override final
Creates and returns a new database handle object.
pool::DatabaseRegistry & registry()
Definition SessionTool.h:64
virtual ~SessionTool()
Destructor.
SessionTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
virtual void * readObject(const Token &token, void *object=0) override final
Retrieves an object from persistent store and return with type information The handle to the reflecti...
SessionTool & operator=(const SessionTool &)=delete
std::unique_ptr< pool::DatabaseRegistry > m_registry
virtual Io::IoFlag openMode() const override final
Returns the transaction type.
Definition SessionTool.h:81
SessionTool(const SessionTool &)=delete
StatusCode finalize() override final
virtual Gaudi::IFileCatalog & fileCatalog()
Returns the file catalog in use.
virtual Token * registerForWrite(const Placement &place, const void *object, const RootType &type) override final
registerForWrite registers an object for writing to the persistent medium higher level interactions w...
Io::IoFlag m_transactionType
std::map< long, std::unique_ptr< pool::MicroSessionManager > > m_technologies
virtual pool::IStorageSvc & getStorageSvc(long technology) override final
Return StorageSvc for a given technology used in this session.
virtual bool commit() override final
Commits the transaction.
pool::MicroSessionManager & microSessionManager(long technology) override final
Returns the technology given a technology type.
virtual bool disconnectAll() override final
Explicitly disconnects all the databases.
void closeSession() override final
virtual void setupFC(Gaudi::IFileCatalog &fileCatalog, int ageLimit) override final
Use this FileCatalog and DB ageing value for this session.
virtual bool start(Io::IoFlag type=Io::READ) override final
Starts a new transaction. Returns the success of the operation.
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:22
STL class.
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...
STL class.
=============================================================================
STL namespace.
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:24
#define private
Definition testRead.cxx:27