| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# NTuple::TupleImp Class Reference

`#include <NTupleImplementation.h>`

Inheritance diagram for NTuple::TupleImp:

[legend]
Collaboration diagram for NTuple::TupleImp:

[legend]
List of all members.

## Detailed Description

Definition at line 14 of file NTupleImplementation.h.

## Public Member Functions
virtual INTupleItem * | i_find (const std::string &name) const
| Locate a column of data to the N tuple (not type safe).
| TupleImp (const std::string &title)
| Standard Constructor.
virtual | ~TupleImp ()
| Standard Destructor.
ItemContainer & | items ()
| Access item container.
const ItemContainer & | items () const
| Access item container (CONST).
virtual const std::string & | title () const
| Object title.
virtual const INTupleItem * | find (const std::string &name) const
| Find an item row of the Ntuple (CONST).
virtual INTupleItem * | find (const std::string &name)
| Find an item row of the Ntuple.
char * | buffer ()
| Access N tuple data buffer.
const char * | buffer () const
| Access N tuple data buffer (CONST).
IConversionSvc * | conversionService () const
| Access conversion service.
void | setConversionService (IConversionSvc *svc)
| Access conversion service.
INTupleSvc * | tupleService () const
| Access conversion service.
void | setTupleService (INTupleSvc *svc)
| Access conversion service.
virtual StatusCode | attachSelector (ISelectStatement *sel)
| Attach selector.
virtual ISelectStatement * | selector ()
| Access selector.
virtual void | setBuffer (char *buff)
| Set N tuple data buffer.
virtual void | reset ()
| Reset N tuple to default values.
virtual StatusCode | add (INTupleItem *item)
| Add an item row to the N tuple.
virtual StatusCode | remove (INTupleItem *item)
| Remove a column from the N-tuple.
virtual StatusCode | remove (const std::string &name)
| Remove a column from the N-tuple.
virtual StatusCode | write ()
| Write record of the NTuple.
virtual StatusCode | writeRecord ()
| Write record of the NTuple.
virtual StatusCode | read ()
| Read record of the NTuple.
virtual StatusCode | readRecord ()
| Read record of the NTuple.
virtual StatusCode | save ()
| Save the NTuple.
## Protected Attributes
ItemContainer | m_items
| Container with N tuple _Columns.
bool | m_isBooked
| Flag wether N tuple is booked.
std::string | m_title
| N tuple title.
ISelectStatement * | m_pSelector
| Possibly hanging selector.
char * | m_buffer
| Buffer size.
INTupleSvc * | m_ntupleSvc
| Reference to N-tuple service used.
IConversionSvc * | m_cnvSvc
| Reference to the conversion service used.
## Private Member Functions
| TupleImp (const TupleImp &)
| Standard Copy Constructor.

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

    00028   : m_isBooked(false),
    00029     m_title(title),
    00030     m_pSelector(0),
    00031     m_buffer(0),
    00032     m_ntupleSvc(0),
    00033     m_cnvSvc(0)
    00034   {
    00035   }

NTuple::TupleImp::~TupleImp | ( |  | ) | `[virtual]`

Standard Destructor.

Definition at line 38 of file NTupleImplementation.cpp.

References m_buffer, and m_items.

    00038                          {
    00039     for (ItemContainer::iterator i = m_items.begin(); i != m_items.end(); i++) {
    00040       (*i)->release();
    00041     }
    00042     m_items.erase(m_items.begin(), m_items.end());
    00043     delete  [] m_buffer;
    00044     m_buffer = 0;
    00045   }

## Member Function Documentation

INTupleItem * NTuple::TupleImp::i_find | ( | const std::string & | name | ) | const`[virtual]`

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

Implements INTuple.

Definition at line 68 of file NTupleImplementation.cpp.

References m_items, and DataObject::name().

Referenced by add(), find(), and remove().

    00068                                                                  {
    00069     for (ItemContainer::const_iterator i = m_items.begin();
    00070          i != m_items.end();
    00071          i++) {
    00072       if ( name == (*i)->name() )   {
    00073         INTupleItem* it = const_cast<INTupleItem*>(*i);
    00074         return it;
    00075       }
    00076     }
    00077     return 0;
    00078   }

ItemContainer& NTuple::TupleImp::items | ( |  | ) | `[inline, virtual]`

Access item container.

Implements INTuple.

Definition at line 43 of file NTupleImplementation.h.

References m_items.

    00043                               {
    00044       return m_items;
    00045     }

const ItemContainer& NTuple::TupleImp::items | ( |  | ) | const`[inline, virtual]`

Access item container (CONST).

Implements INTuple.

Definition at line 47 of file NTupleImplementation.h.

References m_items.

    00047                                             {
    00048       return m_items;
    00049     }

virtual const std::string& NTuple::TupleImp::title | ( |  | ) | const`[inline, virtual]`

