ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
pool::DbIter< T > Class Template Reference

#include <DbIter.h>

Collaboration diagram for pool::DbIter< T >:

Public Member Functions

 DbIter (DbAccessMode mode=pool::READ)
 Constructor with initializing arguments. More...
 
virtual ~DbIter ()
 Destructor. More...
 
const DbContainercontainer () const
 Access to container handler. More...
 
bool isValid () const
 Check validity. More...
 
DbHandle< T > & operator-> ()
 Dereference operator. More...
 
DbHandle< T > & operator* ()
 Dereference operator. More...
 
DbHandle< T > & handle ()
 Access to current object handle. More...
 
const DbHandle< T > & handle () const
 Access to current object handle (CONST) More...
 
const T * object () const
 Dereference operator. More...
 
T * object ()
 
const Tokentoken () const
 Access to cursor token. More...
 
DbStatus scan (const DbContainer &cntH, const DbTypeInfo *typ)
 Scan the container. More...
 
DbStatus next ()
 Retrieve next element. More...
 

Private Member Functions

 DbIter (const DbIter &c)
 Copy constructor. More...
 
bool operator== (const DbIter< T > &iter) const
 Equality operator. More...
 
DbIteroperator= (const DbIter &copy)
 Assignment operator. More...
 

Private Attributes

DbContainer m_cnt
 Handle to container object. More...
 
DbHandle< T > m_obj
 Handle to current object. More...
 
Token m_token
 Current cursor for the loop. More...
 
const DbTypeInfom_type
 Object type used for this scan. More...
 
DbAccessMode m_mode
 Data access type (Default to READ) More...
 

Detailed Description

template<class T>
class pool::DbIter< T >

Definition at line 41 of file DbIter.h.

Constructor & Destructor Documentation

◆ DbIter() [1/2]

template<class T >
pool::DbIter< T >::DbIter ( const DbIter< T > &  c)
inlineprivate

Copy constructor.

Definition at line 55 of file DbIter.h.

55  : m_obj(c.m_obj), m_token(c.m_token), m_type(c.m_type),
56  m_mode(c.m_mode) { }

◆ DbIter() [2/2]

template<class T >
pool::DbIter< T >::DbIter ( DbAccessMode  mode = pool::READ)
inline

Constructor with initializing arguments.

Definition at line 71 of file DbIter.h.

71 : m_token(), m_type(0), m_mode(mode) { }

◆ ~DbIter()

template<class T >
virtual pool::DbIter< T >::~DbIter ( )
inlinevirtual

Destructor.

Definition at line 73 of file DbIter.h.

73 { }

Member Function Documentation

◆ container()

template<class T >
const DbContainer& pool::DbIter< T >::container ( ) const
inline

Access to container handler.

Definition at line 75 of file DbIter.h.

75 { return m_cnt; }

◆ handle() [1/2]

template<class T >
DbHandle<T>& pool::DbIter< T >::handle ( )
inline

Access to current object handle.

Definition at line 83 of file DbIter.h.

83 { return m_obj; }

◆ handle() [2/2]

template<class T >
const DbHandle<T>& pool::DbIter< T >::handle ( ) const
inline

Access to current object handle (CONST)

Definition at line 85 of file DbIter.h.

85 { return m_obj; }

◆ isValid()

template<class T >
bool pool::DbIter< T >::isValid ( ) const
inline

Check validity.

Definition at line 77 of file DbIter.h.

77 { return m_obj.isValid(); }

◆ next()

template<class T >
pool::DbStatus pool::DbIter< T >::next
inline

Retrieve next element.

Retrieve next element of iteration.

Definition at line 117 of file DbIter.h.

118 {
119  DbObjectHandle<DbObject> objH(m_obj.ptr());
120  objH._setType(m_obj.type());
121  m_token.oid().second++; // MN: assuming first OID=1?
122  if ( m_cnt.loadNext(objH, m_token.oid(), m_type).isSuccess() ) {
123  m_obj._setObject(static_cast<T*>(objH.ptr()));
124  return Success;
125  }
126  return Error;
127 }

◆ object() [1/2]

template<class T >
T* pool::DbIter< T >::object ( )
inline

Definition at line 88 of file DbIter.h.

88 { return m_obj.ptr(); }

