| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
SmartRefVector< TYPE > Class Template Reference

Kernel objects: SmartRefVector. More...

`#include <SmartRefVector.h>`

Inheritance diagram for SmartRefVector< TYPE >:
[legend]
Collaboration diagram for SmartRefVector< TYPE >:
[legend]

## Public Member Functions
| SmartRefVector ()
| Standard Constructor.
template<class ITERATOR >
| SmartRefVector (ITERATOR first, ITERATOR last)
| templated Constructor
| SmartRefVector (const SmartRefVector &copy)
| Copy Constructor.
SmartRefVector< TYPE > & | operator() (ContainedObject *pObj)
| Standard destructor.
const SmartRefVector< TYPE > & | operator() (const ContainedObject *pObj) const
| operator() const: assigns parent object for serialisation
SmartRefVector< TYPE > & | operator() (DataObject *pObj)
| operator(): assigns parent object for serialisation
const SmartRefVector< TYPE > & | operator() (const DataObject *pObj) const
| operator() const: assigns parent object for serialisation
SmartRefVector< TYPE > & | operator= (const SmartRefVector< TYPE > &copy)
| Assignment.
const std::type_info * | type () const
| Access to embedded type.
StreamBuffer & | readRefs (StreamBuffer &s)
| Helper to read references.
StreamBuffer & | writeRefs (StreamBuffer &s) const
| Helper to write references.
Public Member Functions inherited from std::vector< SmartRef< TYPE > >
void | assign (_InputIterator __first, _InputIterator __last)
void | assign (size_type __n, const value_type &__val)
const_reference | at (size_type __n) const
reference | at (size_type __n)
const_reference | back () const
reference | back ()
const_iterator | begin () const
iterator | begin ()
size_type | capacity () const
void | clear ()
const_pointer | data () const
pointer | data ()
bool | empty () const
const_iterator | end () const
iterator | end ()
iterator | erase (iterator __first, iterator __last)
iterator | erase (iterator __position)
const_reference | front () const
reference | front ()
void | insert (iterator __position, _InputIterator __first, _InputIterator __last)
void | insert (iterator __position, size_type __n, const value_type &__x)
iterator | insert (iterator __position, const value_type &__x)
size_type | max_size () const
vector & | operator= (const vector &__x)
const_reference | operator[] (size_type __n) const
reference | operator[] (size_type __n)
void | pop_back ()
void | push_back (const value_type &__x)
const_reverse_iterator | rbegin () const
reverse_iterator | rbegin ()
const_reverse_iterator | rend () const
reverse_iterator | rend ()
void | reserve (size_type __n)
void | resize (size_type __new_size, value_type __x=value_type())
size_type | size () const
void | swap (vector &__x)
| vector (_InputIterator __first, _InputIterator __last, const allocator_type &__a=allocator_type())
| vector (const vector &__x)
| vector (size_type __n, const value_type &__value=value_type(), const allocator_type &__a=allocator_type())
| vector (const allocator_type &__a)
| vector ()
| ~vector ()
SmartRef< TYPE > * | _M_allocate (size_t __n)
void | _M_deallocate (SmartRef< TYPE > *__p, size_t __n)
const _Tp_alloc_type & | _M_get_Tp_allocator () const
_Tp_alloc_type & | _M_get_Tp_allocator ()
allocator_type | get_allocator () const

## Protected Types
typedef SmartRef< TYPE > | _Entry
| That's the type of crap I am hosting.
typedef std::vector< _Entry > | _Base
| Object types: typedef myself as Base.
typedef std::vector< _Entry > ::const_iterator | _BaseConstIter
typedef std::vector< _Entry > ::value_type | _BaseValueType

