All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
NTuple::TupleImp Class Reference

#include <GaudiKernel/NTupleImplementation.h>

Inheritance diagram for NTuple::TupleImp:
Collaboration diagram for NTuple::TupleImp:

Public Member Functions

virtual INTupleItemi_find (const std::string &name) const
 Internally used by abstract classes. More...
 
 TupleImp (const std::string &title)
 Standard Constructor. More...
 
virtual ~TupleImp ()
 Standard Destructor. More...
 
ItemContaineritems ()
 Access item container. More...
 
const ItemContaineritems () const
 Access item container (CONST) More...
 
virtual const std::string & title () const
 Object title. More...
 
virtual const INTupleItemfind (const std::string &name) const
 Find an item row of the Ntuple (CONST) More...
 
virtual INTupleItemfind (const std::string &name)
 Find an item row of the Ntuple. More...
 
char * buffer ()
 Access N tuple data buffer. More...
 
const char * buffer () const
 Access N tuple data buffer (CONST) More...
 
IConversionSvcconversionService () const
 Access conversion service. More...
 
void setConversionService (IConversionSvc *svc)
 Access conversion service. More...
 
INTupleSvctupleService () const
 Access conversion service. More...
 
void setTupleService (INTupleSvc *svc)
 Access conversion service. More...
 
virtual StatusCode attachSelector (ISelectStatement *sel)
 Attach selector. More...
 
virtual ISelectStatementselector ()
 Access selector. More...
 
virtual void setBuffer (char *buff)
 Set N tuple data buffer. More...
 
virtual void reset ()
 Reset all entries to their default values. More...
 
virtual StatusCode add (INTupleItem *item)
 Add an item row to the N tuple. More...
 
virtual StatusCode remove (INTupleItem *item)
 Remove an item row (identified by pointer) from the N tuple. More...
 
virtual StatusCode remove (const std::string &name)
 Remove an item row (identified by name) from the N tuple. More...
 
virtual StatusCode write ()
 Write record of the NTuple (Shortcut of writeRecord) More...
 
virtual StatusCode writeRecord ()
 Write record of the NTuple. More...
 
virtual StatusCode read ()
 Read record of the NTuple (Shortcut of readRecord) More...
 
virtual StatusCode readRecord ()
 Read record of the NTuple. More...
 
virtual StatusCode save ()
 Save the NTuple. More...
 
- Public Member Functions inherited from NTuple::Tuple
virtual ~Tuple ()
 Standard destructor. More...
 
template<class TYPE >
StatusCode item (const std::string &name, Item< TYPE > &result)
 Locate a scalar Item of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode item (const std::string &name, const Item< TYPE > &result) const
 Locate a scalar Item of data to the N tuple type safe (CONST) More...
 
template<class TYPE >
StatusCode item (const std::string &name, Array< TYPE > &result)
 Locate a Array of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode item (const std::string &name, const Array< TYPE > &result) const
 Locate a Array of data to the N tuple type safe (CONST) More...
 
template<class TYPE >
StatusCode item (const std::string &name, Matrix< TYPE > &result)
 Locate a Matrix of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode item (const std::string &name, const Matrix< TYPE > &result) const
 Locate a Matrix of data to the N tuple type safe (CONST) More...
 
template<class TYPE >
StatusCode addItem (const std::string &name, Item< TYPE > &itm)
 Add a scalar data item a N tuple. More...
 
template<class TYPE >
StatusCode addItem (const std::string &name, Item< TYPE * > &itm)
 Add an simple object item to an N tuple. More...
 
StatusCode addItem (const std::string &name, Item< IOpaqueAddress * > &itm)
 Add an address object item to an N tuple: specialized call. More...
 
template<class TYPE , class RANGE >
StatusCode addItem (const std::string &name, Item< TYPE > &itm, const RANGE low, const RANGE high)
 Add a scalar data item a N tuple with a range. More...
 
template<class TYPE >
StatusCode addItem (const std::string &name, long dim, Array< TYPE > &array)
 Add an fixed-size Array of data to a column wise N tuple. More...
 
template<class TYPE , class RANGE >
StatusCode addItem (const std::string &name, long dim, Array< TYPE > &array, const RANGE low, const RANGE high)
 Add an fixed-size Array of data to a column wise N tuple with a range. More...
 
template<class TYPE , class INDEX , class RANGE >
StatusCode addItem (const std::string &name, Item< INDEX > &index, Array< TYPE > &array, const RANGE low, const RANGE high)
 Add an indexed Array of data to a column wise N tuple with a range. More...
 
template<class TYPE , class INDEX , class RANGE >
StatusCode addIndexedItem (const std::string &name, Item< INDEX > &index, Array< TYPE > &array, const RANGE low, const RANGE high)
 Add an indexed Array of data to a column wise N tuple with a range. More...
 
template<class TYPE , class INDEX >
StatusCode addItem (const std::string &name, Item< INDEX > &index, Array< TYPE > &array)
 Add an indexed Array of data to a column wise N tuple. More...
 
template<class TYPE , class INDEX >
StatusCode addIndexedItem (const std::string &name, Item< INDEX > &index, Array< TYPE > &array)
 Add an indexed Array of data to a column wise N tuple. More...
 
template<class TYPE >
StatusCode addItem (const std::string &name, long cols, long rows, Matrix< TYPE > &matrix)
 Add an fixed size Matrix of data to a column wise N tuple. More...
 
template<class TYPE , class RANGE >
StatusCode addItem (const std::string &name, long cols, long rows, Matrix< TYPE > &result, const RANGE low, const RANGE high)
 Add an fixed size Matrix of data to a column wise N tuple. More...
 
template<class TYPE , class INDEX >
StatusCode addItem (const std::string &name, Item< INDEX > &index, Matrix< TYPE > &matrix, long rows)
 Add an variable size Matrix of data to a column wise N tuple. More...
 
template<class TYPE , class INDEX >
StatusCode addIndexedItem (const std::string &name, Item< INDEX > &col_index, long rows, Matrix< TYPE > &matrix)
 Add an variable size Matrix of data to a column wise N tuple. More...
 
template<class TYPE , class INDEX , class RANGE >
StatusCode addItem (const std::string &name, Item< INDEX > &index, Matrix< TYPE > &matrix, long rows, const RANGE low, const RANGE high)
 Add an variable size Matrix of data to a column wise N tuple. More...
 
template<class TYPE , class INDEX , class RANGE >
StatusCode addIndexedItem (const std::string &name, Item< INDEX > &index, long rows, Matrix< TYPE > &matrix, const RANGE low, const RANGE high)
 Add an variable size Matrix of data to a column wise N tuple. More...
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &)
 Copy Constructor. More...
 
virtual ~DataObject ()
 Standard Destructor. More...
 
virtual unsigned long addRef ()
 Add reference to object. More...
 
virtual unsigned long release ()
 release reference to object More...
 
virtual const CLIDclID () const
 Retrieve reference to class definition structure. More...
 
const std::string & name () const
 Retreive DataObject name. It is the name when registered in the store. More...
 
virtual StatusCode update ()
 Provide empty placeholder for internal object reconfiguration callback. More...
 
void setRegistry (IRegistry *pRegistry)
 Set pointer to Registry. More...
 
IRegistryregistry () const
 Get pointer to Registry. More...
 
LinkManagerlinkMgr () const
 Retrieve Link manager. More...
 
unsigned char version () const
 Retrieve version number of this object representation. More...
 
void setVersion (unsigned char vsn)
 Set version number of this object representation. More...
 
unsigned long refCount () const
 Return the refcount. More...
 
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the output stream (ASCII) More...
 
- Public Member Functions inherited from INTuple
virtual ~INTuple ()
 

Protected Attributes

ItemContainer m_items
 Container with N tuple _Columns. More...
 
bool m_isBooked
 Flag wether N tuple is booked. More...
 
std::string m_title
 N tuple title. More...
 
ISelectStatementm_pSelector
 Possibly hanging selector. More...
 
char * m_buffer
 Buffer size. More...
 
INTupleSvcm_ntupleSvc
 Reference to N-tuple service used. More...
 
IConversionSvcm_cnvSvc
 Reference to the conversion service used. More...
 

Private Member Functions

 TupleImp (const TupleImp &)
 Standard Copy Constructor. More...
 

Additional Inherited Members

- Public Types inherited from INTuple
typedef std::vector
< INTupleItem * > 
ItemContainer
 
- Static Public Member Functions inherited from DataObject
static const CLIDclassID ()
 Retrieve reference to class definition structure (static access) More...
 
- Protected Member Functions inherited from NTuple::Tuple
template<class TYPE >
StatusCode i_item (const std::string &name, _Item< TYPE > *&result) const
 Locate a _Column of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode i_item (const std::string &name, _Item< TYPE * > *&result) const
 Locate a _Column of data to the N tuple type unsafe for objects. More...
 
StatusCode i_item (const std::string &name, _Item< IOpaqueAddress * > *&result) const
 Locate a _Column of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode i_item (const std::string &name, _Array< TYPE > *&result) const
 Locate a _Array of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode i_item (const std::string &name, _Matrix< TYPE > *&result) const
 Locate a _Matrix of data to the N tuple type safe. More...
 
template<class TYPE >
StatusCode i_addItem (const std::string &name, long, const std::string &, TYPE low, TYPE high, _Item< TYPE > *&result)
 Add a _Item of data to the N tuple. More...
 
template<class TYPE >
StatusCode i_addItem (const std::string &name, long dim, const std::string &index, TYPE low, TYPE high, _Array< TYPE > *&result)
 Add a _Item of data to the N tuple. More...
 
template<class TYPE >
StatusCode i_addItem (const std::string &name, long dim1, long dim2, const std::string &index, TYPE low, TYPE high, _Matrix< TYPE > *&result)
 Add a _Item of data to the N tuple. More...
 
template<class TYPE >
StatusCode i_addObject (const std::string &name, _Item< TYPE * > *&result, const std::type_info &)
 

Detailed Description

Definition at line 15 of file NTupleImplementation.h.

Constructor & Destructor Documentation

NTuple::TupleImp::TupleImp ( const TupleImp )
private

Standard Copy Constructor.

NTuple::TupleImp::TupleImp ( const std::string &  title)

Standard Constructor.

Definition at line 27 of file NTupleImplementation.cpp.

28  : m_isBooked(false),
29  m_title(title),
30  m_pSelector(0),
31  m_buffer(0),
32  m_ntupleSvc(0),
33  m_cnvSvc(0)
34  {
35  }
bool m_isBooked
Flag wether N tuple is booked.
IConversionSvc * m_cnvSvc
Reference to the conversion service used.
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
std::string m_title
N tuple title.
char * m_buffer
Buffer size.
ISelectStatement * m_pSelector
Possibly hanging selector.
virtual const std::string & title() const
Object title.
NTuple::TupleImp::~TupleImp ( )
virtual

Standard Destructor.

Definition at line 38 of file NTupleImplementation.cpp.

38  {
39  for (ItemContainer::iterator i = m_items.begin(); i != m_items.end(); i++) {
40  (*i)->release();
41  }
42  m_items.erase(m_items.begin(), m_items.end());
43  delete [] m_buffer;
44  m_buffer = 0;
45  }
char * m_buffer
Buffer size.
ItemContainer m_items
Container with N tuple _Columns.
list i
Definition: ana.py:128

Member Function Documentation

StatusCode NTuple::TupleImp::add ( INTupleItem item)
virtual

Add an item row to the N tuple.

Implements INTuple.

Definition at line 81 of file NTupleImplementation.cpp.

81  {
82  if ( 0 != item ) {
83  INTupleItem* i = i_find(item->name());
84  if ( 0 == i ) {
85  m_items.push_back( item );
86  return StatusCode::SUCCESS;
87  }
88  }
89  return StatusCode::FAILURE;
90  }
virtual INTupleItem * i_find(const std::string &name) const
Internally used by abstract classes.
virtual const std::string & name() const =0
Access _Item name.
NTuple interface class definition.
Definition: INTuple.h:27
ItemContainer m_items
Container with N tuple _Columns.
list i
Definition: ana.py:128
StatusCode NTuple::TupleImp::attachSelector ( ISelectStatement sel)
virtual

Attach selector.

Implements INTuple.

Definition at line 48 of file NTupleImplementation.cpp.

48  {
49  if ( 0 != sel ) sel->addRef();
50  if ( 0 != m_pSelector ) m_pSelector->release();
51  m_pSelector = sel;
52  return StatusCode::SUCCESS;
53  }
virtual unsigned long release()=0
Release Interface instance.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
ISelectStatement * m_pSelector
Possibly hanging selector.
char* NTuple::TupleImp::buffer ( )
inlinevirtual

Access N tuple data buffer.

Implements INTuple.

Definition at line 64 of file NTupleImplementation.h.

64  {
65  return m_buffer;
66  }
char * m_buffer
Buffer size.
const char* NTuple::TupleImp::buffer ( ) const
inlinevirtual

Access N tuple data buffer (CONST)

Implements INTuple.

Definition at line 68 of file NTupleImplementation.h.

68  {
69  return m_buffer;
70  }
char * m_buffer
Buffer size.
IConversionSvc* NTuple::TupleImp::conversionService ( ) const
inline

Access conversion service.

Definition at line 72 of file NTupleImplementation.h.

72  {
73  return m_cnvSvc;
74  }
IConversionSvc * m_cnvSvc
Reference to the conversion service used.
virtual const INTupleItem* NTuple::TupleImp::find ( const std::string &  name) const
inlinevirtual

Find an item row of the Ntuple (CONST)

Implements INTuple.

Definition at line 56 of file NTupleImplementation.h.

56  {
57  return i_find(name);
58  }
virtual INTupleItem * i_find(const std::string &name) const
Internally used by abstract classes.
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:68
virtual INTupleItem* NTuple::TupleImp::find ( const std::string &  name)
inlinevirtual

Find an item row of the Ntuple.

Implements INTuple.

Definition at line 60 of file NTupleImplementation.h.

60  {
61  return i_find(name);
62  }
virtual INTupleItem * i_find(const std::string &name) const
Internally used by abstract classes.
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:68
INTupleItem * NTuple::TupleImp::i_find ( const std::string &  name) const
virtual

Internally used by abstract classes.

Locate a column of data to the N tuple (not type safe)

Implements INTuple.

Definition at line 68 of file NTupleImplementation.cpp.

68  {
69  for (ItemContainer::const_iterator i = m_items.begin();
70  i != m_items.end();
71  i++) {
72  if ( name == (*i)->name() ) {
73  INTupleItem* it = const_cast<INTupleItem*>(*i);
74  return it;
75  }
76  }
77  return 0;
78  }
NTuple interface class definition.
Definition: INTuple.h:27
ItemContainer m_items
Container with N tuple _Columns.
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:68
list i
Definition: ana.py:128
ItemContainer& NTuple::TupleImp::items ( )
inlinevirtual

Access item container.

Implements INTuple.

Definition at line 44 of file NTupleImplementation.h.

44  {
45  return m_items;
46  }
ItemContainer m_items
Container with N tuple _Columns.
const ItemContainer& NTuple::TupleImp::items ( ) const
inlinevirtual

Access item container (CONST)

Implements INTuple.

Definition at line 48 of file NTupleImplementation.h.

48  {
49  return m_items;
50  }
ItemContainer m_items
Container with N tuple _Columns.
StatusCode NTuple::TupleImp::read ( )
virtual

Read record of the NTuple (Shortcut of readRecord)

Read record of the NTuple.

Implements INTuple.

Definition at line 123 of file NTupleImplementation.cpp.

