ATLAS Offline Software
Json2Cool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef IOVDBSVC_JSON2COOL_H
5 #define IOVDBSVC_JSON2COOL_H
6 
7 #include "CoolKernel/StorageType.h"
8 #include <string>
9 #include <istream>
10 #include <map>
11 #include "nlohmann/json.hpp"
12 #include "BasicFolder.h"
13 #include "IovStore.h"
14 
15 namespace cool{
16  class RecordSpecification;
17  class Record;
18 }
19 
20 namespace IOVDbNamespace {
21 
28  class Json2Cool {
29  public:
30 
31  Json2Cool(std::istream & stream, BasicFolder & b, const std::string &specString, const IovStore::Iov_t* iov = nullptr);
32  ~Json2Cool() = default;
33 
34  static cool::Record
35  createAttributeList(cool::RecordSpecification * pSpec, const nlohmann::json & j);
36 
37  static cool::RecordSpecification *
38  parsePayloadSpec(const std::string & stringSpecification);
39 
40  private:
41  void init(std::istream & stream, const std::string & specString, const IovStore::Iov_t* iov);
42  cool::RecordSpecification * m_sharedSpec = nullptr;
44 
45 
46  };
47 
48 }
49 #endif
50 
IOVDbNamespace::Json2Cool::~Json2Cool
~Json2Cool()=default
dqt_zlumi_alleff_HIST.iov
iov
Definition: dqt_zlumi_alleff_HIST.py:119
IOVDbNamespace::Json2Cool::Json2Cool
Json2Cool(std::istream &stream, BasicFolder &b, const std::string &specString, const IovStore::Iov_t *iov=nullptr)
Definition: Json2Cool.cxx:55
json
nlohmann::json json
Definition: HistogramDef.cxx:9
IOVDbNamespace::Json2Cool::m_basicFolder
BasicFolder & m_basicFolder
Definition: Json2Cool.h:43
IOVDbNamespace::IovStore::Iov_t
std::pair< cool::ValidityKey, cool::ValidityKey > Iov_t
Definition: IovStore.h:22
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
cool
Definition: CoolTagInfo.h:12
IOVDbNamespace::Json2Cool
Produces cool objects from their JSON representation, storing them in a 'BasicFolder'.
Definition: Json2Cool.h:28
Record
Definition: HephProf.cxx:56
IOVDbNamespace::Json2Cool::parsePayloadSpec
static cool::RecordSpecification * parsePayloadSpec(const std::string &stringSpecification)
Definition: Json2Cool.cxx:114
IOVDbNamespace::BasicFolder
Definition: BasicFolder.h:21
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
IOVDbNamespace::Json2Cool::m_sharedSpec
cool::RecordSpecification * m_sharedSpec
Definition: Json2Cool.h:42
IovStore.h
helper class for IOVDbFolder managing cached iov since/until pairs
BasicFolder.h
IOVDbNamespace::Json2Cool::createAttributeList
static cool::Record createAttributeList(cool::RecordSpecification *pSpec, const nlohmann::json &j)
Definition: Json2Cool.cxx:153
IOVDbNamespace::Json2Cool::init
void init(std::istream &stream, const std::string &specString, const IovStore::Iov_t *iov)
Definition: Json2Cool.cxx:60
IOVDbNamespace
Definition: Base64Codec.cxx:16