Object title.

Implements INTuple.

Definition at line 51 of file NTupleImplementation.h.

References m_title.

    00051                                                       {
    00052       return m_title;
    00053     }

virtual const INTupleItem* NTuple::TupleImp::find | ( | const std::string & | name | ) | const`[inline, virtual]`

Find an item row of the Ntuple (CONST).

Implements INTuple.

Definition at line 55 of file NTupleImplementation.h.

References i_find(), and DataObject::name().

    00055                                                                     {
    00056       return i_find(name);
    00057     }

virtual INTupleItem* NTuple::TupleImp::find | ( | const std::string & | name | ) | `[inline, virtual]`

Find an item row of the Ntuple.

Implements INTuple.

Definition at line 59 of file NTupleImplementation.h.

References i_find(), and DataObject::name().

    00059                                                         {
    00060       return i_find(name);
    00061     }

char* NTuple::TupleImp::buffer | ( |  | ) | `[inline, virtual]`

Access N tuple data buffer.

Implements INTuple.

Definition at line 63 of file NTupleImplementation.h.

References m_buffer.

    00063                       {
    00064       return m_buffer;
    00065     }

const char* NTuple::TupleImp::buffer | ( |  | ) | const`[inline, virtual]`

Access N tuple data buffer (CONST).

Implements INTuple.

Definition at line 67 of file NTupleImplementation.h.

References m_buffer.

    00067                                  {
    00068       return m_buffer;
    00069     }

IConversionSvc* NTuple::TupleImp::conversionService | ( |  | ) | const`[inline]`

Access conversion service.

Definition at line 71 of file NTupleImplementation.h.

References m_cnvSvc.

Referenced by NTupleSvc::readRecord(), NTupleSvc::save(), and NTupleSvc::writeRecord().

    00071                                                  {
    00072       return m_cnvSvc;
    00073     }

void NTuple::TupleImp::setConversionService | ( | IConversionSvc * | svc | ) | `[inline]`

Access conversion service.

Definition at line 75 of file NTupleImplementation.h.

References m_cnvSvc.

Referenced by NTupleSvc::readRecord(), and NTupleSvc::writeRecord().

    00075                                                         {
    00076       m_cnvSvc = svc;
    00077     }

INTupleSvc* NTuple::TupleImp::tupleService | ( |  | ) | const`[inline]`

Access conversion service.

Definition at line 79 of file NTupleImplementation.h.

References m_ntupleSvc.

    00079                                         {
    00080       return m_ntupleSvc;
    00081     }

void NTuple::TupleImp::setTupleService | ( | INTupleSvc * | svc | ) | `[inline]`

Access conversion service.

Definition at line 83 of file NTupleImplementation.h.

References m_ntupleSvc.

Referenced by NTupleSvc::create().

    00083                                                {
    00084       m_ntupleSvc = svc;
    00085     }

StatusCode NTuple::TupleImp::attachSelector | ( | ISelectStatement * | sel | ) | `[virtual]`

Attach selector.

Implements INTuple.

Definition at line 48 of file NTupleImplementation.cpp.

References IInterface::addRef(), m_pSelector, IInterface::release(), and StatusCode::SUCCESS.

    00048                                                             {
    00049     if ( 0 != sel         ) sel->addRef();
    00050     if ( 0 != m_pSelector ) m_pSelector->release();
    00051     m_pSelector = sel;
    00052     return StatusCode::SUCCESS;
    00053   }

ISelectStatement * NTuple::TupleImp::selector | ( |  | ) | `[virtual]`

Access selector.

Implements INTuple.

Definition at line 56 of file NTupleImplementation.cpp.

References m_pSelector.

    00056                                          {
    00057     return m_pSelector;
    00058   }

void NTuple::TupleImp::setBuffer | ( | char * | buff | ) | `[virtual]`

Set N tuple data buffer.

Implements INTuple.

Definition at line 110 of file NTupleImplementation.cpp.

References m_buffer.

    00110                                       {
    00111     if ( 0 != m_buffer ) delete m_buffer;
    00112     m_buffer = buff;
    00113   }

void NTuple::TupleImp::reset | ( |  | ) | `[virtual]`

Reset N tuple to default values.

Implements INTuple.

Definition at line 61 of file NTupleImplementation.cpp.

References m_items.

    00061                            {
    00062     for (ItemContainer::iterator i = m_items.begin(); i != m_items.end(); i++) {
    00063       (*i)->reset();
    00064     }
    00065   }

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.

References StatusCode::FAILURE, i_find(), NTuple::Tuple::item(), m_items, and StatusCode::SUCCESS.

    00081                                               {
    00082     if ( 0 != item )    {
    00083       INTupleItem* i = i_find(item->name());
    00084       if ( 0 == i )   {
    00085         m_items.push_back( item );
    00086         return StatusCode::SUCCESS;
    00087       }
    00088     }
    00089     return StatusCode::FAILURE;
    00090   }

