| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# PoolDbTupleCallback Class Reference

Description: Specialized callback to handle N-tuple interactions while saving and lodaing POOL data. More...

`#include <PoolDbTupleCallback.h>`

Inheritance diagram for PoolDbTupleCallback:

[legend]
Collaboration diagram for PoolDbTupleCallback:

[legend]

List of all members.

## Public Member Functions
| PoolDbTupleCallback (DataObject *pObj)
| Initializing constructor for N-tuple callback object.
virtual | ~PoolDbTupleCallback ()
| Standard Destructor.
virtual pool::DataCallBack * | clone () const
| Virtual copy.
virtual void | release ()
| Virtual delete.
std::vector< void * > & | addresses ()
| Access to the bound addresses.
const std::vector< int > & | mapping ()
| Access re-direction map.
std::vector< PoolDbTokenWrap * > & | links ()
| Access to pointers of the links.
pool::DbBlob & | stream ()
| Access to streambuffer object, for items which must be blobified.
pool::DbSelect * | iterator () const
| Access to select statement.
pool::DbSelect * | select (ISelectStatement *sel)
| Select new tokens according to new selection criteria.
void | configure (const INTuple *pTuple, const pool::DbTypeInfo *typ, const pool::DbContainer &cntH)
| Configure N-tuple callback and store properties for re-use.
virtual pool::DbStatus | start (CallType action_type, void *pObj, void **context)
| Callback when a read sequence should be started.
virtual pool::DbStatus | end (CallType action_type, void *context)
| Callback when a read sequence should be started.
virtual pool::DbStatus | bind (CallType action_type, const pool::DbColumn *col_ident, int col_number, void *context, void **data_pointer)
| Callback to retrieve the absolute address of a column.
## Private Types
typedef const ROOT::Reflex::Type & | TypeH
| Reflection information.
## Private Attributes
std::vector< void * > | m_addr
| Vector with all addresses mapped.
std::vector< PoolDbTokenWrap > | m_links
| Vector to store pointers link information for address columns.
std::vector< PoolDbTokenWrap * > | m_plinks
| Vector to store pointers link information for address columns.
std::vector< int > | m_map
| Redirection map between N-tuple columns and DbTypeInfo columns.
pool::DbSelect * | m_iter
| Pointer to hold the select statement.
pool::DbBlob | m_stream
| Reference to streambuffer to hold blobified data.
pool::DbContainer | m_cntH
| Pointer to pool container handle.
long | m_refCount
| Reference counter.

## Detailed Description

Description: Specialized callback to handle N-tuple interactions while saving and lodaing POOL data.

Author:
  M.Frank

Version:
  1.0

Definition at line 41 of file PoolDbTupleCallback.h.

## Member Typedef Documentation

typedef const ROOT::Reflex::Type& PoolDbTupleCallback::TypeH`[private]`

Reflection information.

Reimplemented from pool::DataCallBack.

Definition at line 46 of file PoolDbTupleCallback.h.

## Constructor & Destructor Documentation

PoolDbTupleCallback::PoolDbTupleCallback | ( | DataObject * | pObj | ) |

Initializing constructor for N-tuple callback object.

