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 class DbConnection;
27 // as from IFileCatalog
28 typedef std::string FileID;
29
41 private:
45 std::string m_PFN;
48
49 public:
53 FileDescriptor(const FileID& fid, const std::string& pfn)
54 : m_FID(fid), m_PFN(pfn), m_DBC(0) {
55 if (!m_FID.empty() && !Guid::isGuid(m_FID)) {
56 MD5 checkSum((unsigned char*)m_FID.c_str(), m_FID.size());
57 uuid_t checkSumUuid;
58 checkSum.raw_digest((unsigned char*)(&checkSumUuid));
59 char text[37];
60 uuid_unparse_upper(checkSumUuid, text);
61 m_FID = text;
62 }
63 }
64
66 const std::string& PFN() const { return m_PFN; }
68 void setPFN(const std::string& val) { m_PFN = val; }
69
71 const FileID& FID() const { return m_FID; }
73 void setFID(const FileID& val) { m_FID = val; }
74
76 DbConnection* dbc() { return m_DBC; }
77 const DbConnection* dbc() const { return m_DBC; }
79 void setDbc(DbConnection* val) { m_DBC = val; }
80 };
81} // End namespace pool
82#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.
FileID m_FID
File Identifier (UNIQUE)
FileDescriptor()
Standard Constructor.
const FileID & FID() const
Access to file identifier (READ)
void setPFN(const std::string &val)
Access to physical file name (WRITE)
const DbConnection * dbc() const
DbConnection * dbc()
Access to file descriptor (READ)
DbConnection * m_DBC
Handle to the Database connection.
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)
void setDbc(DbConnection *val)
Access to file descriptor (WRITE)
Framework include files.
Definition libname.h:15
std::string FileID