| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# 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. More...

`#include <TupleDetail.h>`

Inheritance diagram for Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >:
[legend]
Collaboration diagram for Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >:
[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:

  | handler1 | error handler
  | handler2 | warning handler
  | name | Name of the NTuple
  | tuple | NTuple itself
  | clid | NTuple CLID
  | type | NTuple type

Definition at line 90 of file TupleDetail.h.

    00096         : TupleObj ( name , tuple , clid, type )
    00097         , m_handler1 ( handler1 )
    00098         , m_handler2 ( handler2 )
    00099       {}

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.

    00114 {}

## 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.

    00105       { 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.

    00110       { 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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r11/GaudiAlg/GaudiAlg/TupleDetail.h