Parameters:

  | svc | [IN] Manager interface of conversion service
  | pObj | [IN] Pointer to N-tuple object
  | reading | [IN] Read/Write flag (Needed by base class

Returns:
  Reference to object

Definition at line 28 of file PoolDbTupleCallback.cpp.

    00029 : pool::DbDefaultDataHandler(),
    00030   pool::DbObjectCallBack(0),
    00031   m_iter(0), m_cntH(pool::POOL_StorageType)
    00032 {
    00033   m_refCount = 1;
    00034   setObject(pObj);
    00035   s_count->increment();
    00036 }

PoolDbTupleCallback::~PoolDbTupleCallback | ( |  | ) | `[virtual]`

Standard Destructor.

Definition at line 39 of file PoolDbTupleCallback.cpp.

    00040 {
    00041   pool::deletePtr(m_iter);
    00042   s_count->decrement();
    00043   const pool::DbTypeInfo* typ = (const pool::DbTypeInfo*)shape();
    00044   if ( typ ) typ->deleteRef();
    00045 }

## Member Function Documentation

pool::DataCallBack * PoolDbTupleCallback::clone | ( |  | ) | const`[virtual]`

Virtual copy.

Reimplemented from pool::DbObjectCallBack.

Definition at line 48 of file PoolDbTupleCallback.cpp.

    00049 {
    00050   PoolDbTupleCallback* cb = const_cast<PoolDbTupleCallback*>(this);
    00051   cb->m_refCount++;
    00052   return cb;
    00053 }

void PoolDbTupleCallback::release | ( |  | ) | `[virtual]`

Virtual delete.

Reimplemented from pool::DataCallBack.

Definition at line 56 of file PoolDbTupleCallback.cpp.

    00057 {
    00058   if ( --m_refCount <= 0 ) {
    00059     delete this;
    00060   }
    00061 }

std::vector<void*>& PoolDbTupleCallback::addresses | ( |  | ) | `[inline]`

Access to the bound addresses.

Definition at line 81 of file PoolDbTupleCallback.h.

    00081 {  return m_addr;     }

const std::vector<int>& PoolDbTupleCallback::mapping | ( |  | ) | `[inline]`

Access re-direction map.

Definition at line 83 of file PoolDbTupleCallback.h.

    00083 {  return m_map;      }

std::vector<PoolDbTokenWrap*>& PoolDbTupleCallback::links | ( |  | ) | `[inline]`

Access to pointers of the links.

Definition at line 85 of file PoolDbTupleCallback.h.

    00085 {  return m_plinks; }

pool::DbBlob& PoolDbTupleCallback::stream | ( |  | ) | `[inline]`

Access to streambuffer object, for items which must be blobified.

Definition at line 87 of file PoolDbTupleCallback.h.

    00087 {  return m_stream;   }

pool::DbSelect* PoolDbTupleCallback::iterator | ( |  | ) | const`[inline]`

Access to select statement.

Definition at line 89 of file PoolDbTupleCallback.h.

    00089 {  return m_iter;     }

pool::DbSelect * PoolDbTupleCallback::select | ( | ISelectStatement * | sel | ) |

Select new tokens according to new selection criteria.

Definition at line 97 of file PoolDbTupleCallback.cpp.

    00097                                                   {
    00098   pool::deletePtr(m_iter);
    00099   if ( m_cntH.isValid() )  {
    00100     std::string criteria = (sel && (sel->type() & ISelectStatement::STRING))
    00101       ? sel->criteria() : std::string("");
    00102     m_iter = new pool::DbSelect( criteria );
    00103     pool::DbDatabase dbH = m_cntH.containedIn();
    00104     m_iter->start(dbH, m_cntH.name());
    00105   }
    00106   return m_iter;
    00107 }

void PoolDbTupleCallback::configure | ( | const INTuple * | pTuple,
|  | const pool::DbTypeInfo * | typ,
|  | const pool::DbContainer & | cntH |
| ) |  |  |

Configure N-tuple callback and store properties for re-use.

Definition at line 64 of file PoolDbTupleCallback.cpp.

    00067 {
    00068   pool::DbTypeInfo::Columns::const_iterator ic;
    00069   const INTuple::ItemContainer& items = pTuple->items();
    00070   const pool::DbTypeInfo::Columns& cols = typ->columns();
    00071   size_t colsize = cols.size();
    00072   m_map.resize(items.size()+1,-1);
    00073   for(size_t item_no = 0; item_no < items.size(); ++item_no ) {
    00074     int icc = 0;
    00075     m_map[item_no] = -1;
    00076     const std::string& itm_nam = items[item_no]->name();
    00077     for (ic=cols.begin(); ic != cols.end(); ++ic, ++icc )  {
    00078       if ( (*ic)->name() == itm_nam )  {
    00079         m_map[item_no] = icc;
    00080         break;
    00081       }
    00082     }
    00083   }
    00084   m_addr.resize(colsize);
    00085   m_addr[colsize-1] = &m_stream;
    00086   m_links.resize(m_map.size());
    00087   m_plinks.resize(m_map.size());
    00088   for(size_t i = 0; i < m_map.size(); ++i )  {
    00089     m_plinks[i] = &m_links[i];
    00090   }
    00091   m_cntH = cntH;
    00092   typ->addRef();
    00093   setShape(typ);
    00094 }

pool::DbStatus PoolDbTupleCallback::start | ( | CallType | action_type,
|  | void * | pObj,
|  | void ** | context |
| ) |  |  | `[virtual]`

Callback when a read sequence should be started.

Reimplemented from pool::DbObjectCallBack.

Definition at line 111 of file PoolDbTupleCallback.cpp.

    00114 {
    00115   return pool::Success;
    00116 }

pool::DbStatus PoolDbTupleCallback::end | ( | CallType | action_type,
|  | void * | context |
| ) |  |  | `[virtual]`

Callback when a read sequence should be started.

Reimplemented from pool::DbObjectCallBack.

Definition at line 119 of file PoolDbTupleCallback.cpp.

    00121 {
    00122   return pool::Success;
    00123 }

pool::DbStatus PoolDbTupleCallback::bind | ( | CallType | action_type,
|  | const pool::DbColumn * | col_ident,
|  | int | col_number,
|  | void * | context,
|  | void ** | data_pointer |
| ) |  |  | `[virtual]`

Callback to retrieve the absolute address of a column.

Reimplemented from pool::DbObjectCallBack.

Definition at line 127 of file PoolDbTupleCallback.cpp.

    00132 {
    00133   switch(action_type)  {
    00134   case GET:
    00135     *data_pointer = m_addr[col_number];
    00136     break;
    00137   case PUT:
    00138     *data_pointer = m_addr[col_number];
    00139     break;
    00140   }
    00141   return pool::Success;
    00142 }

## Member Data Documentation

std::vector< void* > PoolDbTupleCallback::m_addr`[private]`

Vector with all addresses mapped.

Definition at line 48 of file PoolDbTupleCallback.h.

std::vector<PoolDbTokenWrap> PoolDbTupleCallback::m_links`[private]`

Vector to store pointers link information for address columns.

Definition at line 50 of file PoolDbTupleCallback.h.

std::vector<PoolDbTokenWrap*> PoolDbTupleCallback::m_plinks`[private]`

Vector to store pointers link information for address columns.

Definition at line 52 of file PoolDbTupleCallback.h.

std::vector<int> PoolDbTupleCallback::m_map`[private]`

Redirection map between N-tuple columns and DbTypeInfo columns.

Definition at line 54 of file PoolDbTupleCallback.h.

pool::DbSelect* PoolDbTupleCallback::m_iter`[private]`

Pointer to hold the select statement.

Definition at line 56 of file PoolDbTupleCallback.h.

pool::DbBlob PoolDbTupleCallback::m_stream`[private]`

Reference to streambuffer to hold blobified data.

Definition at line 58 of file PoolDbTupleCallback.h.

pool::DbContainer PoolDbTupleCallback::m_cntH`[private]`

Pointer to pool container handle.

Definition at line 60 of file PoolDbTupleCallback.h.

long PoolDbTupleCallback::m_refCount`[private]`

Reference counter.

Definition at line 62 of file PoolDbTupleCallback.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiPoolDb/GaudiPoolDb/PoolDbTupleCallback.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiPoolDb/src/PoolDbTupleCallback.cpp