4 #ifndef _DecoratorUtils_H_
5 #define _DecoratorUtils_H_
19 template<
class T_Parent,
class T_Cont>
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;
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() );