123  {
124  return m_ntupleSvc->readRecord(this);
125  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
virtual StatusCode readRecord(NTuple::Tuple *tuple)=0
Read single record from N tuple.
StatusCode NTuple::TupleImp::readRecord ( )
virtual

Read record of the NTuple.

Implements INTuple.

Definition at line 127 of file NTupleImplementation.cpp.

127  {
128  return m_ntupleSvc->readRecord(this);
129  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
virtual StatusCode readRecord(NTuple::Tuple *tuple)=0
Read single record from N tuple.
StatusCode NTuple::TupleImp::remove ( INTupleItem item)
virtual

Remove an item row (identified by pointer) from the N tuple.

Remove a column from the N-tuple.

Implements INTuple.

Definition at line 99 of file NTupleImplementation.cpp.

99  {
100  for (ItemContainer::iterator i = m_items.begin(); i != m_items.end(); i++) {
101  if ( (*i) == item ) {
102  m_items.erase(i);
103  item->release();
104  return StatusCode::SUCCESS;
105  }
106  }
107  return StatusCode::FAILURE;
108  }
ItemContainer m_items
Container with N tuple _Columns.
virtual void release()=0
Destruct object.
StatusCode item(const std::string &name, Item< TYPE > &result)
Locate a scalar Item of data to the N tuple type safe.
Definition: NTuple.h:500
list i
Definition: ana.py:128
StatusCode NTuple::TupleImp::remove ( const std::string &  name)
virtual

Remove an item row (identified by name) from the N tuple.

Remove a column from the N-tuple.

Implements INTuple.

Definition at line 93 of file NTupleImplementation.cpp.

93  {
95  return (i == 0) ? StatusCode(StatusCode::FAILURE) : remove(i);
96  }
virtual INTupleItem * i_find(const std::string &name) const
Internally used by abstract classes.
virtual StatusCode remove(INTupleItem *item)
Remove an item row (identified by pointer) from the N tuple.
NTuple interface class definition.
Definition: INTuple.h:27
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:68
list i
Definition: ana.py:128
void NTuple::TupleImp::reset ( )
virtual

Reset all entries to their default values.

Reset N tuple to default values.

Implements INTuple.

Definition at line 61 of file NTupleImplementation.cpp.

61  {
62  for (ItemContainer::iterator i = m_items.begin(); i != m_items.end(); i++) {
63  (*i)->reset();
64  }
65  }
ItemContainer m_items
Container with N tuple _Columns.
list i
Definition: ana.py:128
StatusCode NTuple::TupleImp::save ( )
virtual

Save the NTuple.

Implements INTuple.

Definition at line 131 of file NTupleImplementation.cpp.

131  {
132  return m_ntupleSvc->save(this);
133  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
virtual StatusCode save(const std::string &fullPath)=0
Save N tuple to disk.
ISelectStatement * NTuple::TupleImp::selector ( )
virtual

Access selector.

Implements INTuple.

Definition at line 56 of file NTupleImplementation.cpp.

56  {
57  return m_pSelector;
58  }
ISelectStatement * m_pSelector
Possibly hanging selector.
void NTuple::TupleImp::setBuffer ( char *  buff)
virtual

Set N tuple data buffer.

Implements INTuple.

Definition at line 110 of file NTupleImplementation.cpp.

110  {
111  if ( 0 != m_buffer ) delete m_buffer;
112  m_buffer = buff;
113  }
char * m_buffer
Buffer size.
void NTuple::TupleImp::setConversionService ( IConversionSvc svc)
inline

Access conversion service.

Definition at line 76 of file NTupleImplementation.h.

76  {
77  m_cnvSvc = svc;
78  }
IConversionSvc * m_cnvSvc
Reference to the conversion service used.
void NTuple::TupleImp::setTupleService ( INTupleSvc svc)
inline

Access conversion service.

Definition at line 84 of file NTupleImplementation.h.

84  {
85  m_ntupleSvc = svc;
86  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
virtual const std::string& NTuple::TupleImp::title ( ) const
inlinevirtual

Object title.

Implements INTuple.

Definition at line 52 of file NTupleImplementation.h.

52  {
53  return m_title;
54  }
std::string m_title
N tuple title.
INTupleSvc* NTuple::TupleImp::tupleService ( ) const
inline

Access conversion service.

Definition at line 80 of file NTupleImplementation.h.

80  {
81  return m_ntupleSvc;
82  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
StatusCode NTuple::TupleImp::write ( )
virtual

Write record of the NTuple (Shortcut of writeRecord)

Write record of the NTuple.

Implements INTuple.

Definition at line 115 of file NTupleImplementation.cpp.

115  {
116  return m_ntupleSvc->writeRecord(this);
117  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
virtual StatusCode writeRecord(NTuple::Tuple *tuple)=0
Write single record to N tuple.
StatusCode NTuple::TupleImp::writeRecord ( )
virtual

Write record of the NTuple.

Implements INTuple.

Definition at line 119 of file NTupleImplementation.cpp.

119  {
120  return m_ntupleSvc->writeRecord(this);
121  }
INTupleSvc * m_ntupleSvc
Reference to N-tuple service used.
virtual StatusCode writeRecord(NTuple::Tuple *tuple)=0
Write single record to N tuple.

Member Data Documentation

char* NTuple::TupleImp::m_buffer
protected

Buffer size.

Definition at line 26 of file NTupleImplementation.h.

IConversionSvc* NTuple::TupleImp::m_cnvSvc
protected

Reference to the conversion service used.

Definition at line 30 of file NTupleImplementation.h.

bool NTuple::TupleImp::m_isBooked
protected

Flag wether N tuple is booked.

Definition at line 20 of file NTupleImplementation.h.

ItemContainer NTuple::TupleImp::m_items
protected

Container with N tuple _Columns.

Definition at line 18 of file NTupleImplementation.h.

INTupleSvc* NTuple::TupleImp::m_ntupleSvc
protected

Reference to N-tuple service used.

Definition at line 28 of file NTupleImplementation.h.

ISelectStatement* NTuple::TupleImp::m_pSelector
protected

Possibly hanging selector.

Definition at line 24 of file NTupleImplementation.h.

std::string NTuple::TupleImp::m_title
protected

N tuple title.

Definition at line 22 of file NTupleImplementation.h.


The documentation for this class was generated from the following files: