#include <PlainAccessor.h>
|
| std::unordered_map< std::size_t, std::unique_ptr< IKit > > | m_kits |
Definition at line 91 of file PlainAccessor.h.
◆ PlainAccessorFactory()
| ExpressionParsing::PlainAccessorFactory::PlainAccessorFactory |
( |
| ) |
|
|
inline |
Definition at line 193 of file PlainAccessor.h.
193 {
194
200
206 }
void registerStdVectorKit()
void registerPlainValueKit()
◆ createAccessor()
| std::unique_ptr< IAccessor > ExpressionParsing::PlainAccessorFactory::createAccessor |
( |
const std::any & | handle_key | ) |
const |
|
inline |
Definition at line 207 of file PlainAccessor.h.
207 {
208 std::unordered_map<std::size_t,std::unique_ptr<IKit> >::const_iterator
209 kit_iter=
m_kits.find(handle_key.type().hash_code());
210 if (kit_iter ==
m_kits.end()) {
211 std::stringstream
msg;
212 msg <<
"ExpressionParsing::PlainAccessorFactory: no kit for type " << handle_key.type().name();
213 throw std::runtime_error(
msg.str());
214 }
215 return kit_iter->second->createAccessor(handle_key);
216 }
std::unordered_map< std::size_t, std::unique_ptr< IKit > > m_kits
◆ instance()
◆ registerPlainValueKit()
| void ExpressionParsing::PlainAccessorFactory::registerPlainValueKit |
( |
| ) |
|
|
inline |
◆ registerReadKey() [1/2]
| bool ExpressionParsing::PlainAccessorFactory::registerReadKey |
( |
std::unordered_map< std::string, std::any > & | read_keys, |
|
|
const std::type_info & | the_type, |
|
|
SGxAODProxyLoader::IParentHelper & | parent, |
|
|
const std::string & | var_name, |
|
|
std::vector< Gaudi::DataHandle * > & | new_input_handles, |
|
|
bool | verbose = false ) |
|
inline |
Definition at line 217 of file PlainAccessor.h.
222 {
223 std::unordered_map<std::size_t,std::unique_ptr<IKit> >::const_iterator
224 kit_iter=
m_kits.find(the_type.hash_code());
225 if (kit_iter ==
m_kits.end()) {
227 std::cout << "DEBUG PlainAccessorFactory::createReadKey no matching kit for " << the_type.name() << " " << the_type.hash_code() << std::endl;
228 for (
const std::pair<
const std::size_t,std::unique_ptr<IKit> > &elm :
m_kits) {
229 std::cout << "DEBUG PlainAccessorFactory::createReadKey have " << elm.first << std::endl;
230 }
231 }
232 return false;
233 }
234 return kit_iter->second->registerReadKey(read_keys, parent, var_name, new_input_handles,
verbose);
235 }
◆ registerReadKey() [2/2]
template<class T_Cont>
| bool ExpressionParsing::PlainAccessorFactory::registerReadKey |
( |
std::unordered_map< std::string, std::any > & | read_keys, |
|
|
SGxAODProxyLoader::IParentHelper & | parent, |
|
|
const std::string & | var_name, |
|
|
std::vector< Gaudi::DataHandle * > & | new_input_handles, |
|
|
bool | verbose ) |
|
inlinestatic |
Definition at line 112 of file PlainAccessor.h.
116 {
117 SG::ReadHandleKey< T_Cont >
key(var_name);
118 const auto &[mapIterator, inserted] = read_keys.try_emplace(var_name, std::move(key));
119 if (!inserted) {
120 if ( mapIterator->first == var_name
121 && mapIterator->second.type().hash_code() == typeid(key).hash_code()) {
122 return true;
123 }
125 }
126 SG::ReadHandleKey< T_Cont > *key_final( std::any_cast<SG::ReadHandleKey< T_Cont > >( &mapIterator->second));
127 if (!key_final) {
129 }
130 if (
parent.declare(*key_final).isFailure()) {
132 }
136 std::cout <<
"DEBUG PlainAccessorFactory::registerReadKey register read handle key for " <<
var_name <<
" [" <<
typeid(T_Cont).
name() <<
"]."<< std::endl;
137 }
138 return true;
139 }
static void throwFailedToAddHandle(const std::string &var_name)
void initializeHandle(T_Key *key, std::vector< Gaudi::DataHandle * > &new_input_handles)
Auxiliary function to initialize newly create data handles.
void dumpDeclare(const T *key)
Function for debugging which dumps information about newly declared data handles.
◆ registerStdVectorKit()
| void ExpressionParsing::PlainAccessorFactory::registerStdVectorKit |
( |
| ) |
|
|
inline |
◆ throwFailedToAddHandle()
| void ExpressionParsing::PlainAccessorFactory::throwFailedToAddHandle |
( |
const std::string & | var_name | ) |
|
|
inlinestatic |
Definition at line 105 of file PlainAccessor.h.
105 {
106 std::stringstream
msg;
107 msg <<
"Failed to add read handle key for " <<
var_name;
108 throw std::runtime_error(
msg.str());
109 }
◆ ATLAS_THREAD_SAFE
◆ m_kits
| std::unordered_map<std::size_t,std::unique_ptr<IKit> > ExpressionParsing::PlainAccessorFactory::m_kits |
|
private |
The documentation for this class was generated from the following file: