ATLAS Offline Software
Loading...
Searching...
No Matches
FileDescriptor.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5//====================================================================
6// Storage service file descriptor class definitions
7//--------------------------------------------------------------------
8//
9// Package : StorageSvc (The POOL project)
10// @author M.Frank
11//====================================================================
12#ifndef POOL_FILEDESCRIPTOR_H
13#define POOL_FILEDESCRIPTOR_H 1
14
15#include "uuid/uuid.h"
16#include "CxxUtils/MD5.h"
18
19#include <string>
20
21/*
22 * POOL namespace declaration
23 */
24namespace pool {
25
26 // as from IFileCatalog
27 typedef std::string FileID;
30
42 private:
46 std::string m_PFN;
49
50 public:
54 FileDescriptor(const FileID& fid, const std::string& pfn)
55 : m_FID(fid), m_PFN(pfn), m_DBC(0) {
56 if (!m_FID.empty() && !Guid::isGuid(m_FID)) {
57 MD5 checkSum((unsigned char*)m_FID.c_str(), m_FID.size());
58 uuid_t checkSumUuid;
59 checkSum.raw_digest((unsigned char*)(&checkSumUuid));
60 char text[37];
61 uuid_unparse_upper(checkSumUuid, text);
62 m_FID = text;
63 }
64 }
65
67 const std::string& PFN() const { return m_PFN; }
69 void setPFN(const std::string& val) { m_PFN = val; }
70
72 const FileID& FID() const { return m_FID; }
74 void setFID(const FileID& val) { m_FID = val; }
75
77 ConnectionH dbc() { return m_DBC; }
78 ConstConnectionH dbc() const { return m_DBC; }
80 void setDbc(ConnectionH val) { m_DBC = val; }
81 };
82} // End namespace pool
83#endif // POOL_FILEDESCRIPTOR_H
This file contains the class definition for the Guid class (migrated from POOL).
solar's public-domain MD5, wrapped for C++.
static bool isGuid(std::string_view) noexcept
Definition Guid.cxx:54
Definition of the DbConnection class.
ConstConnectionH dbc() const
ConnectionH m_DBC
Handle to the Database connection.
FileID m_FID
File Identifier (UNIQUE)
FileDescriptor()
Standard Constructor.
const FileID & FID() const
Access to file identifier (READ)
ConnectionH dbc()
Access to file descriptor (READ)
void setDbc(ConnectionH val)
Access to file descriptor (WRITE)
void setPFN(const std::string &val)
Access to physical file name (WRITE)
void setFID(const FileID &val)
Access to file identifier (WRITE)
std::string m_PFN
Physical file name.
FileDescriptor(const FileID &fid, const std::string &pfn)
Constructor with initializing arguments.
const std::string & PFN() const
Access to physical file name (READ)
pool namespace
Definition libname.h:15
std::string FileID
class DatabaseConnection * ConnectionH
const DatabaseConnection * ConstConnectionH