## Protected Member Functions
void | _setEnvironment (const DataObject *pObj, const ContainedObject *pContd) const
| Set the environment for the vector and all contained objects references.
Protected Member Functions inherited from std::vector< SmartRef< TYPE > >
pointer | _M_allocate_and_copy (size_type __n, _ForwardIterator __first, _ForwardIterator __last)
void | _M_assign_aux (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
void | _M_assign_aux (_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
void | _M_assign_dispatch (_InputIterator __first, _InputIterator __last, __false_type)
void | _M_assign_dispatch (_Integer __n, _Integer __val, __true_type)
size_type | _M_check_len (size_type __n, const char *__s) const
void | _M_erase_at_end (pointer __pos)
void | _M_fill_assign (size_type __n, const value_type &__val)
void | _M_fill_initialize (size_type __n, const value_type &__value)
void | _M_fill_insert (iterator __pos, size_type __n, const value_type &__x)
void | _M_initialize_dispatch (_InputIterator __first, _InputIterator __last, __false_type)
void | _M_initialize_dispatch (_Integer __n, _Integer __value, __true_type)
void | _M_insert_aux (iterator __position, const value_type &__x)
void | _M_insert_dispatch (iterator __pos, _InputIterator __first, _InputIterator __last, __false_type)
void | _M_insert_dispatch (iterator __pos, _Integer __n, _Integer __val, __true_type)
void | _M_range_check (size_type __n) const
void | _M_range_initialize (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
void | _M_range_initialize (_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
void | _M_range_insert (iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
void | _M_range_insert (iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag)
Protected Member Functions inherited from std::_Vector_base< _Tp, _Alloc >
_Tp * | _M_allocate (size_t __n)
void | _M_deallocate (_Tp *__p, size_t __n)
const _Tp_alloc_type & | _M_get_Tp_allocator () const
_Tp_alloc_type & | _M_get_Tp_allocator ()
| _Vector_base (size_t __n, const allocator_type &__a)
| _Vector_base (const allocator_type &__a)
| _Vector_base ()
allocator_type | get_allocator () const
| ~_Vector_base ()

## Protected Attributes
const DataObject * | m_data
| Object data: Pointer to the identifiable object the link originates.
const ContainedObject * | m_contd
| Object data: Pointer to the Contained object (if applicable)

## Friends
StreamBuffer & | operator<< (StreamBuffer &_s, const SmartRefVector< TYPE > &ptr)
| Output Streamer operator.
StreamBuffer & | operator>> (StreamBuffer &_s, SmartRefVector< TYPE > &ptr)
| Input Streamer operator.

## Additional Inherited Members
Public Types inherited from std::vector< SmartRef< TYPE > >
typedef _Alloc | allocator_type
typedef __gnu_cxx::__normal_iterator < const_pointer, vector_type > | const_iterator
typedef _Tp_alloc_type::const_pointer | const_pointer
typedef _Tp_alloc_type::const_reference | const_reference
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator
typedef ptrdiff_t | difference_type
typedef __gnu_cxx::__normal_iterator < pointer, vector_type > | iterator
typedef _Tp_alloc_type::pointer | pointer
typedef _Tp_alloc_type::reference | reference
typedef std::reverse_iterator < iterator > | reverse_iterator
typedef size_t | size_type
typedef SmartRef< TYPE > | value_type
Public Attributes inherited from std::vector< SmartRef< TYPE > >
_Vector_impl | _M_impl
T | elements
| STL member.

## Detailed Description

### template<class TYPE>
class SmartRefVector< TYPE >

Kernel objects: SmartRefVector.

Description: The SmartRefVector class allows transparent handling of multiple object links within the data store. Links are unloaded a priori and will only be loaded "on demand", i.e. when dereferenced.

SmartRefVectors should behave in the same way as normal vectors of pointers;

Using SmartRefVectors the environment of the vector is automatically propagated to each contained reference.

In order to speed things up, an attempt was made to avoid any virtual functions.

Base Class: STL vector

Dependencies:

- Base class: vector
- SmartRef constructs: Gaudi/Kernel/SmartRef.h

History :

    +---------+----------------------------------------------+--------+
    |    Date |                 Comment                      | Who    |
    +---------+----------------------------------------------+--------+
    | 12/07/99| Initial version.                             | MF     |
    +---------+----------------------------------------------+--------+

Author: M.Frank Version: 1.0

Definition at line 54 of file SmartRefVector.h.

## Member Typedef Documentation

template<class TYPE>

typedef std::vector<_Entry> SmartRefVector< TYPE >::_Base
| protected

Object types: typedef myself as Base.

Definition at line 59 of file SmartRefVector.h.

template<class TYPE>

typedef std::vector<_Entry>::const_iterator SmartRefVector< TYPE >::_BaseConstIter
| protected

Definition at line 60 of file SmartRefVector.h.

template<class TYPE>

typedef std::vector<_Entry>::value_type SmartRefVector< TYPE >::_BaseValueType
| protected

Definition at line 61 of file SmartRefVector.h.

template<class TYPE>

typedef SmartRef<TYPE> SmartRefVector< TYPE >::_Entry
| protected

That's the type of crap I am hosting.

Definition at line 57 of file SmartRefVector.h.

## Constructor & Destructor Documentation

template<class TYPE>

SmartRefVector< TYPE >::SmartRefVector | ( |  | ) |
| inline

Standard Constructor.

Definition at line 78 of file SmartRefVector.h.

{
m_contd = 0;
m_data = 0;
}
template<class TYPE>
template<class ITERATOR >

SmartRefVector< TYPE >::SmartRefVector | ( | ITERATOR | first,
|  | ITERATOR | last
| ) |  |
| inline

templated Constructor

Definition at line 84 of file SmartRefVector.h.

: std::vector< SmartRef<TYPE> >( first , last )
, m_data ( 0 )
, m_contd ( 0 )
{
}
template<class TYPE>

SmartRefVector< TYPE >::SmartRefVector | ( | const SmartRefVector< TYPE > & | copy | ) |
| inline

Copy Constructor.

Definition at line 92 of file SmartRefVector.h.

: std::vector< SmartRef<TYPE> >(copy) {
*this = copy;
}

## Member Function Documentation

template<class TYPE>

void SmartRefVector< TYPE >::_setEnvironment | ( | const DataObject * | pObj,
|  | const ContainedObject * | pContd
| ) |  | const
| inline protected

Set the environment for the vector and all contained objects references.

Definition at line 69 of file SmartRefVector.h.

{
m_data = pObj;
m_contd = pContd;
for ( _BaseConstIter i = _Base::begin(); i != _Base::end(); i++ ) {
(*i)._setEnvironment(pObj, pContd);
}
}
template<class TYPE>

SmartRefVector<TYPE>& SmartRefVector< TYPE >::operator() | ( | ContainedObject * | pObj | ) |
| inline

Standard destructor.

operator(): assigns parent object for serialisation

Definition at line 101 of file SmartRefVector.h.

{
_setEnvironment((0==pObj) ? 0 : pObj->parent(), pObj);
return *this;
}
template<class TYPE>

const SmartRefVector<TYPE>& SmartRefVector< TYPE >::operator() | ( | const ContainedObject * | pObj | ) | const
| inline

operator() const: assigns parent object for serialisation

Definition at line 106 of file SmartRefVector.h.

{
_setEnvironment((0==pObj) ? 0 : pObj->parent(), pObj);
return *this;
}
template<class TYPE>

SmartRefVector<TYPE>& SmartRefVector< TYPE >::operator() | ( | DataObject * | pObj | ) |
| inline

operator(): assigns parent object for serialisation

Definition at line 111 of file SmartRefVector.h.

{
_setEnvironment(pObj,0);
return *this;
}
template<class TYPE>

const SmartRefVector<TYPE>& SmartRefVector< TYPE >::operator() | ( | const DataObject * | pObj | ) | const
| inline

operator() const: assigns parent object for serialisation

Definition at line 116 of file SmartRefVector.h.

{
_setEnvironment(pObj,0);
return *this;
}
template<class TYPE>

SmartRefVector<TYPE>& SmartRefVector< TYPE >::operator= | ( | const SmartRefVector< TYPE > & | copy | ) |
| inline

Assignment.

Definition at line 121 of file SmartRefVector.h.

{
_Base::operator=(copy);
// Harms.... MF
// on copy we MUST make a 1 to 1 copy
// _setEnvironment( copy.m_data, copy.m_contd );
// use instead:
m_data = copy.m_data;
m_contd = copy.m_contd;
return *this;
}
template<class TYPE >

StreamBuffer & SmartRefVector< TYPE >::readRefs | ( | StreamBuffer & | s | ) |
| inline

Helper to read references.

Definition at line 163 of file SmartRefVector.h.

{
long len;
_Base::erase( _Base::begin(), _Base::end() );
s >> len;
for ( long i = 0; i < len; i++ ) {
_BaseValueType entry;
entry._setEnvironment(m_data, m_contd);
entry.readRef(s);
_Base::push_back( entry );
}
return s;
}
template<class TYPE>

const std::type_info* SmartRefVector< TYPE >::type | ( |  | ) | const
| inline

Access to embedded type.

Definition at line 132 of file SmartRefVector.h.

{
return &typeid(TYPE);
}
template<class TYPE >

StreamBuffer & SmartRefVector< TYPE >::writeRefs | ( | StreamBuffer & | s | ) | const
| inline

Helper to write references.

Definition at line 152 of file SmartRefVector.h.

{
long len = _Base::size();
s << len;
for ( _BaseConstIter i = _Base::begin(); i != _Base::end(); i++ ) {
(*i)._setEnvironment(m_data, m_contd);
(*i).writeRef(s);
}
return s;
}

## Friends And Related Function Documentation

template<class TYPE>

StreamBuffer& operator<< | ( | StreamBuffer & | _s,
|  | const SmartRefVector< TYPE > & | ptr
| ) |  |
| friend

Output Streamer operator.

Definition at line 141 of file SmartRefVector.h.

{
return ptr.writeRefs(_s);
}
template<class TYPE>

StreamBuffer& operator>> | ( | StreamBuffer & | _s,
|  | SmartRefVector< TYPE > & | ptr
| ) |  |
| friend

Input Streamer operator.

Definition at line 146 of file SmartRefVector.h.

{
return ptr.readRefs(_s);
}

## Member Data Documentation

template<class TYPE>

const ContainedObject* SmartRefVector< TYPE >::m_contd
| mutable protected

Object data: Pointer to the Contained object (if applicable)

Definition at line 66 of file SmartRefVector.h.

template<class TYPE>

const DataObject* SmartRefVector< TYPE >::m_data
| mutable protected

Object data: Pointer to the identifiable object the link originates.

Definition at line 64 of file SmartRefVector.h.

The documentation for this class was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiKernel/GaudiKernel/SmartRefVector.h