The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
SelectStatement Class Reference

Class of a selection statement. More...

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

Inheritance diagram for SelectStatement:
Collaboration diagram for SelectStatement:

Public Member Functions

 SelectStatement (const std::string &s, long typ)
 Standard Constructor initializing select string.
 
 SelectStatement (const std::string &s)
 Standard Constructor initializing select string.
 
 SelectStatement ()
 Standard Constructor initializing function call.
 
virtual ~SelectStatement ()
 Standard Destructor.
 
long type () const override
 Access the type of the object.
 
const std::string & criteria () const override
 Access the selection string.
 
void setCriteria (const std::string &crit) override
 Set the type.
 
void setActive (bool flag=true) override
 Change activity flag.
 
bool isActive () const override
 Check if selection is active.
 
virtual bool operator() (void *) override
 Stupid default implementation.
 
- Public Member Functions inherited from implements< ISelectStatement >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
 implements ()=default
 Default constructor.
 
 implements (const implements &)
 Copy constructor (zero the reference count)
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count).
 
unsigned long addRef () const override
 Reference Interface instance.
 
unsigned long release () const override
 Release Interface instance.
 
unsigned long refCount () const override
 Current reference count.
 

Protected Attributes

std::string m_select
 Select string.
 
bool m_isActive
 Activation flag.
 
long m_type
 Type identifier.
 
- Protected Attributes inherited from implements< ISelectStatement >
std::atomic_ulong m_refCount
 Reference counter.
 

Additional Inherited Members

- Public Types inherited from implements< ISelectStatement >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
using iids
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 
- Protected Member Functions inherited from implements< ISelectStatement >
unsigned long decRef () const override
 

Detailed Description

Class of a selection statement.

A select statement can either contain

  • a string e.g. for refining an SQL statement
  • a function object, which will be called back in order to refine a selection. This happens in calling sequences like the following:

bool MySelect::operator()(IValueLocator* l) { float px, py, pz; if ( l->get("PX",px) && l->get("PY",py) && l->get("PZ",pz) ) { float mom = sqrt(px*px+py*py+pz*pz); return mom > 100.0 * GeV; } return false; }

if "true" is returned, the object will be loaded completely.

History: +------—+-------------------------------------------—+-----—+ | Date | Comment | Who | +------—+-------------------------------------------—+-----—+ | 21/10/99| Initial version. | MF | +------—+-------------------------------------------—+-----—+ Author: M.Frank Version: 1.0

Definition at line 43 of file SelectStatement.h.

Constructor & Destructor Documentation

◆ SelectStatement() [1/3]

SelectStatement::SelectStatement ( const std::string & s,
long typ )
inlineexplicit

Standard Constructor initializing select string.

Definition at line 46 of file SelectStatement.h.

46: m_select( s ), m_isActive( false ), m_type( typ ) {}
long m_type
Type identifier.
std::string m_select
Select string.
bool m_isActive
Activation flag.

◆ SelectStatement() [2/3]

SelectStatement::SelectStatement ( const std::string & s)
inlineexplicit

Standard Constructor initializing select string.

Definition at line 48 of file SelectStatement.h.

48: m_select( s ), m_isActive( false ), m_type( STRING ) {}

◆ SelectStatement() [3/3]

SelectStatement::SelectStatement ( )
inlineexplicit

Standard Constructor initializing function call.

Definition at line 50 of file SelectStatement.h.

50: m_isActive( false ), m_type( FUNCTION ) {}

◆ ~SelectStatement()

virtual SelectStatement::~SelectStatement ( )
inlinevirtual

Standard Destructor.

Definition at line 52 of file SelectStatement.h.

52{}

Member Function Documentation

◆ criteria()

const std::string & SelectStatement::criteria ( ) const
inlineoverride

Access the selection string.

Definition at line 56 of file SelectStatement.h.

56{ return m_select; }

◆ isActive()

bool SelectStatement::isActive ( ) const
inlineoverride

Check if selection is active.

Definition at line 65 of file SelectStatement.h.

65{ return m_isActive; }

◆ operator()()

virtual bool SelectStatement::operator() ( void * )
inlineoverridevirtual

Stupid default implementation.

Reimplemented in Gaudi::TestSuite::EvtCollectionSelector, and NTuple::Selector.

Definition at line 67 of file SelectStatement.h.

67{ return true; }

◆ setActive()

void SelectStatement::setActive ( bool flag = true)
inlineoverride

Change activity flag.

Definition at line 63 of file SelectStatement.h.

63{ m_isActive = flag; }

◆ setCriteria()

void SelectStatement::setCriteria ( const std::string & crit)
inlineoverride

Set the type.

Definition at line 58 of file SelectStatement.h.

58 {
59 m_select = crit;
60 ( m_select.length() > 0 ) ? m_type |= STRING : m_type &= ~STRING;
61 }

◆ type()

long SelectStatement::type ( ) const
inlineoverride

Access the type of the object.

Definition at line 54 of file SelectStatement.h.

54{ return m_type; }

Member Data Documentation

◆ m_isActive

bool SelectStatement::m_isActive
protected

Activation flag.

Definition at line 73 of file SelectStatement.h.

◆ m_select

std::string SelectStatement::m_select
protected

Select string.

Definition at line 71 of file SelectStatement.h.

◆ m_type

long SelectStatement::m_type
protected

Type identifier.

Definition at line 75 of file SelectStatement.h.


The documentation for this class was generated from the following file: