All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 <GaudiAlg/TupleDetail.h>

Inheritance diagram for Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >:
Collaboration diagram for Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >:

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 More...
 
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
 
- Public Member Functions inherited from Tuples::TupleObj
StatusCode column (const std::string &name, const float value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const double value)
 Set the value for the selected tuple column If the column does not exist, it will be automatically created and appended to the tuple. More...
 
StatusCode column (const std::string &name, const short value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const short value, const short minv, const short maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned short value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned short value, const unsigned short minv, const unsigned short maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const char value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const char value, const char minv, const char maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned char value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned char value, const unsigned char minv, const unsigned char maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const int value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const int value, const int minv, const int maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned int value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned int value, const unsigned int minv, const unsigned int maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const long value)
 Set the value for the selected tuple column. More...
 
StatusCode column (const std::string &name, const long value, const long minv, const long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned long value, const unsigned long minv, const unsigned long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const long long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const long long value, const long long minv, const long long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned long long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const unsigned long long value, const unsigned long long minv, const unsigned long long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, const signed char value)
 Set the value for the selected tuple column. More...
 
StatusCode column (const std::string &name, const bool value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, IOpaqueAddress *address)
 Put IOpaqueAddress in POOL-based NTuple. More...
 
StatusCode column (IOpaqueAddress *address)
 Put IOpaqueAddress in NTuple. More...
 
StatusCode fill (const char *format...)
 Set the values for several columns simultaneously. More...
 
template<class DATA >
StatusCode farray (const std::string &name, DATA first, DATA last, const std::string &length, const size_t maxv)
 Add an indexed array (of type float) to N-tuple. More...
 
template<class DATA >
StatusCode farray (const std::string &name, const DATA &data, const std::string &length, const size_t maxv)
 Add an indexed array (of type float) to N-tuple. More...
 
template<class FUNCTION , class DATA >
StatusCode farray (const std::string &name, const FUNCTION &function, DATA first, DATA last, const std::string &length, const size_t maxv)
 Put an indexed array into LoKi-style N-Tuple. More...
 
template<class FUNC1 , class FUNC2 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, DATA first, DATA last, const std::string &length, const size_t maxv)
 Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class FUNC1 , class FUNC2 , class FUNC3 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, DATA first, DATA last, const std::string &length, const size_t maxv)
 Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class FUNC1 , class FUNC2 , class FUNC3 , class FUNC4 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, const std::string &name4, const FUNC4 &func4, DATA first, DATA last, const std::string &length, const size_t maxv)
 Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class MATRIX >
StatusCode fmatrix (const std::string &name, const MATRIX &data, size_t rows, const MIndex &cols, const std::string &length, const size_t maxv)
 Fill N-Tuple with data from variable-size matrix. More...
 
template<class DATA >
StatusCode fmatrix (const std::string &name, DATA first, DATA last, const MIndex &cols, const std::string &length, const size_t maxv)
 Fill N-Tuple with data from variable-size matrix. More...
 
template<class FUN , class DATA >
StatusCode fmatrix (const std::string &name, FUN funF, FUN funL, DATA first, DATA last, const std::string &length, const size_t maxv)
 fill N-Tuple with matrix of "direct-product" of "data-vector" [first,last) and "function-vector" [funF, funL) More...
 
template<class DATA >
StatusCode array (const std::string &name, DATA first, DATA last)
 fill N-Tuple with fixed-size array More...
 
template<class ARRAY >
StatusCode array (const std::string &name, const ARRAY &data, const MIndex &length)
 fill N-Tuple with fixed-size array More...
 
template<class ARRAY >
StatusCode array (const std::string &name, const ARRAY &data)
 fill N-Tuple with fixed-size array More...
 
template<class MATRIX >
StatusCode matrix (const std::string &name, const MATRIX &data, const MIndex &rows, const MIndex &cols)
 fill N-Tuple with fixed-size matrix More...
 
template<class TYPE >
StatusCode column (const std::string &name, const ROOT::Math::LorentzVector< TYPE > &v)
 Useful shortcut to put LorentzVector directly into N-Tuple: More...
 
template<class TYPE , class TAG >
StatusCode column (const std::string &name, const ROOT::Math::DisplacementVector3D< TYPE, TAG > &v)
 Useful shortcut to put 3D-Vector directly into N-Tuple: More...
 
template<class TYPE , class TAG >
StatusCode column (const std::string &name, const ROOT::Math::PositionVector3D< TYPE, TAG > &v)
 Useful shortcut to put 3D-Vector directly into N-Tuple: More...
 
template<class TYPE , unsigned int DIM>
StatusCode array (const std::string &name, const ROOT::Math::SVector< TYPE, DIM > &vect)
 shortcut to put SVector into N-tuple: More...
 
