CMS 3D CMS Logo

cond::GenericRef Class Reference

#include <CondCore/DBCommon/interface/GenericRef.h>

List of all members.

Public Member Functions

std::string className () const
void clear ()
std::string containerName () const
std::string exportTo (cond::PoolTransaction &destdb)
 GenericRef (const GenericRef &aCopy)
 GenericRef (cond::PoolTransaction &pooldb, const std::string &token, const std::type_info &refType)
 GenericRef (cond::PoolTransaction &pooldb, const std::string &token, const std::string &className)
 GenericRef (cond::PoolTransaction &pooldb, const std::string &token)
 GenericRef (cond::PoolTransaction &pooldb)
 GenericRef ()
void markDelete ()
void markUpdate ()
void markWrite (const std::string &container)
GenericRefoperator= (const GenericRef &)
void reset ()
const std::string token () const
virtual ~GenericRef ()

Protected Attributes

pool::RefBase m_data
pool::IDataSvc * m_datasvc
pool::Placement * m_place


Detailed Description

Definition at line 14 of file GenericRef.h.


Constructor & Destructor Documentation

cond::GenericRef::GenericRef (  ) 

Definition at line 13 of file GenericRef.cc.

00013                           :m_datasvc(0),m_place(0){
00014 }

cond::GenericRef::GenericRef ( cond::PoolTransaction pooldb  )  [explicit]

Definition at line 16 of file GenericRef.cc.

References cond::IConnectionProxy::connectStr(), cond::PoolTransaction::isReadOnly(), m_place, and cond::PoolTransaction::parentConnection().

00016                                                             :
00017   m_datasvc(&(transaction.poolDataSvc())),m_place(0){
00018   std::string con=transaction.parentConnection().connectStr();
00019   if( !transaction.isReadOnly() ){
00020     m_place=new pool::Placement;
00021     m_place->setTechnology(pool::POOL_RDBMS_HOMOGENEOUS_StorageType.type());
00022     m_place->setDatabase(con, pool::DatabaseSpecification::PFN);
00023   }
00024 }

cond::GenericRef::GenericRef ( cond::PoolTransaction pooldb,
const std::string &  token 
)

Definition at line 26 of file GenericRef.cc.

References m_data, m_datasvc, and cond::reflexTypeByToken().

00027                                                          :
00028   m_datasvc(&(pooldb.poolDataSvc())),m_place(0) {
00029   pool::RefBase myobj(m_datasvc, tokenStr, cond::reflexTypeByToken(tokenStr).TypeInfo());
00030   m_data=myobj;
00031 }

cond::GenericRef::GenericRef ( cond::PoolTransaction pooldb,
const std::string &  token,
const std::string &  className 
)

Definition at line 34 of file GenericRef.cc.

References m_data, and m_datasvc.

00037                               :
00038   m_datasvc(&(pooldb.poolDataSvc())),m_place(0)
00039 {
00040   const ROOT::Reflex::Type myclassType=ROOT::Reflex::Type::ByName(className);
00041   pool::RefBase myobj(m_datasvc,token,myclassType.TypeInfo() );
00042   m_data=myobj;
00043 }

cond::GenericRef::GenericRef ( cond::PoolTransaction pooldb,
const std::string &  token,
const std::type_info &  refType 
)

Definition at line 45 of file GenericRef.cc.

References m_data, and m_datasvc.

00047                                                            :
00048   m_datasvc(&(pooldb.poolDataSvc())),m_place(0)
00049 {
00050   pool::RefBase myobj(m_datasvc,token, objType);
00051   m_data=myobj;
00052 }

cond::GenericRef::GenericRef ( const GenericRef aCopy  ) 

cond::GenericRef::~GenericRef (  )  [virtual]

Definition at line 132 of file GenericRef.cc.

References m_place.

00132                            {
00133   if(m_place){
00134     delete m_place;
00135     m_place=0;
00136   }
00137 }


Member Function Documentation

std::string cond::GenericRef::className (  )  const

Definition at line 60 of file GenericRef.cc.

References m_data.

Referenced by exportTo().

00060                                {
00061   ROOT::Reflex::Type mytype=m_data.objectType();
00062   return mytype.Name();
00063 }

void cond::GenericRef::clear ( void   ) 

Definition at line 127 of file GenericRef.cc.

