|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
Description: Specialized callback to handle N-tuple interactions while saving and lodaing POOL data. More...
#include <PoolDbTupleCallback.h>


Public Member Functions | |
| PoolDbTupleCallback (DataObject *pObj) | |
| Initializing constructor for N-tuple callback object. | |
| virtual | ~PoolDbTupleCallback () |
| Standard Destructor. | |
| virtual pool::DataCallBack * | clone () const |
| Virtual copy. | |
| virtual void | release () |
| Virtual delete. | |
| std::vector< void * > & | addresses () |
| Access to the bound addresses. | |
| const std::vector< int > & | mapping () |
| Access re-direction map. | |
| std::vector< PoolDbTokenWrap * > & | links () |
| Access to pointers of the links. | |
| pool::DbBlob & | stream () |
| Access to streambuffer object, for items which must be blobified. | |
| pool::DbSelect * | iterator () const |
| Access to select statement. | |
| pool::DbSelect * | select (ISelectStatement *sel) |
| Select new tokens according to new selection criteria. | |
| void | configure (const INTuple *pTuple, const pool::DbTypeInfo *typ, const pool::DbContainer &cntH) |
| Configure N-tuple callback and store properties for re-use. | |
| virtual pool::DbStatus | start (CallType action_type, void *pObj, void **context) |
| Callback when a read sequence should be started. | |
| virtual pool::DbStatus | end (CallType action_type, void *context) |
| Callback when a read sequence should be started. | |
| virtual pool::DbStatus | bind (CallType action_type, const pool::DbColumn *col_ident, int col_number, void *context, void **data_pointer) |
| Callback to retrieve the absolute address of a column. | |
Private Types | |
| typedef const ROOT::Reflex::Type & | TypeH |
| Reflection information. | |
Private Attributes | |
| std::vector< void * > | m_addr |
| Vector with all addresses mapped. | |
| std::vector< PoolDbTokenWrap > | m_links |
| Vector to store pointers link information for address columns. | |
| std::vector< PoolDbTokenWrap * > | m_plinks |
| Vector to store pointers link information for address columns. | |
| std::vector< int > | m_map |
| Redirection map between N-tuple columns and DbTypeInfo columns. | |
| pool::DbSelect * | m_iter |
| Pointer to hold the select statement. | |
| pool::DbBlob | m_stream |
| Reference to streambuffer to hold blobified data. | |
| pool::DbContainer | m_cntH |
| Pointer to pool container handle. | |
| long | m_refCount |
| Reference counter. | |
Description: Specialized callback to handle N-tuple interactions while saving and lodaing POOL data.
Definition at line 41 of file PoolDbTupleCallback.h.
typedef const ROOT::Reflex::Type& PoolDbTupleCallback::TypeH [private] |
Reflection information.
Reimplemented from pool::DataCallBack.
Definition at line 46 of file PoolDbTupleCallback.h.
| PoolDbTupleCallback::PoolDbTupleCallback | ( | DataObject * | pObj ) |
Initializing constructor for N-tuple callback object.
| svc | [IN] Manager interface of conversion service |
| pObj | [IN] Pointer to N-tuple object |
| reading | [IN] Read/Write flag (Needed by base class |
Definition at line 33 of file PoolDbTupleCallback.cpp.
: pool::DbDefaultDataHandler(), pool::DbObjectCallBack(0), m_iter(0), m_cntH(pool::POOL_StorageType) { m_refCount = 1; setObject(pObj); s_count->increment(); }
| PoolDbTupleCallback::~PoolDbTupleCallback | ( | ) | [virtual] |
Standard Destructor.
Definition at line 44 of file PoolDbTupleCallback.cpp.
{
pool::deletePtr(m_iter);
s_count->decrement();
const pool::DbTypeInfo* typ = (const pool::DbTypeInfo*)shape();
if ( typ ) typ->deleteRef();
}
| std::vector<void*>& PoolDbTupleCallback::addresses | ( | ) | [inline] |
Access to the bound addresses.
Definition at line 81 of file PoolDbTupleCallback.h.
{ return m_addr; }
| pool::DbStatus PoolDbTupleCallback::bind | ( | CallType | action_type, |
| const pool::DbColumn * | col_ident, | ||
| int | col_number, | ||
| void * | context, | ||
| void ** | data_pointer | ||
| ) | [virtual] |
Callback to retrieve the absolute address of a column.
Reimplemented from pool::DbObjectCallBack.
Definition at line 132 of file PoolDbTupleCallback.cpp.
{
switch(action_type) {
case GET:
*data_pointer = m_addr[col_number];
break;
case PUT:
*data_pointer = m_addr[col_number];
break;
}
return pool::Success;
}
| pool::DataCallBack * PoolDbTupleCallback::clone | ( | ) | const [virtual] |
Virtual copy.
Reimplemented from pool::DbObjectCallBack.
Definition at line 53 of file PoolDbTupleCallback.cpp.
{
PoolDbTupleCallback* cb = const_cast<PoolDbTupleCallback*>(this);
cb->m_refCount++;
return cb;
}
| void PoolDbTupleCallback::configure | ( | const INTuple * | pTuple, |
| const pool::DbTypeInfo * | typ, | ||
| const pool::DbContainer & | cntH | ||
| ) |
Configure N-tuple callback and store properties for re-use.
Definition at line 69 of file PoolDbTupleCallback.cpp.
{
pool::DbTypeInfo::Columns::const_iterator ic;
const INTuple::ItemContainer& items = pTuple->items();
const pool::DbTypeInfo::Columns& cols = typ->columns();
size_t colsize = cols.size();
m_map.resize(items.size()+1,-1);
for(size_t item_no = 0; item_no < items.size(); ++item_no ) {
int icc = 0;
m_map[item_no] = -1;
const std::string& itm_nam = items[item_no]->name();
for (ic=cols.begin(); ic != cols.end(); ++ic, ++icc ) {
if ( (*ic)->name() == itm_nam ) {
m_map[item_no] = icc;
break;
}
}
}
m_addr.resize(colsize);
m_addr[colsize-1] = &m_stream;
m_links.resize(m_map.size());
m_plinks.resize(m_map.size());
for(size_t i = 0; i < m_map.size(); ++i ) {
m_plinks[i] = &m_links[i];
}
m_cntH = cntH;
typ->addRef();
setShape(typ);
}
| pool::DbStatus PoolDbTupleCallback::end | ( | CallType | action_type, |
| void * | context | ||
| ) | [virtual] |
Callback when a read sequence should be started.
Reimplemented from pool::DbObjectCallBack.
Definition at line 124 of file PoolDbTupleCallback.cpp.
{
return pool::Success;
}
| pool::DbSelect* PoolDbTupleCallback::iterator | ( | ) | const [inline] |
| std::vector<PoolDbTokenWrap*>& PoolDbTupleCallback::links | ( | ) | [inline] |
Access to pointers of the links.
Definition at line 85 of file PoolDbTupleCallback.h.
{ return m_plinks; }
| const std::vector<int>& PoolDbTupleCallback::mapping | ( | ) | [inline] |
| void PoolDbTupleCallback::release | ( | ) | [virtual] |
Virtual delete.
Reimplemented from pool::DataCallBack.
Definition at line 61 of file PoolDbTupleCallback.cpp.
{
if ( --m_refCount <= 0 ) {
delete this;
}
}
| pool::DbSelect * PoolDbTupleCallback::select | ( | ISelectStatement * | sel ) |
Select new tokens according to new selection criteria.
Definition at line 102 of file PoolDbTupleCallback.cpp.
{
pool::deletePtr(m_iter);
if ( m_cntH.isValid() ) {
std::string criteria = (sel && (sel->type() & ISelectStatement::STRING))
? sel->criteria() : std::string("");
m_iter = new pool::DbSelect( criteria );
pool::DbDatabase dbH = m_cntH.containedIn();
m_iter->start(dbH, m_cntH.name());
}
return m_iter;
}
| pool::DbStatus PoolDbTupleCallback::start | ( | CallType | action_type, |
| void * | pObj, | ||
| void ** | context | ||
| ) | [virtual] |
Callback when a read sequence should be started.
Reimplemented from pool::DbObjectCallBack.
Definition at line 116 of file PoolDbTupleCallback.cpp.
{
return pool::Success;
}
| pool::DbBlob& PoolDbTupleCallback::stream | ( | ) | [inline] |
Access to streambuffer object, for items which must be blobified.
Definition at line 87 of file PoolDbTupleCallback.h.
{ return m_stream; }
std::vector< void* > PoolDbTupleCallback::m_addr [private] |
Vector with all addresses mapped.
Definition at line 48 of file PoolDbTupleCallback.h.
pool::DbContainer PoolDbTupleCallback::m_cntH [private] |
Pointer to pool container handle.
Definition at line 60 of file PoolDbTupleCallback.h.
pool::DbSelect* PoolDbTupleCallback::m_iter [private] |
Pointer to hold the select statement.
Definition at line 56 of file PoolDbTupleCallback.h.
Vector to store pointers link information for address columns.
Definition at line 50 of file PoolDbTupleCallback.h.
std::vector<int> PoolDbTupleCallback::m_map [private] |
Redirection map between N-tuple columns and DbTypeInfo columns.
Definition at line 54 of file PoolDbTupleCallback.h.
std::vector<PoolDbTokenWrap*> PoolDbTupleCallback::m_plinks [private] |
Vector to store pointers link information for address columns.
Definition at line 52 of file PoolDbTupleCallback.h.
long PoolDbTupleCallback::m_refCount [private] |
Reference counter.
Definition at line 62 of file PoolDbTupleCallback.h.
pool::DbBlob PoolDbTupleCallback::m_stream [private] |
Reference to streambuffer to hold blobified data.
Definition at line 58 of file PoolDbTupleCallback.h.