template<class TYPE , unsigned int D1, unsigned int D2, class REP >
StatusCode matrix (const std::string &name, const ROOT::Math::SMatrix< TYPE, D1, D2, REP > &mtrx)
 shortcut to put Smatrix into N-tuple: More...
 
template<class KEY , class VALUE >
StatusCode fmatrix (const std::string &name, const GaudiUtils::VectorMap< KEY, VALUE > &info, const std::string &length, const size_t maxv=100)
 shortcut to put "ExtraInfo" fields of major into N-Tuple More...
 
template<class TYPE >
StatusCode put (const std::string &name, const TYPE *obj)
 The function allows to add almost arbitrary object into N-tuple. More...
 
StatusCode write ()
 write a record to NTuple More...
 
const std::string & name () const
 get the name More...
 
NTuple::Tupletuple () const
 provide the access to underlying Gaudi N-tuple More...
 
unsigned long refCount () const
 return the reference counter More...
 
unsigned long addRef ()
 add the reference to TupleObj More...
 
void release ()
 release the reference to TupleObj if reference counter becomes zero, object will be automatically deleted More...
 
const CLIDclid () const
 accessor to the N-Tuple CLID More...
 
Tuples::Type type () const
 accessor to the N-Tuple type More...
 
bool columnWise () const
 column wise NTuple ? More...
 
bool rowWise () const
 row wise NTuple ? More...
 
bool evtColType () const
 Event collection ? More...
 
bool valid () const
 valid pointer to tuple ? More...
 
bool invalid () const
 invalid pointer to tuple ? More...
 
bool addItem (const std::string &name, const std::string &type)
 add the item name into the list of known items More...
 
bool goodItem (const std::string &name) const
 check the uniqueness of the name More...
 
const ItemMapitems () const
 get the full list of booked items More...
 

Protected Member Functions

virtual ~TupleObjImp ()
 empty protected destructor More...
 
- Protected Member Functions inherited from Tuples::TupleObj
 TupleObj (const std::string &name, NTuple::Tuple *tuple, const CLID &clid=CLID_ColumnWiseTuple, const Tuples::Type type=Tuples::NTUPLE)
 Standard constructor. More...
 
virtual ~TupleObj ()
 destructor is protected More...
 

Private Attributes

HANDLER1 m_handler1
 
HANDLER2 m_handler2
 

Additional Inherited Members

- Public Types inherited from Tuples::TupleObj
typedef NTuple::Item< bool > Bool
 basic type for int items More...
 
typedef NTuple::Item< char > Char
 basic type for int items More...
 
typedef NTuple::Item< unsigned
char > 
UChar
 basic type for unsigned int items More...
 
typedef NTuple::Item< short > Short
 basic type for int items More...
 
typedef NTuple::Item< unsigned
short > 
UShort
 basic type for unsigned int items More...
 
typedef NTuple::Item< int > Int
 basic type for int items More...
 
typedef NTuple::Item< unsigned
int > 
UInt
 basic type for unsigned int items More...
 
typedef NTuple::Item< long long > LongLong
 basic type for unsigned long long items More...
 
typedef NTuple::Item< unsigned
long long > 
ULongLong
 basic type for unsigned long long items More...
 
typedef NTuple::Item< float > Float
 basic type for float items More...
 
typedef NTuple::Item< double > Double
 basic type for double items More...
 
typedef NTuple::Item
< IOpaqueAddress * > 
Address
 basic type for address items More...
 
typedef NTuple::Array< float > FArray
 basic type for array of floats More...
 
typedef NTuple::Matrix< float > FMatrix
 basic type for matrix of floats More...
 
typedef unsigned short MIndex
 
typedef std::map< std::string,
std::string > 
ItemMap
 

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 ; }
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..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.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.

96  : TupleObj ( name , tuple , clid, type )
97  , m_handler1 ( handler1 )
98  , m_handler2 ( handler2 )
99  {}
TupleObj()
the default constructor is disabled
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:2110
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:2107
const std::string & name() const
get the name
Definition: TupleObj.h:2083
template<class HANDLER1, class HANDLER2>
virtual Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::~TupleObjImp ( )
inlineprotectedvirtual

empty protected destructor

Definition at line 114 of file TupleDetail.h.

114 {}

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
inlinevirtual

Implements Tuples::TupleObj.

Definition at line 103 of file TupleDetail.h.

105  { m_handler1 ( name() + " " + msg , sc ) ; return sc ; }
const std::string & name() const
get the name
Definition: TupleObj.h:2083
template<class HANDLER1, class HANDLER2>
virtual StatusCode Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >::Warning ( const std::string &  msg,
const StatusCode  sc = StatusCode::FAILURE 
) const
inlinevirtual

Implements Tuples::TupleObj.

Definition at line 108 of file TupleDetail.h.

110  { m_handler2 ( name() + " " + msg , sc ) ; return sc ; }
const std::string & name() const
get the name
Definition: TupleObj.h:2083

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: