ATLAS Offline Software
Loading...
Searching...
No Matches
UserSession.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_USERSESSION_H
6#define POOLSVC_USERSESSION_H
7
9#include "PoolSvc/ISession.h"
10#include "StorageSvc/DbPrint.h"
11
12#include <map>
13
14namespace pool {
15
16 // forward declarations
17 class DatabaseRegistry;
19
25
26 class UserSession : public ISession, public APRMessaging
27 {
28 public:
30 explicit UserSession( IFileCatalog& fileCatalog, int ageLimit );
31
33 virtual ~UserSession();
34
35 UserSession (const UserSession&) = delete;
37
38
50 virtual void* readObject( const Token& token, void* object = 0 ) override;
51
52
62 virtual Token* registerForWrite( const Placement& place, const void* object, const RootType& type ) override;
63
64
65 // Signatures needed for the PersistencySvc
67
71 virtual bool disconnectAll() override final;
72
74 virtual bool start( Io::IoFlag type = Io::READ ) override final;
75
77 virtual bool commit() override final;
78
80 virtual bool commitAndHold() override final;
81
83 virtual Io::IoFlag type() const override final { return m_transactionType; }
84
86 virtual std::unique_ptr<IDatabase>
87 databaseHandle( const std::string& dbName, DatabaseSpecification::NameType dbNameType ) override final;
88
90 virtual IFileCatalog& fileCatalog();
91
93 MicroSessionManager& microSessionManager( long technology ) override final;
94
95 private:
100 std::map< long, std::unique_ptr<MicroSessionManager> > m_technologies;
101 };
102}
103
104#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
APRMessaging(const std::string &name)
ISession is the interface class for user (macroscopic) sessions Every connection to a database and ob...
Definition ISession.h:35
MicroSessionManager is a class taking care of starting sessions for a given major technology and mana...
IFileCatalog * m_catalog
Definition UserSession.h:96
DatabaseRegistry & registry()
virtual Token * registerForWrite(const Placement &place, const void *object, const RootType &type) override
registerForWrite registers an object for writing to the persistent medium higher level interactions w...
virtual void * readObject(const Token &token, void *object=0) override
Retrieves an object from persistent store and return with type information The handle to the reflecti...
UserSession(const UserSession &)=delete
DatabaseRegistry * m_registry
Definition UserSession.h:98
virtual IFileCatalog & fileCatalog()
Returns the file catalog in use.
MicroSessionManager & microSessionManager(long technology) override final
Returns the technology given a technology type.
virtual bool start(Io::IoFlag type=Io::READ) override final
Starts a new transaction. Returns the success of the operation.
virtual Io::IoFlag type() const override final
Returns the transaction type.
Definition UserSession.h:83
virtual bool commitAndHold() override final
Commits and holds the transaction.
std::map< long, std::unique_ptr< MicroSessionManager > > m_technologies
virtual bool commit() override final
Commits the transaction.
Io::IoFlag m_transactionType
Definition UserSession.h:99
UserSession(IFileCatalog &fileCatalog, int ageLimit)
Constructor.
virtual std::unique_ptr< IDatabase > databaseHandle(const std::string &dbName, DatabaseSpecification::NameType dbNameType) override final
Creates and returns a new database handle object.
virtual bool disconnectAll() override final
Explicitly disconnects all the databases.
UserSession & operator=(const UserSession &)=delete
virtual ~UserSession()
Destructor.
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