StatusCode NTuple::TupleImp::remove | ( | INTupleItem * | item | ) | `[virtual]`

Remove a column from the N-tuple.

Implements INTuple.

Definition at line 99 of file NTupleImplementation.cpp.

References StatusCode::FAILURE, NTuple::Tuple::item(), m_items, and StatusCode::SUCCESS.

Referenced by remove().

    00099                                                      {
    00100     for (ItemContainer::iterator i = m_items.begin(); i != m_items.end(); i++) {
    00101       if ( (*i) == item )   {
    00102         m_items.erase(i);
    00103         item->release();
    00104         return StatusCode::SUCCESS;
    00105       }
    00106     }
    00107     return StatusCode::FAILURE;
    00108   }

StatusCode NTuple::TupleImp::remove | ( | const std::string & | name | ) | `[virtual]`

Remove a column from the N-tuple.

Implements INTuple.

Definition at line 93 of file NTupleImplementation.cpp.

References StatusCode::FAILURE, i_find(), DataObject::name(), and remove().

    00093                                                          {
    00094     INTupleItem* i = i_find(name);
    00095     return (i == 0) ?  StatusCode(StatusCode::FAILURE) : remove(i);
    00096   }

StatusCode NTuple::TupleImp::write | ( |  | ) | `[virtual]`

Write record of the NTuple.

Implements INTuple.

Definition at line 115 of file NTupleImplementation.cpp.

References m_ntupleSvc, and INTupleSvc::writeRecord().

    00115                                 {
    00116     return m_ntupleSvc->writeRecord(this);
    00117   }

StatusCode NTuple::TupleImp::writeRecord | ( |  | ) | `[virtual]`

Write record of the NTuple.

Implements INTuple.

Definition at line 119 of file NTupleImplementation.cpp.

References m_ntupleSvc, and INTupleSvc::writeRecord().

    00119                                       {
    00120     return m_ntupleSvc->writeRecord(this);
    00121   }

StatusCode NTuple::TupleImp::read | ( |  | ) | `[virtual]`

Read record of the NTuple.

Implements INTuple.

Definition at line 123 of file NTupleImplementation.cpp.

References m_ntupleSvc, and INTupleSvc::readRecord().

    00123                                {
    00124     return m_ntupleSvc->readRecord(this);
    00125   }

StatusCode NTuple::TupleImp::readRecord | ( |  | ) | `[virtual]`

Read record of the NTuple.

Implements INTuple.

Definition at line 127 of file NTupleImplementation.cpp.

References m_ntupleSvc, and INTupleSvc::readRecord().

    00127                                      {
    00128     return m_ntupleSvc->readRecord(this);
    00129   }

StatusCode NTuple::TupleImp::save | ( |  | ) | `[virtual]`

Save the NTuple.

Implements INTuple.

Definition at line 131 of file NTupleImplementation.cpp.

References m_ntupleSvc, and INTupleSvc::save().

    00131                                {
    00132     return m_ntupleSvc->save(this);
    00133   }

## Member Data Documentation

ItemContainer NTuple::TupleImp::m_items`[protected]`

Container with N tuple _Columns.

Definition at line 17 of file NTupleImplementation.h.

Referenced by add(), i_find(), items(), remove(), reset(), and ~TupleImp().

bool NTuple::TupleImp::m_isBooked`[protected]`

Flag wether N tuple is booked.

Definition at line 19 of file NTupleImplementation.h.

std::string NTuple::TupleImp::m_title`[protected]`

N tuple title.

Definition at line 21 of file NTupleImplementation.h.

Referenced by title().

ISelectStatement* NTuple::TupleImp::m_pSelector`[protected]`

Possibly hanging selector.

Definition at line 23 of file NTupleImplementation.h.

Referenced by attachSelector(), and selector().

char* NTuple::TupleImp::m_buffer`[protected]`

Buffer size.

Definition at line 25 of file NTupleImplementation.h.

Referenced by buffer(), setBuffer(), and ~TupleImp().

INTupleSvc* NTuple::TupleImp::m_ntupleSvc`[protected]`

Reference to N-tuple service used.

Definition at line 27 of file NTupleImplementation.h.

Referenced by read(), readRecord(), save(), setTupleService(), tupleService(), write(), and writeRecord().

IConversionSvc* NTuple::TupleImp::m_cnvSvc`[protected]`

Reference to the conversion service used.

Definition at line 29 of file NTupleImplementation.h.

Referenced by conversionService(), and setConversionService().

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiKernel/v25r2/GaudiKernel/NTupleImplementation.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiKernel/v25r2/src/Lib/NTupleImplementation.cpp