| The Gaudi Framework v32r1 (f65d50dc)

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
20 StatusCode NTuple::Selector::initialize( NTuple::Tuple* /* nt */ ) { return StatusCode::SUCCESS; }
21
23 bool NTuple::Selector::operator()( void* nt ) {
24 DataObject* p = static_cast<DataObject*>( nt );
25 bool result = false;
26 try {
27 NTuple::Tuple* tuple = dynamic_cast<NTuple::Tuple*>( p );
28 if ( tuple ) {
29 if ( m_firstCall ) {
30 m_status = initialize( tuple );
31 m_firstCall = false;
32 }
33 if ( m_status.isSuccess() ) { result = this->operator()( tuple ); }
34 }
35 } catch ( ... ) {}
36 return result;
37 }
38
40 bool NTuple::Selector::operator()( NTuple::Tuple* /* nt */ ) { return true; }
NTuple.h
NTuple::Selector::initialize
virtual StatusCode initialize(NTuple::Tuple *nt)
Selector Initialization.
Definition: Selector.cpp:20
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:375
NTuple::Selector::operator()
bool operator()(void *nt) override
Default callback from interface.
Definition: Selector.cpp:23
Selector.h
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30