Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012
Public Member Functions | Protected Member Functions | Private Attributes

Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 > Class Template Reference

The simplest concrete implementation of class TupleObj with 3 arbitrary error handlers Any types (classes, functions, etc.) which supports the semantics. More...

#include <TupleDetail.h>

Inheritance diagram for Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >:
Inheritance graph
[legend]
Collaboration diagram for Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TupleObjImp (HANDLER1 handler1, HANDLER2 handler2, const std::string &name, NTuple::Tuple *tuple, const CLID &clid=CLID_ColumnWiseTuple, const Tuples::Type type=Tuples::NTUPLE)
 constructor
virtual StatusCode Error (const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const
virtual StatusCode Warning (const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const

Protected Member Functions

virtual ~TupleObjImp ()
 empty protected destructor

Private Attributes

HANDLER1 m_handler1
HANDLER2 m_handler2

Detailed Description

template<class HANDLER1, class HANDLER2>
class Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >

The simplest concrete implementation of class TupleObj with 3 arbitrary error handlers Any types (classes, functions, etc.) which supports the semantics.

     HANDLER obj = .. ;

     StatusCode obj( msg , sc )

can be used as error handler, e.g.

   void print_error   ( const std::string& msg , StatusCode sc )
    { std::cout <<
      "Error"   << msg << " code " << sc.getCode() << std::endl ; }
   void print_warning ( const std::string& msg , StatusCode sc )
    { std::cout <<
      "Warning" << msg << " code " << sc.getCode() << std::endl ; }
   void print_print   ( const std::string& msg , StatusCode sc )
    { std::cout << msg << " code " << sc.getCode() << std::endl ; }

   NTuple::Tuple* tuple = ... ;
   TupleObj* obj =
    createTupleObj( print_errror   ,
                    print_warning  ,
                    print_print    ,
                    " my tuple "   , ntuple ) ;

Templated helper functions allow to avoid heavy semantics of dealing with explicit type

Few concrete error handlers for dealing with classes, which supports member functions Error and Warning ( e.g. class GaudiAlgorithm or class GaudiTool ) are provided

Author:
Vanya BELYAEV Ivan.Belyaev@itep.ru
Date:
2004-1-24

Definition at line 79 of file TupleDetail.h.


Constructor & Destructor Documentation

template<class HANDLER1, class HANDLER2>
Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::TupleObjImp ( HANDLER1  handler1,
HANDLER2  handler2,
const std::string name,
NTuple::Tuple tuple,
const CLID clid = CLID_ColumnWiseTuple,
const Tuples::Type  type = Tuples::NTUPLE 
) [inline]

constructor

Parameters:
handler1error handler
handler2warning handler
nameName of the NTuple
tupleNTuple itself
clidNTuple CLID
typeNTuple type

Definition at line 90 of file TupleDetail.h.

        : TupleObj ( name , tuple , clid, type )
        , m_handler1 ( handler1 )
        , m_handler2 ( handler2 )
      {}
template<class HANDLER1, class HANDLER2>
virtual Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::~TupleObjImp (  ) [inline, protected, virtual]

empty protected destructor

Definition at line 114 of file TupleDetail.h.

{}

Member Function Documentation

template<class HANDLER1, class HANDLER2>
virtual StatusCode Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::Error ( const std::string msg,
const StatusCode  sc = StatusCode::FAILURE 
) const [inline, virtual]

Implements Tuples::TupleObj.

Definition at line 103 of file TupleDetail.h.

      { m_handler1 ( name() + " " + msg , sc  ) ; return sc ; }
template<class HANDLER1, class HANDLER2>
virtual StatusCode Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::Warning ( const std::string msg,
const StatusCode  sc = StatusCode::FAILURE 
) const [inline, virtual]

Implements Tuples::TupleObj.

Definition at line 108 of file TupleDetail.h.

      { m_handler2 ( name() + " " + msg , sc  ) ; return sc ; }

Member Data Documentation

template<class HANDLER1, class HANDLER2>
HANDLER1 Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::m_handler1 [private]

Definition at line 116 of file TupleDetail.h.

template<class HANDLER1, class HANDLER2>
HANDLER2 Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::m_handler2 [private]

Definition at line 117 of file TupleDetail.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Jan 30 2012 13:53:37 for Gaudi Framework, version v23r0 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004