ATLAS Offline Software
SGFolder.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef SGCOMPS_FOLDER_H
8 #define SGCOMPS_FOLDER_H 1
9 
15 #include <string>
16 
18 #include "GaudiKernel/IClassIDSvc.h"
19 #include "GaudiKernel/ServiceHandle.h"
20 
21 #include "SGTools/SGIFolder.h"
22 
23 namespace SG {
24  class Folder_tester;
25 
42  class Folder : public extends<AthAlgTool, IFolder>
43  {
44  public:
46 
47  Folder(const std::string& type,
48  const std::string& name,
49  const IInterface* parent);
50  virtual ~Folder() override;
52 
55 
57 
59  virtual const_iterator begin() const override { return m_list.begin(); }
60  virtual const_iterator end() const override { return m_list.end(); }
62 
66  virtual StatusCode add(const std::string& typeName, const std::string& skey) override;
69  virtual StatusCode add(const CLID& clid, const std::string& skey) override {
70  const bool DONTCHECKVALIDCLID(false);
71  return add(clid, skey, DONTCHECKVALIDCLID, false);
72  }
73 
75  virtual void clear() override { m_list.clear(); }
76 
77 
79  virtual void updateItemList(bool checkValidCLID) override final;
80 
82 
83  virtual StatusCode initialize() override;
85 
86  private:
87 
89 
90  BooleanProperty m_checkItems{this, "CheckItems", false, "check if item types are known to ClassIDSvc"};
91 
92  StringArrayProperty m_itemList{this, "ItemList", {}, &Folder::decodeItemList,
93  "List of data objects identified by a class name (or clid)#key pairs. One can use '*' as key value to "
94  "add all objects of a given type to the Folder. If the type name ends with !, then write the object as "
95  "exactly that type (and not as any derived class)."};
96 
97  void decodeItemList(Gaudi::Details::PropertyBase&) {
98  const bool DONTCHECKVALIDCLID(false);
99  Folder::updateItemList(DONTCHECKVALIDCLID);
100  }
101  void decodeItem(const std::string& item, bool checkValidCLID);
102  friend class Folder_tester;
105  StatusCode add(const CLID& clid, const std::string& skey,
106  bool checkValidCLID, bool exact);
107 
109 
110  };
111 } //ns SG
112 
113 #endif
SG::Folder::~Folder
virtual ~Folder() override
Definition: SGFolder.cxx:36
SGIFolder.h
SG::Folder::Folder_tester
friend class Folder_tester
Definition: SGFolder.h:102
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::Folder::updateItemList
virtual void updateItemList(bool checkValidCLID) override final
update contents of the ItemList
Definition: SGFolder.cxx:45
SG::Folder::const_iterator
IFolder::const_iterator const_iterator
Definition: SGFolder.h:58
SG::Folder::clear
virtual void clear() override
clear the folder contents
Definition: SGFolder.h:75
SG::IFolder::const_iterator
ItemList::const_iterator const_iterator
Definition: SGIFolder.h:31
SG::Folder::m_pCLIDSvc
ServiceHandle< IClassIDSvc > m_pCLIDSvc
Definition: SGFolder.h:88
SG::Folder::m_itemList
StringArrayProperty m_itemList
Definition: SGFolder.h:92
SG::Folder::ItemList
IFolder::ItemList ItemList
the list we manage
Definition: SGFolder.h:54
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
SG::Folder::add
virtual StatusCode add(const CLID &clid, const std::string &skey) override
add a data object identifier to the list.
Definition: SGFolder.h:69
SG::Folder::Folder
Folder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SGFolder.cxx:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
SG::Folder::m_list
ItemList m_list
Definition: SGFolder.h:108
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SG::Folder::decodeItemList
void decodeItemList(Gaudi::Details::PropertyBase &)
Definition: SGFolder.h:97
SG::Folder::begin
virtual const_iterator begin() const override
Definition: SGFolder.h:59
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::Folder::m_checkItems
BooleanProperty m_checkItems
Definition: SGFolder.h:90
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::Folder::add
virtual StatusCode add(const std::string &typeName, const std::string &skey) override
add a data object identifier to the list.
Definition: SGFolder.cxx:73
SG::IFolder::ItemList
std::set< FolderItem > ItemList
the list we manage
Definition: SGIFolder.h:27
SG::Folder::initialize
virtual StatusCode initialize() override
Definition: SGFolder.cxx:40
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
SG::Folder::end
virtual const_iterator end() const override
Definition: SGFolder.h:60
SG::Folder::decodeItem
void decodeItem(const std::string &item, bool checkValidCLID)
Definition: SGFolder.cxx:51
SG::Folder
a run-time configurable list of data objects
Definition: SGFolder.h:43
ServiceHandle< IClassIDSvc >