ATLAS Offline Software
JsonFileLoader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef TRIGCONFSTORAGE_JSONFILELOADER_H
13 #define TRIGCONFSTORAGE_JSONFILELOADER_H
14 
17 
18 #include "boost/property_tree/ptree.hpp"
19 
20 namespace TrigConf {
21 
26  public:
27 
30 
32  virtual ~JsonFileLoader() override = default;
33 
49  bool loadFile( const std::string & filename,
51  const std::string & pathToChild = "") const;
52 
59  bool loadFile( const std::string & filename,
61  const std::string & pathToChild = "") const;
62 
63 
69  bool saveFile( const std::string & filename,
70  const DataStructure & data ) const;
71 
76  std::string getFileType( const std::string & filename ) const;
77 
83  bool checkTriggerLevel( const std::string & filename,
84  std::string & level ) const;
85 
86  void setLevel(MSGTC::Level lvl) { msg().setLevel(lvl); }
87 
88  MSGTC::Level outputLevel() const { return msg().level(); }
89 
90  private:
91  std::string findFile(const std::string & filename) const;
92 
93  };
94 
95 }
96 
97 #endif
98 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TrigConf::JsonFileLoader::outputLevel
MSGTC::Level outputLevel() const
Definition: JsonFileLoader.h:88
TrigConf::JsonFileLoader::findFile
std::string findFile(const std::string &filename) const
Definition: JsonFileLoader.cxx:28
TrigConf::JsonFileLoader::loadFile
bool loadFile(const std::string &filename, boost::property_tree::ptree &data, const std::string &pathToChild="") const
Load content of json file into a ptree.
Definition: JsonFileLoader.cxx:45
TrigConf::JsonFileLoader::JsonFileLoader
JsonFileLoader()
Constructor.
Definition: JsonFileLoader.cxx:19
TrigConf::JsonFileLoader::checkTriggerLevel
bool checkTriggerLevel(const std::string &filename, std::string &level) const
Checks the trigger level of a given json file.
Definition: JsonFileLoader.cxx:128
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TrigConf::JsonFileLoader::saveFile
bool saveFile(const std::string &filename, const DataStructure &data) const
Save content of DataStructure (underlying ptree) to a file.
Definition: JsonFileLoader.cxx:99
TrigConf::TrigConfMessaging::msg
MsgStreamTC & msg() const
The standard message stream.
Definition: TrigConfMessaging.h:81
TrigConf::MsgStreamTC::level
MSGTC::Level level()
Return message level of stream.
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:53
TrigConf::JsonFileLoader::getFileType
std::string getFileType(const std::string &filename) const
Checks the trigger level of a given json file.
Definition: JsonFileLoader.cxx:114
TrigConf::JsonFileLoader::setLevel
void setLevel(MSGTC::Level lvl)
Definition: JsonFileLoader.h:86
TrigConf::JsonFileLoader::~JsonFileLoader
virtual ~JsonFileLoader() override=default
Destructor.
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::TrigConfMessaging
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
Definition: TrigConfMessaging.h:28
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
TrigConfMessaging.h
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
TrigConf::JsonFileLoader
Loader of trigger configurations from Json files.
Definition: JsonFileLoader.h:25
TrigConf::MsgStreamTC::setLevel
void setLevel(MSGTC::Level lvl)
Set message level of stream.
Definition: Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:52
DataStructure.h