ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15#include <string>
16
18#include "GaudiKernel/IClassIDSvc.h"
19#include "GaudiKernel/ServiceHandle.h"
20
21#include "SGTools/SGIFolder.h"
22
23namespace 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
uint32_t CLID
The Class ID type.
virtual StatusCode add(const std::string &typeName, const std::string &skey) override
add a data object identifier to the list.
Definition SGFolder.cxx:73
virtual void updateItemList(bool checkValidCLID) override final
update contents of the ItemList
Definition SGFolder.cxx:45
virtual ~Folder() override
Definition SGFolder.cxx:36
ItemList m_list
Definition SGFolder.h:108
friend class Folder_tester
Definition SGFolder.h:102
void decodeItem(const std::string &item, bool checkValidCLID)
Definition SGFolder.cxx:51
IFolder::const_iterator const_iterator
Definition SGFolder.h:58
ServiceHandle< IClassIDSvc > m_pCLIDSvc
Definition SGFolder.h:88
virtual const_iterator begin() const override
Definition SGFolder.h:59
virtual StatusCode add(const CLID &clid, const std::string &skey) override
add a data object identifier to the list.
Definition SGFolder.h:69
BooleanProperty m_checkItems
Definition SGFolder.h:90
virtual StatusCode initialize() override
Definition SGFolder.cxx:40
IFolder::ItemList ItemList
the list we manage
Definition SGFolder.h:54
virtual const_iterator end() const override
Definition SGFolder.h:60
StringArrayProperty m_itemList
Definition SGFolder.h:92
Folder(const std::string &type, const std::string &name, const IInterface *parent)
Definition SGFolder.cxx:27
virtual void clear() override
clear the folder contents
Definition SGFolder.h:75
void decodeItemList(Gaudi::Details::PropertyBase &)
Definition SGFolder.h:97
ItemList::const_iterator const_iterator
Definition SGIFolder.h:31
std::set< FolderItem > ItemList
the list we manage
Definition SGIFolder.h:27
Forward declaration.