ATLAS Offline Software
Loading...
Searching...
No Matches
PoolMapElement.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef COOLCONVUTILS_POOLMAPELEMENT_H
6#define COOLCONVUTILS_POOLMAPELEMENT_H
7// PoolMapElement.h - simple class to hold information about a POOL file usage
8// and the conditions data folders that reference it
9// Used by AtlCoolCopy.cxx
10
11#include<vector>
12#include<string>
13
15 public:
17 PoolMapElement(const int usage,const std::string& foldertag);
18 // increment usage count
19 void inccount();
20 void setErrorBit(const int bit);
21 void setlfn(const std::string& lfn);
22 void setpfn(const std::string& pfn);
23 // access methods
24 int count() const;
25 int errcode() const;
26 const std::string& lfn() const;
27 const std::string& pfn() const;
28 std::vector<std::string>& foldertag();
29 const std::vector<std::string>& foldertag() const;
30
31 void addfoldertag(const std::string& foldertag);
32
33 private:
36 std::string m_lfn;
37 std::string m_pfn;
38 std::vector<std::string> m_folders;
39};
40
42 const std::string& foldertag) :
43 m_count(usage),m_errcode(0),m_lfn(""),m_pfn("") {
44 m_folders.push_back(foldertag);
45}
46
48
50inline void PoolMapElement::setErrorBit(const int bit)
51 { m_errcode=m_errcode | (1 << bit);}
52inline void PoolMapElement::setlfn(const std::string& lfn) { m_lfn=lfn;}
53inline void PoolMapElement::setpfn(const std::string& pfn) { m_pfn=pfn;}
54
55inline int PoolMapElement::count() const { return m_count; }
56inline int PoolMapElement::errcode() const {return m_errcode; }
57inline const std::string& PoolMapElement::lfn() const {return m_lfn; }
58inline const std::string& PoolMapElement::pfn() const {return m_pfn; }
59
60inline std::vector<std::string>& PoolMapElement::foldertag() { return m_folders; }
61inline const std::vector<std::string>& PoolMapElement::foldertag() const {return m_folders; }
62inline void PoolMapElement::addfoldertag(const std::string& foldertag) {
63 if (find(m_folders.begin(),m_folders.end(),foldertag)==m_folders.end())
64 m_folders.push_back(foldertag);
65}
66
67#endif // COOLCONVUTILS_POOLMAPELEMENT_H
int errcode() const
void addfoldertag(const std::string &foldertag)
std::vector< std::string > & foldertag()
std::string m_lfn
const std::string & lfn() const
std::vector< std::string > m_folders
const std::string & pfn() const
void setErrorBit(const int bit)
int count() const
std::string m_pfn
void setpfn(const std::string &pfn)
void setlfn(const std::string &lfn)
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
int usage(std::ostream &s, int, char **argv, int status=-1)
Definition hcg.cxx:1035