Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

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

IConverterlong
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

template<class TYP >
static StatusCode createItem ( INTuple tuple,
std::istream is,
const std::string name,
const TYP &  null 
) [inline, static]

Definition at line 152 of file PoolDbNTupleCnv.cpp.

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

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

Definition at line 113 of file PoolDbNTupleCnv.cpp.

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

template<class T >
static int load ( pool::DbBlob &  s,
void *  buff 
) [inline, static]

Definition at line 98 of file PoolDbNTupleCnv.cpp.

00098                                                                       {
00099   int len;
00100   s >> len;
00101   s.swapFromBuffer(buff, len*sizeof(T));
00102   return 0;
00103 }

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

00145                                                         {
00146   long i;
00147   is >> i;
00148   return is;
00149 }

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

Definition at line 66 of file PoolDbIOHandler.cpp.

00066                             {
00067   Gaudi::popCurrentDataObject();
00068   resetLastLink();
00069 }

void pushCurrentDataObject ( DataObject **  pobjAddr  ) 

Definition at line 61 of file PoolDbIOHandler.cpp.

00061                                                   {
00062   Gaudi::pushCurrentDataObject(pobjAddr);
00063   resetLastLink();
00064 }

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

Definition at line 211 of file PoolDbNTupleCnv.cpp.

00212 {
00213   if ( it ) {
00214     const NTuple::Range<T>& x = it->range();
00215     os << x.lower() << ';' << x.upper() << ';';
00216     return;
00217   }
00218   os << "0;0;";  
00219 }

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

Definition at line 76 of file PoolDbNTupleCnv.cpp.

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

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.

00062                                                                        {
00063   const T* buff = (const T*)buffer;
00064   if ( len > 1 )  {
00065     s << len;
00066     s.swapToBuffer(buff, len*sizeof(T));
00067     return 0;
00068   }
00069   else if ( save_len )  {
00070     s << len;
00071     return 0;
00072   }
00073   return (void*)buff;
00074 }


Variable Documentation

Definition at line 142 of file PoolDbNTupleCnv.cpp.

Definition at line 142 of file PoolDbNTupleCnv.cpp.

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

Generated at Wed Feb 9 16:28:30 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004