18 MyObject(
int d ) : m_data( d ) { c_instances++; }
22 static void dump() {
cout <<
"MyObject (C/D): " << c_instances <<
"/" << d_instances <<
endl; }
30 info() <<
":HiveTestAlgorithm::initialize " <<
endmsg;
34 debug() <<
"adding input key " << k <<
endmsg;
41 for (
auto k : m_outputs ) {
42 debug() <<
"adding output key " << k <<
endmsg;
56 info() <<
":HiveTestAlgorithm::getting inputs... " << evt <<
endmsg;
58 for (
auto& handle : m_inputHandles ) {
59 auto obj =
dynamic_cast<MyObject*
>( handle->get() );
61 fatal() <<
"Unable to dcast inputHandles object" <<
endmsg;
64 info() <<
"Got data with value " << obj->getData() <<
endmsg;
67 info() <<
":HiveTestAlgorithm::registering outputs... " << evt <<
endmsg;
69 for (
auto& outputHandle : m_outputHandles ) {
70 outputHandle->put(
new MyObject( 1000 + evt ) );
78 info() <<
name() <<
":HiveTestAlgorithm::finalize - total events: " << m_total <<
endmsg;
constexpr static const auto FAILURE
static atomic< int > c_instances
MyObject(const MyObject &o)
virtual const std::vector< std::string > get_outputs()
static atomic< int > d_instances
#define DECLARE_COMPONENT(type)
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)
GAUDI_API const EventContext & currentContext()
StatusCode initialize() override
constexpr static const auto SUCCESS
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.