The Gaudi Framework  master (37c0b60a)
NTuple::Selector Class Reference

NTuple Selector class. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/Selector.h>

Inheritance diagram for NTuple::Selector:
Collaboration diagram for NTuple::Selector:

Public Member Functions

 Selector (IInterface *svc)
 Standard constructor. More...
 
virtual ~Selector ()=default
 Standard Destructor. More...
 
bool firstCall () const
 Check for first call. More...
 
StatusCode initResult () const
 Access initialization status. More...
 
bool operator() (void *nt) override
 Default callback from interface. More...
 
virtual bool operator() (NTuple::Tuple *nt)
 Specialized callback for NTuples. More...
 
virtual StatusCode initialize (NTuple::Tuple *nt)
 Selector Initialization. More...
 
- Public Member Functions inherited from SelectStatement
 SelectStatement (const std::string &s, long typ)
 Standard Constructor initializing select string. More...
 
 SelectStatement (const std::string &s)
 Standard Constructor initializing select string. More...
 
 SelectStatement ()
 Standard Constructor initializing function call. More...
 
virtual ~SelectStatement ()
 Standard Destructor. More...
 
long type () const override
 Access the type of the object. More...
 
const std::stringcriteria () const override
 Access the selection string. More...
 
void setCriteria (const std::string &crit) override
 Set the type. More...
 
void setActive (bool flag=true) override
 Change activity flag. More...
 
bool isActive () const override
 Check if selection is active. More...
 
- Public Member Functions inherited from implements< ISelectStatement >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
unsigned long addRef () override
 Reference Interface instance
More...
 
unsigned long release () override
 Release Interface instance
More...
 
unsigned long refCount () const override
 Current reference count
More...
 

Protected Attributes

IInterfacem_parent
 reference to parent interface More...
 
bool m_firstCall
 Boolean to indicate need for initialization. More...
 
StatusCode m_status
 StatusCode indication initialization result. More...
 
- Protected Attributes inherited from SelectStatement
std::string m_select
 Select string. More...
 
bool m_isActive
 Activation flag. More...
 
long m_type
 Type identifier. More...
 
- Protected Attributes inherited from implements< ISelectStatement >
std::atomic_ulong m_refCount
 Reference counter
More...
 

Additional Inherited Members

- Public Types inherited from implements< ISelectStatement >
using base_class = implements< Interfaces... >
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

NTuple Selector class.

Definition at line 39 of file Selector.h.

Constructor & Destructor Documentation

◆ Selector()

NTuple::Selector::Selector ( IInterface svc)
inline

Standard constructor.

Definition at line 50 of file Selector.h.

50 : m_parent( svc ), m_firstCall( true ) {}

◆ ~Selector()

virtual NTuple::Selector::~Selector ( )
virtualdefault

Standard Destructor.

Member Function Documentation

◆ firstCall()

bool NTuple::Selector::firstCall ( ) const
inline

Check for first call.

Definition at line 54 of file Selector.h.

54 { return m_firstCall; }

◆ initialize()

StatusCode NTuple::Selector::initialize ( NTuple::Tuple nt)
virtual

Selector Initialization.

Selector Initialisation.

Reimplemented in Gaudi::TestSuite::EvtCollectionSelector.

Definition at line 30 of file Selector.cpp.

30 { return StatusCode::SUCCESS; }

◆ initResult()

StatusCode NTuple::Selector::initResult ( ) const
inline

Access initialization status.

Definition at line 56 of file Selector.h.

56 { return m_status; }

◆ operator()() [1/2]

bool NTuple::Selector::operator() ( NTuple::Tuple nt)
virtual

Specialized callback for NTuples.

Specialized overload for N-tuples.

Reimplemented in Gaudi::TestSuite::EvtCollectionSelector.

Definition at line 50 of file Selector.cpp.

50 { return true; }

◆ operator()() [2/2]

bool NTuple::Selector::operator() ( void *  nt)
overridevirtual

Default callback from interface.

Overloaded callback from SelectStatement.

Reimplemented from SelectStatement.

Definition at line 33 of file Selector.cpp.

33  {
34  DataObject* p = static_cast<DataObject*>( nt );
35  bool result = false;
36  try {
37  NTuple::Tuple* tuple = dynamic_cast<NTuple::Tuple*>( p );
38  if ( tuple ) {
39  if ( m_firstCall ) {
40  m_status = initialize( tuple );
41  m_firstCall = false;
42  }
43  if ( m_status.isSuccess() ) { result = this->operator()( tuple ); }
44  }
45  } catch ( ... ) {}
46  return result;
47 }

Member Data Documentation

◆ m_firstCall

bool NTuple::Selector::m_firstCall
protected

Boolean to indicate need for initialization.

Definition at line 44 of file Selector.h.

◆ m_parent

IInterface* NTuple::Selector::m_parent
protected

reference to parent interface

Definition at line 42 of file Selector.h.

◆ m_status

StatusCode NTuple::Selector::m_status
protected

StatusCode indication initialization result.

Definition at line 46 of file Selector.h.


The documentation for this class was generated from the following files:
NTuple::Selector::m_parent
IInterface * m_parent
reference to parent interface
Definition: Selector.h:42
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
NTuple::Selector::operator()
bool operator()(void *nt) override
Default callback from interface.
Definition: Selector.cpp:33
NTuple::Selector::initialize
virtual StatusCode initialize(NTuple::Tuple *nt)
Selector Initialization.
Definition: Selector.cpp:30
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:388
DataObject
Definition: DataObject.h:36
NTuple::Selector::m_status
StatusCode m_status
StatusCode indication initialization result.
Definition: Selector.h:46
NTuple::Selector::m_firstCall
bool m_firstCall
Boolean to indicate need for initialization.
Definition: Selector.h:44