Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:00:32

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 #ifndef GAUDIKERNEL_ISELECTSTATEMENT_H
0012 #define GAUDIKERNEL_ISELECTSTATEMENT_H
0013 
0014 // STL include files
0015 #include <string>
0016 
0017 // Framework include files
0018 #include "GaudiKernel/IInterface.h"
0019 
0020 /** @class ISelectStatement ISelectStatement.h GaudiKernel/ISelectStatement.h
0021 
0022   A select statement can either contain
0023   - a string e.g. for refining an SQL statement
0024   - a function object, which will be called back
0025     in order to refine a selection.
0026     This happens in calling sequences like the following:
0027 
0028   bool MySelect::operator()(IValueLocator* l)   {
0029     float px, py, pz;
0030     if ( l->get("PX",px) && l->get("PY",py) && l->get("PZ",pz) )  {
0031       float mom = sqrt(px*px+py*py+pz*pz);
0032       return mom > 100.0 * GeV;
0033     }
0034     return false;
0035   }
0036 
0037     if "true" is returned, the object will be loaded completely.
0038 
0039     @author  M.Frank
0040     @version 1.0
0041 */
0042 class GAUDI_API ISelectStatement : virtual public IInterface {
0043 public:
0044   /// InterfaceID
0045   DeclareInterfaceID( ISelectStatement, 2, 0 );
0046 
0047   /// Statement type definition
0048   enum SelectType { FUNCTION = 1 << 1, STRING = 1 << 2, FULL = 1 << 3, OTHER = 1 << 4 };
0049 
0050 public:
0051   /// Access the type of the object
0052   virtual long type() const = 0;
0053   /// Access the selection string
0054   virtual const std::string& criteria() const = 0;
0055   /// Set the type
0056   virtual void setCriteria( const std::string& crit ) = 0;
0057   /// Change activity flag
0058   virtual void setActive( bool flag = true ) = 0;
0059   /// Check if selection is active
0060   virtual bool isActive() const = 0;
0061   /// Stupid default implementation
0062   virtual bool operator()( void* val ) = 0;
0063 };
0064 
0065 #endif // GAUDIKERNEL_ISELECTSTATEMENT_H