◆ object() [2/2]

template<class T >
const T* pool::DbIter< T >::object ( ) const
inline

Dereference operator.

Definition at line 87 of file DbIter.h.

87 { return m_obj.ptr(); }

◆ operator*()

template<class T >
DbHandle<T>& pool::DbIter< T >::operator* ( )
inline

Dereference operator.

Definition at line 81 of file DbIter.h.

81 { return m_obj; }

◆ operator->()

template<class T >
DbHandle<T>& pool::DbIter< T >::operator-> ( )
inline

Dereference operator.

Definition at line 79 of file DbIter.h.

79 { return m_obj; }

◆ operator=()

template<class T >
DbIter& pool::DbIter< T >::operator= ( const DbIter< T > &  copy)
inlineprivate

Assignment operator.

Definition at line 61 of file DbIter.h.

61  {
62  m_cnt = copy.m_cnt;
63  m_obj = copy.m_obj;
64  m_mode = copy.m_mode;
65  m_token = copy.m_token;
66  m_type = copy.m_type;
67  return *this;
68  }

◆ operator==()

template<class T >
bool pool::DbIter< T >::operator== ( const DbIter< T > &  iter) const
inlineprivate

Equality operator.

Definition at line 58 of file DbIter.h.

59  { return m_obj.ptr() == iter.m_obj.ptr(); }

◆ scan()

template<class T >
pool::DbStatus pool::DbIter< T >::scan ( const DbContainer cntH,
const DbTypeInfo typ 
)
inline

Scan the container.

Definition at line 104 of file DbIter.h.

106 {
107  if ( cntH.isValid() ) {
108  m_type = typ;
109  m_cnt = cntH;
110  }
111  m_obj = DbHandle<T>(cntH.type());
112 
113  return cntH.isValid()? Success : Error;
114 }

◆ token()

template<class T >
const Token* pool::DbIter< T >::token ( ) const
inline

Access to cursor token.

Definition at line 90 of file DbIter.h.

90 { return &m_token; }

Member Data Documentation

◆ m_cnt

template<class T >
DbContainer pool::DbIter< T >::m_cnt
private

Handle to container object.

Definition at line 43 of file DbIter.h.

◆ m_mode

template<class T >
DbAccessMode pool::DbIter< T >::m_mode
private

Data access type (Default to READ)

Definition at line 51 of file DbIter.h.

◆ m_obj

template<class T >
DbHandle<T> pool::DbIter< T >::m_obj
private

Handle to current object.

Definition at line 45 of file DbIter.h.

◆ m_token

template<class T >
Token pool::DbIter< T >::m_token
private

Current cursor for the loop.

Definition at line 47 of file DbIter.h.

◆ m_type

template<class T >
const DbTypeInfo* pool::DbIter< T >::m_type
private

Object type used for this scan.

Definition at line 49 of file DbIter.h.


The documentation for this class was generated from the following file:
pool::DbIter::m_token
Token m_token
Current cursor for the loop.
Definition: DbIter.h:47
pool::DbContainer::loadNext
DbStatus loadNext(DbObjectHandle< T > &objH, Token::OID_t &linkH, const DbTypeInfo *typ)
Load object in the container identified by its handle.
Definition: DbContainer.h:203
pool::DbIter::m_type
const DbTypeInfo * m_type
Object type used for this scan.
Definition: DbIter.h:49
pool::DbIter::m_obj
DbHandle< T > m_obj
Handle to current object.
Definition: DbIter.h:45
pool::DbObjectHandle::_setObject
void _setObject(T *p)
Set object value.
Definition: DbObject.h:105
Preparation.mode
mode
Definition: Preparation.py:95
pool::DbStatus::isSuccess
bool isSuccess() const
Check if the return code indicated success.
Definition: DbStatus.h:104
pool::DbIter::m_mode
DbAccessMode m_mode
Data access type (Default to READ)
Definition: DbIter.h:51
pool::DbIter::m_cnt
DbContainer m_cnt
Handle to container object.
Definition: DbIter.h:43
Token::oid
const OID_t & oid() const
Access object identifier.
Definition: Token.h:79
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
calibdata.copy
bool copy
Definition: calibdata.py:27
python.compressB64.c
def c
Definition: compressB64.py:93
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35