19 MyObject(
int d ) : m_data( d ) { c_instances++; }
23 static void dump() {
cout <<
"MyObject (C/D): " << c_instances <<
"/" << d_instances <<
endl; }
31 info() <<
":HiveTestAlgorithm::initialize " <<
endmsg;
35 debug() <<
"adding input key " << k <<
endmsg;
42 for (
auto k : m_outputs ) {
43 debug() <<
"adding output key " << k <<
endmsg;
57 info() <<
":HiveTestAlgorithm::getting inputs... " << evt <<
endmsg;
59 for (
auto& handle : m_inputHandles ) {
60 auto obj =
dynamic_cast<MyObject*
>( handle->get() );
62 fatal() <<
"Unable to dcast inputHandles object" <<
endmsg;
65 info() <<
"Got data with value " << obj->getData() <<
endmsg;
68 info() <<
":HiveTestAlgorithm::registering outputs... " << evt <<
endmsg;
70 for (
auto& outputHandle : m_outputHandles ) {
71 outputHandle->put(
new MyObject( 1000 + evt ) );
79 info() <<
name() <<
":HiveTestAlgorithm::finalize - total events: " << m_total <<
endmsg;
static atomic< int > c_instances
MyObject(const MyObject &o)
virtual const std::vector< std::string > get_outputs()
static atomic< int > d_instances
This class is used for returning status codes from appropriate routines.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
#define DECLARE_ALGORITHM_FACTORY(x)
GAUDI_API const EventContext & currentContext()
StatusCode initialize() override
std::vector< InputHandle_t< In > > m_inputs
virtual const std::vector< std::string > get_inputs()
StatusCode execute() override
StatusCode finalize() override
A DataObject is the base class of any identifiable object on any data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.