| # Gaudi Framework, version v20r3
Generated: 24 Nov 2008

# 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
| Internally used by abstract classes.
| 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 all entries to their default values.
virtual StatusCode | add (INTupleItem *item)
| Add an item row to the N tuple.
virtual StatusCode | remove (INTupleItem *item)
| Remove an item row (identified by pointer) from the N tuple.
virtual StatusCode | remove (const std::string &name)
| Remove an item row (identified by name) from the N tuple.
virtual StatusCode | write ()
| Write record of the NTuple (Shortcut of writeRecord).
virtual StatusCode | writeRecord ()
| Write record of the NTuple.
virtual StatusCode | read ()
| Read record of the NTuple (Shortcut of readRecord).
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.

    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]`

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.

    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.

    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.

    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.

    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.

    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.

    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.

    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.

    00067                                  {
    00068       return m_buffer;
    00069     }

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

Access conversion service.

Definition at line 71 of file NTupleImplementation.h.

    00071                                                  {
    00072       return m_cnvSvc;
    00073     }

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

Access conversion service.

Definition at line 75 of file NTupleImplementation.h.

    00075                                                         {
    00076       m_cnvSvc = svc;
    00077     }

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

Access conversion service.

Definition at line 79 of file NTupleImplementation.h.

    00079                                         {
    00080       return m_ntupleSvc;
    00081     }

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

Access conversion service.

Definition at line 83 of file NTupleImplementation.h.

    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.

    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.

    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.

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

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

Reset all entries to their default values.

Reset N tuple to default values.

Implements INTuple.

Definition at line 61 of file NTupleImplementation.cpp.

    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.

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

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

    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 (Shortcut of writeRecord).

Write record of the NTuple.

Implements INTuple.

Definition at line 115 of file NTupleImplementation.cpp.

    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.

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

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.

    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.

    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.

    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.

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.

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

Possibly hanging selector.

Definition at line 23 of file NTupleImplementation.h.

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

Buffer size.

Definition at line 25 of file NTupleImplementation.h.

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

Reference to N-tuple service used.

Definition at line 27 of file NTupleImplementation.h.

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

Reference to the conversion service used.

Definition at line 29 of file NTupleImplementation.h.

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

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