00127                      {  
00128 }

std::string cond::GenericRef::containerName (  )  const

Definition at line 66 of file GenericRef.cc.

References m_data.

Referenced by exportTo().

00066                                    {
00067   return m_data.token()->contID();  
00068 }

std::string cond::GenericRef::exportTo ( cond::PoolTransaction destdb  ) 

Definition at line 107 of file GenericRef.cc.

References className(), cond::IConnectionProxy::connectStr(), containerName(), Exception, cond::PoolTransaction::isReadOnly(), m_data, cond::PoolTransaction::parentConnection(), and cond::PoolTransaction::poolDataSvc().

Referenced by cond::IOVServiceImpl::exportIOVRangeWithPayload(), and cond::IOVServiceImpl::exportIOVWithPayload().

00107                                                      {
00108   if( destdb.isReadOnly() ){
00109     throw cond::Exception("cond::RefBase::exportTo destination transaction is readonly");
00110   }
00111   std::string containerName=this->containerName();
00112   std::string className=this->className();
00113   const ROOT::Reflex::Type myclassType=ROOT::Reflex::Type::ByName(className);
00114   pool::IDataSvc* destsvc=&(destdb.poolDataSvc());
00115   const pool::AnyPtr myPtr=m_data.object().get();
00116   pool::Placement destPlace;
00117   destPlace.setDatabase(destdb.parentConnection().connectStr(), 
00118                         pool::DatabaseSpecification::PFN );
00119   destPlace.setContainerName(containerName);
00120   destPlace.setTechnology(pool::POOL_RDBMS_HOMOGENEOUS_StorageType.type());
00121   pool::RefBase mycopy(destsvc,myPtr,myclassType.TypeInfo());
00122   mycopy.markWrite(destPlace);
00123   //return token string of the copy
00124   return mycopy.toString();
00125 }

void cond::GenericRef::markDelete (  ) 

Definition at line 82 of file GenericRef.cc.

References m_data.

Referenced by cond::IOVServiceImpl::deleteAll(), cond::IOVEditorImpl::deleteEntries(), cond::IOVEditorImpl::deleteEntry(), and cond::IOVEditorImpl::replaceInterval().

00082                           {
00083   m_data.markDelete();
00084 }

void cond::GenericRef::markUpdate (  ) 

Definition at line 77 of file GenericRef.cc.

References m_data.

00077                           {
00078   m_data.markUpdate();
00079 }

void cond::GenericRef::markWrite ( const std::string &  container  ) 

Definition at line 71 of file GenericRef.cc.

References m_data, and m_place.

00071                                                    {
00072   m_place->setContainerName(container);
00073   m_data.markWrite(*m_place);
00074 }

cond::GenericRef & cond::GenericRef::operator= ( const GenericRef rhs  ) 

Definition at line 86 of file GenericRef.cc.

References m_data, m_datasvc, and m_place.

00086                                                   {
00087   if(this == &rhs){
00088     return *this;
00089   }
00090   m_datasvc = rhs.m_datasvc;
00091   m_place = rhs.m_place;
00092   m_data = rhs.m_data;
00093   return *this;
00094 }

void cond::GenericRef::reset ( void   ) 

Definition at line 130 of file GenericRef.cc.

Referenced by cond::IOVServiceImpl::deleteAll(), cond::IOVEditorImpl::deleteEntries(), and cond::IOVEditorImpl::replaceInterval().

00130                      {
00131 }

const std::string cond::GenericRef::token (  )  const

Definition at line 55 of file GenericRef.cc.

References m_data.

00055                            {
00056   return m_data.toString();
00057 }


Member Data Documentation

pool::RefBase cond::GenericRef::m_data [protected]

Definition at line 68 of file GenericRef.h.

Referenced by className(), containerName(), exportTo(), GenericRef(), markDelete(), markUpdate(), markWrite(), operator=(), and token().

pool::IDataSvc* cond::GenericRef::m_datasvc [protected]

Definition at line 65 of file GenericRef.h.

Referenced by GenericRef(), and operator=().

pool::Placement* cond::GenericRef::m_place [protected]

Definition at line 66 of file GenericRef.h.

Referenced by GenericRef(), markWrite(), operator=(), and ~GenericRef().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:44 2009 for CMSSW by  doxygen 1.5.4