ATLAS Offline Software
Loading...
Searching...
No Matches
AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ASG_DATA_HANDLES_VAR_HANDLE_KEY_ARRAY_H
6#define ASG_DATA_HANDLES_VAR_HANDLE_KEY_ARRAY_H
7
8#ifndef XAOD_STANDALONE
10#else
11
18
20#include <vector>
21#include <string>
22
23namespace SG {
24
37 class VarHandleKeyArray {
38 public:
40 virtual ~VarHandleKeyArray() = default;
41 // virtual StatusCode assign(const std::vector<std::string>& vs)=0;
42 virtual std::string toString() const = 0;
43 // virtual Gaudi::DataHandle::Mode mode() const = 0;
44
45 // virtual std::vector<SG::VarHandleKey*> keys() const = 0;
46
47 // virtual void renounce() = 0;
48 // virtual bool renounced() const = 0;
49 // virtual void declare(IDataHandleHolder*) = 0;
50
51 // virtual void setOwner( IDataHandleHolder* o ) = 0;
52 // virtual const IDataHandleHolder* owner() const = 0;
53 // virtual IDataHandleHolder* owner() = 0;
54
55 };
56
57/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
58// mixin class for common functionality
59//
60
76
77 template <class Base>
79 public std::vector<Base> {
80 public:
85 VarHandleKeyArrayCommon() : std::vector<Base>() {};
86
91 VarHandleKeyArrayCommon( const std::vector<Base>& v ):
92 std::vector<Base>(v) {};
93
99 VarHandleKeyArrayCommon( std::initializer_list<Base> l ):
100 std::vector<Base>{l} {};
101
108 VarHandleKeyArrayCommon( std::initializer_list<std::string> l ) {
109 for (auto &e : l) {
110 this->push_back( Base{e} );
111 }
112 }
113
119 StatusCode initialize (bool used = true);
120
121 // /**
122 // * @brief Set the contents of the VarHandleKeyArray from a
123 // * vector of std::strings
124 // * @param vs vector of initializer strings
125 // */
126 // virtual StatusCode assign(const std::vector<std::string>& vs) override;
127
131 virtual std::string toString() const override;
132
133 // /**
134 // * @brief create array of all base VarHandleKeys in the Array
135 // */
136 // virtual std::vector<SG::VarHandleKey*> keys() const override;
137
138
139 // /**
140 // * @brief if called, handles will not be declared in the algorithm I/O
141 // */
142 // virtual void renounce() override { m_isRenounced = true; }
143
144 // /**
145 // * @brief query renounced state
146 // **/
147 // virtual bool renounced() const override { return m_isRenounced; }
148
149 // virtual void declare( IDataHandleHolder* ) override;
150
151 // virtual void setOwner( IDataHandleHolder* o ) override { m_owner = o; }
152 // virtual const IDataHandleHolder* owner() const override { return m_owner; }
153 // virtual IDataHandleHolder* owner() override { return m_owner; }
154
155 private:
156
157 // bool m_isRenounced{ false };
158 // IDataHandleHolder* m_owner{ nullptr };
159
160 };
161
162} // namespace SG
163
164namespace std {
165 ostream& operator<<(ostream& s, const SG::VarHandleKeyArray& m);
166}
167
168
170
171#endif
172
173#endif
Base class for VarHandleKeyArray for reading from StoreGate.
virtual void push_back(const std::string &key) override
Add a new key to the VarHandleKeyArray.
virtual std::string toString() const override
string representation of the VarHandleKeyArray
VarHandleKeyArrayCommon()
default base Constructor of mixin
virtual ~VarHandleKeyArray()=default
virtual std::string toString() const =0
::StatusCode StatusCode
StatusCode definition for legacy code.
l
Printing final latex table to .tex output file.
Forward declaration.
STL namespace.
ostream & operator<<(ostream &s, const SG::VarHandleKey &m)
void initialize()