The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
IODataManager.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12
13// C++ include files
14#include <map>
15// Framework include files
16#include <GaudiKernel/Service.h>
18
19class IIncidentSvc;
20
21/*
22 * LHCb namespace declaration
23 */
24namespace Gaudi {
25
26 // Forward declarations
27 class IFileCatalog;
28 class RawDataConnectionEntry;
29
38 class IODataManager : public extends<Service, IIODataManager> {
39 protected:
40 typedef const std::string& CSTR;
41 struct Entry final {
42 std::string type;
43 IoType ioType;
46 Entry( CSTR tech, bool k, IoType iot, IDataConnection* con )
47 : type( tech ), ioType( iot ), connection( con ), keepOpen( k ) {}
48 };
49 typedef std::map<std::string, Entry*> ConnectionMap;
50 typedef std::map<std::string, std::string> FidMap;
51
52 Gaudi::Property<std::string> m_catalogSvcName{ this, "CatalogType", "Gaudi::MultiFileCatalog/FileCatalog",
53 "name of the file catalog service" };
54 Gaudi::Property<bool> m_useGFAL{ this, "UseGFAL", true, "flag for auto gfal data access" };
55 Gaudi::Property<bool> m_quarantine{ this, "QuarantineFiles", true,
56 "if unaccessible files should be quarantines in job" };
57 Gaudi::Property<int> m_ageLimit{ this, "AgeLimit", 2, "age limit" };
59 this, "DisablePFNWarning", false,
60 "if set to True, we will not report when a file is opened by its physical name" };
61
68 StatusCode connectDataIO( int typ, IoType rw, CSTR fn, CSTR technology, bool keep, Connection* con );
71 StatusCode establishConnection( Connection* con );
72
74
75 public:
77 using extends::extends;
78
80 StatusCode initialize() override;
81
83 StatusCode finalize() override;
84
86 StatusCode connectRead( bool keep_open, Connection* ioDesc ) override;
88 StatusCode connectWrite( Connection* con, IoType mode = Connection::CREATE, CSTR doctype = "UNKNOWN" ) override;
90 StatusCode disconnect( Connection* ioDesc ) override;
92 Connection* connection( const std::string& dsn ) const override;
94 Connections connections( const IInterface* owner ) const override;
96 StatusCode read( Connection* ioDesc, void* const data, size_t len ) override;
98 StatusCode write( Connection* con, const void* data, int len ) override;
100 long long int seek( Connection* ioDesc, long long int where, int origin ) override;
101 };
102} // End namespace Gaudi
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
ABC describing basic data connection.
File catalog interface.
ConnectionMap m_connectionMap
Map with I/O descriptors.
StatusCode connectRead(bool keep_open, Connection *ioDesc) override
Open data stream in read mode.
FidMap m_fidMap
Map of FID to PFN.
const std::string & CSTR
Gaudi::Property< bool > m_quarantine
StatusCode write(Connection *con, const void *data, int len) override
Write raw byte buffer to output stream.
long long int seek(Connection *ioDesc, long long int where, int origin) override
Seek on the file described by ioDesc. Arguments as in seek()
StatusCode finalize() override
IService implementation: finalize the service.
StatusCode read(Connection *ioDesc, void *const data, size_t len) override
Read raw byte buffer from input stream.
SmartIF< IFileCatalog > m_catalog
Reference to file catalog.
StatusCode disconnect(Connection *ioDesc) override
Release data stream.
Gaudi::Property< std::string > m_catalogSvcName
StatusCode establishConnection(Connection *con)
StatusCode connectWrite(Connection *con, IoType mode=Connection::CREATE, CSTR doctype="UNKNOWN") override
Open data stream in write mode.
Gaudi::Property< bool > m_useGFAL
Connection * connection(const std::string &dsn) const override
Retrieve known connection.
StatusCode reconnect(Entry *e)
std::map< std::string, Entry * > ConnectionMap
Gaudi::Property< bool > m_disablePFNWarning
Gaudi::Property< int > m_ageLimit
StatusCode initialize() override
IService implementation: initialize the service.
Connections connections(const IInterface *owner) const override
Get connection by owner instance (0=ALL)
SmartIF< IIncidentSvc > m_incSvc
std::map< std::string, std::string > FidMap
StatusCode connectDataIO(int typ, IoType rw, CSTR fn, CSTR technology, bool keep, Connection *con)
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
The interface implemented by the IncidentSvc service.
Definition of the basic interface.
Definition IInterface.h:225
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Base class used to extend a class implementing other interfaces.
Definition extends.h:19
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
IoType ioType
IDataConnection * connection
bool keepOpen
std::string type
Entry(CSTR tech, bool k, IoType iot, IDataConnection *con)