| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Namespaces | Defines | Functions | Variables

# 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 18 of file PoolDbNTupleCnv.cpp.

#define S_FAIL StatusCode::FAILURE

Definition at line 46 of file PoolDbNTupleCnv.cpp.

#define S_OK StatusCode::SUCCESS

Definition at line 45 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
| ) |  | `[static]`

Definition at line 152 of file PoolDbNTupleCnv.cpp.

    {
      std::string idxName;
      long len, ndim, dim[4], hasIdx, idxLow, idxLen;
      long dim1 = 1, dim2 = 1;
      INTupleItem* it = 0;
      char c;
      is >> len    >> c
         >> ndim   >> c
         >> hasIdx >> c;
      if ( !is.good() ) {
        return S_FAIL;
      }
      if ( hasIdx )  {
        std::getline(is, idxName, ';') >> idxLow >> c >> idxLen >> c;
      }
      for ( int i = 0; i < ndim; i++ )
        is >> dim[i] >> c;

      TYP low = null, high = null;
      is >> low >> c >> high >> c;
      is >> c;
      switch( ndim )  {
      case 0:
        it = NTuple::_Item<TYP>::create (tuple, name, typeid(TYP), low, high, null);
        break;
      case 1:
        dim1 = (hasIdx) ? idxLen : dim[0];
        it = NTuple::_Array<TYP>::create (tuple,
                                          name,
                                          typeid(TYP),
                                          idxName,
                                          dim1,
                                          low,
                                          high,
                                          null);
        break;
      case 2:
        dim1 = (hasIdx) ? idxLen : dim[0];
        dim2 = (hasIdx) ? dim[0] : dim[1];
        it = NTuple::_Matrix<TYP>::create ( tuple,
                                            name,
                                            typeid(TYP),
                                            idxName,
                                            dim1,
                                            dim2,
                                            low,
                                            high,
                                            null);
        break;
      default:
        return S_FAIL;
      }
      return tuple->add(it);
    }

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

Definition at line 113 of file PoolDbNTupleCnv.cpp.

                                                             {
      IOpaqueAddress* pA = *(IOpaqueAddress**)ptr;
      GenericAddress* pAddr = (GenericAddress*)(pA);
      if ( 0 != pAddr )  {
        pool::Token&    tok = lnk->token;
        std::string*   spar = (std::string*)pAddr->par();
        unsigned long* ipar = (unsigned long*)pAddr->ipar();
        pAddr->setClID(tok.classID().Data1);
        pAddr->setSvcType(tok.technology());
        ipar[0] = tok.oid().first;
        ipar[1] = tok.oid().second;
        spar[0] = tok.dbID();
        spar[1] = tok.contID();
        return 0;
      }
      else if ( pA ) {
        return 10;
            }
      return 11;
    }

template<class T >

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

Definition at line 98 of file PoolDbNTupleCnv.cpp.

                                                                          {
      int len;
      s >> len;
      s.swapFromBuffer(buff, len*sizeof(T));
      return 0;
    }

template<>

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

Definition at line 106 of file PoolDbNTupleCnv.cpp.

                                                                       {
      std::string* str = (std::string*)ptr;
      s >> (*str);
      return 0;
    }

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

Definition at line 145 of file PoolDbNTupleCnv.cpp.

                                                            {
      long i;
      is >> i;
      return is;
    }

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

void popCurrentDataObject | ( | ) |

Definition at line 72 of file PoolDbIOHandler.cpp.

                                {
      Gaudi::popCurrentDataObject();
      resetLastLink();
    }

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

Definition at line 67 of file PoolDbIOHandler.cpp.

                                                      {
      Gaudi::pushCurrentDataObject(pobjAddr);
      resetLastLink();
    }

template<class T >

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

Definition at line 211 of file PoolDbNTupleCnv.cpp.

    {
      if ( it ) {
        const NTuple::Range<T>& x = it->range();
        os << x.lower() << ';' << x.upper() << ';';
        return;
      }
      os << "0;0;";
    }

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

Definition at line 76 of file PoolDbNTupleCnv.cpp.

                                                            {
      IOpaqueAddress* pA = (*(IOpaqueAddress**)b);
      pool::Token& tok   = lnk->token;
      pool::Guid guid(pool::Guid::null());
      if ( pA )  {
        const std::string*   spar = pA->par();
        const unsigned long* ipar = pA->ipar();
        guid.Data1 = pA->clID();
        tok.setTechnology(pA->svcType());
        tok.setDb(spar[0]).setCont(spar[1]);
        tok.oid().first  = ipar[0];
        tok.oid().second = ipar[1];
      }
      else {
        tok.setTechnology(0).setDb("").setCont("");
        tok.oid().first = tok.oid().second = pool::INVALID;
      }
      tok.setClassID(guid);
      return lnk;
    }

template<class T >

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

Definition at line 62 of file PoolDbNTupleCnv.cpp.

                                                                           {
      const T* buff = (const T*)buffer;
      if ( len > 1 )  {
        s << len;
        s.swapToBuffer(buff, len*sizeof(T));
        return 0;
      }
      else if ( save_len )  {
        s << len;
        return 0;
      }
      return (void*)buff;
    }

## Variable Documentation

IConverter CLID

Definition at line 142 of file PoolDbNTupleCnv.cpp.

IConverter* long

Definition at line 142 of file PoolDbNTupleCnv.cpp.

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines