The Gaudi Framework  v30r3 (a5ef0a68)
Selector.cpp
Go to the documentation of this file.
1 //====================================================================
2 // NTuple name space: Selector class implementation
3 //--------------------------------------------------------------------
4 //
5 // Package : Gaudi/NTupleSvc ( The LHCb Offline System)
6 // Author : M.Frank
7 //
8 // +---------+----------------------------------------------+--------+
9 // | Date | Comment | Who |
10 // +---------+----------------------------------------------+--------+
11 // | 10/10/00| Initial version. | MF |
12 // +---------+----------------------------------------------+--------+
13 //====================================================================
14 #define GAUDI_NTUPLEITEMS_CPP 1
15 
16 #include "GaudiKernel/Selector.h"
17 #include "GaudiKernel/NTuple.h"
18 
21 
24 {
25  DataObject* p = static_cast<DataObject*>( nt );
26  bool result = false;
27  try {
28  NTuple::Tuple* tuple = dynamic_cast<NTuple::Tuple*>( p );
29  if ( tuple ) {
30  if ( m_firstCall ) {
31  m_status = initialize( tuple );
32  m_firstCall = false;
33  }
34  if ( m_status.isSuccess() ) {
35  result = this->operator()( tuple );
36  }
37  }
38  } catch ( ... ) {
39  }
40  return result;
41 }
42 
44 bool NTuple::Selector::operator()( NTuple::Tuple* /* nt */ ) { return true; }
bool isSuccess() const
Definition: StatusCode.h:287
virtual StatusCode initialize(NTuple::Tuple *nt)
Selector Initialization.
Definition: Selector.cpp:20
bool m_firstCall
Boolean to indicate need for initialization.
Definition: Selector.h:37
StatusCode m_status
StatusCode indication initialization result.
Definition: Selector.h:39
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:407
bool operator()(void *nt) override
Default callback from interface.
Definition: Selector.cpp:23
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30