4#ifndef _DecoratorUtils_H_
5#define _DecoratorUtils_H_
19 template<
class T_Parent,
class T_Cont>
22 const std::string &prefix,
23 const std::vector<std::string> &decor_names,
26 decor_out.reserve(decor_names.size());
27 for (
const std::string &a_decor_name : decor_names) {
28 assert( !a_decor_name.empty() );
35 parent.declare(a_decor_handle_key);
36 a_decor_handle_key.setOwner(&parent);
37 if (a_decor_handle_key.initialize().isFailure()) {
38 std::stringstream
msg;
39 msg <<
"Failed to initialize " << a_decor_handle_key.key() <<
" after initializing: ";
41 if (&b_decor_handle_key == &a_decor_handle_key)
break;
42 msg <<
" " << b_decor_handle_key.key();
44 throw std::runtime_error(
msg.str());
49 template <
class T_Cont,
class T>
50 std::vector<SG::WriteDecorHandle<T_Cont,T> >
52 const EventContext &ctx) {
53 std::vector<SG::WriteDecorHandle<T_Cont,T> > out;
54 out.reserve(keys.size());
57 if (not out.back().isValid()) {
58 std::stringstream
msg;
59 msg <<
"Failed to create decorator handdle " << a_key.key();
60 throw std::runtime_error(
msg.str() );
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a ReadHandle is made.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)