| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# PoolDbNTupleCnv.cpp File Reference

`#include <algorithm>`
`#include "GaudiPoolDb/IPoolDbMgr.h"`
`#include "GaudiPoolDb/PoolDbAddress.h"`
`#include "GaudiPoolDb/PoolDbNTupleCnv.h"`
`#include "GaudiPoolDb/PoolDbLinkManager.h"`
`#include "GaudiPoolDb/PoolDbNTupleDescriptor.h"`
`#include "GaudiPoolDb/PoolDbTupleCallback.h"`
`#include "GaudiKernel/xtoa.h"`
`#include "GaudiKernel/NTuple.h"`
`#include "GaudiKernel/SmartIF.h"`
`#include "GaudiKernel/SmartRef.h"`
`#include "GaudiKernel/MsgStream.h"`
`#include "GaudiKernel/INTupleSvc.h"`
`#include "GaudiKernel/IRegistry.h"`
`#include "GaudiKernel/ISelectStatement.h"`
`#include "GaudiKernel/ContainedObject.h"`
`#include "GaudiKernel/GenericAddress.h"`
`#include "GaudiKernel/CnvFactory.h"`
`#include "StorageSvc/DbSelect.h"`
`#include "StorageSvc/DbReflex.h"`
`#include "StorageSvc/DbColumn.h"`
`#include "StorageSvc/DbTypeInfo.h"`
`#include "StorageSvc/DbObjectCallBack.h"`
`#include "Reflex/Builder/ReflexBuilder.h"`
`#include <memory>`

Include dependency graph for PoolDbNTupleCnv.cpp:

Go to the source code of this file.

