Project
Loading...
Searching...
No Matches
IdPath.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_CDB_PATH_H_
13#define ALICEO2_CDB_PATH_H_
14
15// Path string identifying the object: //
16// "level0/level1/level2" //
17// (example: "ZDC/Calib/Pedestals") //
18#include <TObject.h> // for TObject
19#include <TString.h> // for TString
20#include "Rtypes.h" // for Bool_t, IdPath::Class, ClassDef, etc
21
22namespace o2
23{
24namespace ccdb
25{
26
27class IdPath : public TObject
28{
29
30 public:
31 IdPath();
32
33 IdPath(const IdPath& other);
34
35 IdPath(const char* level0, const char* level1, const char* level2);
36
37 IdPath(const char* path);
38
39 IdPath(const TString& path);
40
41 ~IdPath() override;
42
43 const TString& getPathString() const
44 {
45 return mPath;
46 }
47
48 void setPath(const char* path)
49 {
50 mPath = path;
51 InitPath();
52 }
53
54 const char* getLevel(Int_t i) const;
55
56 Bool_t isValid() const
57 {
58 return mValid;
59 }
60
61 Bool_t isWildcard() const
62 {
63 return mWildcard;
64 }
65
66 Bool_t doesLevel0Contain(const TString& str) const;
67
68 Bool_t doesLevel1Contain(const TString& str) const;
69
70 Bool_t doesLevel2Contain(const TString& str) const;
71
72 Bool_t isSupersetOf(const IdPath& other) const;
73
74 private:
75 Bool_t isWord(const TString& str);
76
77 void InitPath();
78
79 void init();
80
81 TString mPath; // detector pathname (Detector/DBType/SpecType)
82 TString mLevel0; // level0 name (ex. detector: ZDC, TPC...)
83 TString mLevel1; // level1 name (ex. DB type, Calib, Align)
84 TString mLevel2; // level2 name (ex. DetSpecType, pedestals, gain...)
85
86 Bool_t mValid; // validity flag
87 Bool_t mWildcard; // wildcard flag
88
89 ClassDefOverride(IdPath, 1);
90};
91} // namespace ccdb
92} // namespace o2
93#endif
int32_t i
Bool_t isWildcard() const
Definition IdPath.h:61
Bool_t doesLevel2Contain(const TString &str) const
Definition IdPath.cxx:186
Bool_t isValid() const
Definition IdPath.h:56
const TString & getPathString() const
Definition IdPath.h:43
Bool_t isSupersetOf(const IdPath &other) const
Definition IdPath.cxx:197
Bool_t doesLevel1Contain(const TString &str) const
Definition IdPath.cxx:175
Bool_t doesLevel0Contain(const TString &str) const
Definition IdPath.cxx:164
const char * getLevel(Int_t i) const
Definition IdPath.cxx:204
void setPath(const char *path)
Definition IdPath.h:48
~IdPath() override
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other
const std::string str