All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Tuples.h
Go to the documentation of this file.
1 // $Id: Tuples.h,v 1.5 2006/03/09 10:28:15 hmd Exp $
2 // ============================================================================
3 #ifndef GAUDIALG_TUPLES_H
4 #define GAUDIALG_TUPLES_H 1
5 // ============================================================================
6 // GaudiAlg
7 // ============================================================================
8 #include "GaudiAlg/TupleObj.h"
9 // ============================================================================
10 
18 namespace Tuples
19 {
20  class Tuple ;
21  class TupleObj ;
22 } // end of namespace Tuples
23 
24 
25 namespace Tuples
26 {
34  template <class OBJECT,class ARGUMENT=double, class RESULT=double>
35  class _TupAdapter : public std::unary_function<ARGUMENT,RESULT>
36  {
37  public:
38  // constructor
39  _TupAdapter ( OBJECT object ) : m_object ( object ) {} ;
40  public:
42  inline RESULT operator() ( ARGUMENT arg ) const
43  { return m_object( arg ) ; }
44  private:
45  // default constructor is disabled
46  _TupAdapter();
47  private:
49  };
50 
79  template <class OBJECT>
81  { return _TupAdapter<OBJECT,double,double>( object ) ; }
82 
83 } // end of namespace Tuples
84 
85 #endif // GAUDIALG_TUPLES_H
_TupAdapter< OBJECT, double, double > useFun(OBJECT object)
trivial helper function to convert on flight pointer to function into "functor" It is especially usef...
Definition: Tuples.h:80
Header file for class TupleObj.
RESULT operator()(ARGUMENT arg) const
the only one essential menthod
Definition: Tuples.h:42
Trivial adapter to avoid the GCC problem (pointer to the function is never evaluated as "const TYPE&"...
Definition: Tuples.h:35
_TupAdapter(OBJECT object)
Definition: Tuples.h:39
OBJECT m_object
Definition: Tuples.h:48
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31