## Namespaces
namespace | pool
## Defines
#define | ALLOW_ALL_TYPES
#define | S_OK StatusCode::SUCCESS
#define | S_FAIL StatusCode::FAILURE
## Functions
const std::string | pool::typeName (const std::type_info &typ)
void | popCurrentDataObject ()
void | pushCurrentDataObject (DataObject **pobjAddr)
void | pool::genMD5 (const std::string &s, void *code)
template<class T>
static void * | save (pool::DbBlob &s, const void *buffer, int len, bool save_len)
static void * | save (const void *b, PoolDbTokenWrap *lnk)
template<class T>
static int | load (pool::DbBlob &s, void *buff)
template<>
int | load< std::string > (pool::DbBlob &s, void *ptr)
static int | load (void *ptr, PoolDbTokenWrap *lnk)
| PLUGINSVC_FACTORY_WITH_ID (PoolDbNTupleCnv, ConverterID(POOL_StorageType, CLID_RowWiseTuple), IConverter *(long, CLID, ISvcLocator *)) PLUGINSVC_FACTORY_WITH_ID(PoolDbNTupleCnv
| ConverterID (POOL_StorageType, CLID_ColumnWiseTuple)
IConverter ISvcLocator *static std::istream & | operator>> (std::istream &is, IOpaqueAddress *&)
template<class TYP>
static StatusCode | createItem (INTuple *tuple, std::istream &is, const std::string &name, const TYP &null)
template<class T>
static void | putRange (std::ostream &os, NTuple::_Data< T > *it)
## Variables
IConverter * | long
IConverter | CLID

## Define Documentation

#define ALLOW_ALL_TYPES

Definition at line 13 of file PoolDbNTupleCnv.cpp.

#define S_FAIL StatusCode::FAILURE

Definition at line 41 of file PoolDbNTupleCnv.cpp.

#define S_OK StatusCode::SUCCESS

Definition at line 40 of file PoolDbNTupleCnv.cpp.

## Function Documentation

ConverterID | ( | POOL_StorageType | ,
|  | CLID_ColumnWiseTuple |  |
| ) |  |  |

template<class TYP>

static StatusCode createItem | ( | INTuple * | tuple,
|  | std::istream & | is,
|  | const std::string & | name,
|  | const TYP & | null |
| ) |  |  | `[inline, static]`

Definition at line 147 of file PoolDbNTupleCnv.cpp.

    00150 {
    00151   std::string idxName;
    00152   long len, ndim, dim[4], hasIdx, idxLow, idxLen;
    00153   long dim1 = 1, dim2 = 1;
    00154   INTupleItem* it = 0;
    00155   char c;
    00156   is >> len    >> c
    00157      >> ndim   >> c
    00158      >> hasIdx >> c;
    00159   if ( hasIdx )  {
    00160     std::getline(is, idxName, ';') >> idxLow >> c >> idxLen >> c;
    00161   }
    00162   for ( int i = 0; i < ndim; i++ )
    00163     is >> dim[i] >> c;
    00164
    00165   TYP low = null, high = null;
    00166   is >> low >> c >> high >> c;
    00167   is >> c;
    00168   switch( ndim )  {
    00169   case 0:
    00170     it = NTuple::_Item<TYP>::create (tuple, name, typeid(TYP), low, high, null);
    00171     break;
    00172   case 1:
    00173     dim1 = (hasIdx) ? idxLen : dim[0];
    00174     it = NTuple::_Array<TYP>::create (tuple,
    00175                                       name,
    00176                                       typeid(TYP),
    00177                                       idxName,
    00178                                       dim1,
    00179                                       low,
    00180                                       high,
    00181                                       null);
    00182     break;
    00183   case 2:
    00184     dim1 = (hasIdx) ? idxLen : dim[0];
    00185     dim2 = (hasIdx) ? dim[0] : dim[1];
    00186     it = NTuple::_Matrix<TYP>::create ( tuple,
    00187                                         name,
    00188                                         typeid(TYP),
    00189                                         idxName,
    00190                                         dim1,
    00191                                         dim2,
    00192                                         low,
    00193                                         high,
    00194                                         null);
    00195     break;
    00196   default:
    00197     return S_FAIL;
    00198   }
    00199   return tuple->add(it);
    00200 }

static int load | ( | void * | ptr,
|  | PoolDbTokenWrap * | lnk |
| ) |  |  | `[inline, static]`

Definition at line 108 of file PoolDbNTupleCnv.cpp.

    00108                                                          {
    00109   IOpaqueAddress* pA = *(IOpaqueAddress**)ptr;
    00110   GenericAddress* pAddr = (GenericAddress*)(pA);
    00111   if ( 0 != pAddr )  {
    00112     pool::Token&    tok = lnk->token;
    00113     std::string*   spar = (std::string*)pAddr->par();
    00114     unsigned long* ipar = (unsigned long*)pAddr->ipar();
    00115     pAddr->setClID(tok.classID().Data1);
    00116     pAddr->setSvcType(tok.technology());
    00117     ipar[0] = tok.oid().first;
    00118     ipar[1] = tok.oid().second;
    00119     spar[0] = tok.dbID();
    00120     spar[1] = tok.contID();
    00121     return 0;
    00122   }
    00123   else if ( pA ) {
    00124     return 10;
    00125         }
    00126   return 11;
    00127 }

template<class T>

static int load | ( | pool::DbBlob & | s,
|  | void * | buff |
| ) |  |  | `[inline, static]`

Definition at line 93 of file PoolDbNTupleCnv.cpp.

    00093                                                                       {
    00094   int len;
    00095   s >> len;
    00096   s.swapFromBuffer(buff, len*sizeof(T));
    00097   return 0;
    00098 }

template<>

int load< std::string > | ( | pool::DbBlob & | s,
|  | void * | ptr |
| ) |  |  | `[inline]`

IConverter ISvcLocator* static std::istream& operator>> | ( | std::istream & | is,
|  | IOpaqueAddress *& |  |
| ) |  |  | `[inline, static]`

Type Constraints

Definition at line 140 of file PoolDbNTupleCnv.cpp.

    00140                                                         {
    00141   long i;
    00142   is >> i;
    00143   return is;
    00144 }

PLUGINSVC_FACTORY_WITH_ID | ( | PoolDbNTupleCnv | ,
|  | ConverterID(POOL_StorageType, CLID_RowWiseTuple) | ,
|  | IConverter * | long, CLID, ISvcLocator * |
| ) |  |  |

void popCurrentDataObject | ( |  | ) |

Definition at line 60 of file PoolDbIOHandler.cpp.

    00060                             {
    00061   Gaudi::popCurrentDataObject();
    00062   resetLastLink();
    00063 }

void pushCurrentDataObject | ( | DataObject ** | pobjAddr | ) |

Definition at line 55 of file PoolDbIOHandler.cpp.

    00055                                                   {
    00056   Gaudi::pushCurrentDataObject(pobjAddr);
    00057   resetLastLink();
    00058 }

template<class T>

static void putRange | ( | std::ostream & | os,
|  | NTuple::_Data< T > * | it |
| ) |  |  | `[inline, static]`

Definition at line 203 of file PoolDbNTupleCnv.cpp.

    00204 {
    00205   const NTuple::Range<T>& x = it->range();
    00206   os << x.lower() << ';' << x.upper() << ';';
    00207 }

static void* save | ( | const void * | b,
|  | PoolDbTokenWrap * | lnk |
| ) |  |  | `[static]`

Definition at line 71 of file PoolDbNTupleCnv.cpp.

    00071                                                         {
    00072   IOpaqueAddress* pA = (*(IOpaqueAddress**)b);
    00073   pool::Token& tok   = lnk->token;
    00074   pool::Guid guid(pool::Guid::null());
    00075   if ( pA )  {
    00076     const std::string*   spar = pA->par();
    00077     const unsigned long* ipar = pA->ipar();
    00078     guid.Data1 = pA->clID();
    00079     tok.setTechnology(pA->svcType());
    00080     tok.setDb(spar[0]).setCont(spar[1]);
    00081     tok.oid().first  = ipar[0];
    00082     tok.oid().second = ipar[1];
    00083   }
    00084   else {
    00085     tok.setTechnology(0).setDb("").setCont("");
    00086     tok.oid().first = tok.oid().second = pool::INVALID;
    00087   }
    00088   tok.setClassID(guid);
    00089   return lnk;
    00090 }

template<class T>

static void* save | ( | pool::DbBlob & | s,
|  | const void * | buffer,
|  | int | len,
|  | bool | save_len |
| ) |  |  | `[inline, static]`

Definition at line 57 of file PoolDbNTupleCnv.cpp.

    00057                                                                        {
    00058   const T* buff = (const T*)buffer;
    00059   if ( len > 1 )  {
    00060     s << len;
    00061     s.swapToBuffer(buff, len*sizeof(T));
    00062     return 0;
    00063   }
    00064   else if ( save_len )  {
    00065     s << len;
    00066     return 0;
    00067   }
    00068   return (void*)buff;
    00069 }

## Variable Documentation

IConverter CLID

Definition at line 137 of file PoolDbNTupleCnv.cpp.

IConverter* long

Definition at line 137 of file PoolDbNTupleCnv.cpp.