27 MyObject(
int d ) : m_data( d ) { c_instances++; }
31 static void dump() {
cout <<
"MyObject (C/D): " << c_instances <<
"/" << d_instances <<
endl; }
38 info() <<
":HiveTestAlgorithm::initialize " <<
endmsg;
41 for (
auto k : m_inputs ) {
42 debug() <<
"adding input key " << k <<
endmsg;
44 declareProperty(
"dummy_in_" +
std::to_string( i ), *( m_inputHandles.back() ) );
49 for (
auto k : m_outputs ) {
50 debug() <<
"adding output key " << k <<
endmsg;
51 m_outputHandles.emplace_back(
53 declareProperty(
"dummy_out_" +
std::to_string( i ), *( m_outputHandles.back() ) );
64 info() <<
":HiveTestAlgorithm::getting inputs... " <<
evt <<
endmsg;
66 for (
auto& handle : m_inputHandles ) {
67 auto obj =
dynamic_cast<MyObject*
>( handle->get() );
69 fatal() <<
"Unable to dcast inputHandles object" <<
endmsg;
72 info() <<
"Got data with value " << obj->getData() <<
endmsg;
75 info() <<
":HiveTestAlgorithm::registering outputs... " <<
evt <<
endmsg;
77 for (
auto& outputHandle : m_outputHandles ) { outputHandle->put( std::make_unique<MyObject>( 1000 +
evt ) ); }
83 info() <<
name() <<
":HiveTestAlgorithm::finalize - total events: " << m_total <<
endmsg;