#include <CondCore/DBCommon/interface/GenericRef.h>
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) |
GenericRef & | operator= (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 |
Definition at line 14 of file GenericRef.h.
cond::GenericRef::GenericRef | ( | ) |
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] |
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 }
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 | ) |
cond::GenericRef & cond::GenericRef::operator= | ( | const GenericRef & | rhs | ) |
Definition at line 130 of file GenericRef.cc.
Referenced by cond::IOVServiceImpl::deleteAll(), cond::IOVEditorImpl::deleteEntries(), and cond::IOVEditorImpl::replaceInterval().
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 }
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] |
pool::Placement* cond::GenericRef::m_place [protected] |
Definition at line 66 of file GenericRef.h.
Referenced by GenericRef(), markWrite(), operator=(), and ~GenericRef().