| The Gaudi Framework v29r1 (5cd95fa2)

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

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

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 <GaudiKernel/SmartRefVector.h>`

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

## Public Member Functions
| SmartRefVector ()
| Standard Constructor. More...
template<class ITERATOR >
| SmartRefVector (ITERATOR first, ITERATOR last)
| templated Constructor More...
| SmartRefVector (const SmartRefVector &copy)
| Copy Constructor. More...
SmartRefVector< TYPE > & | operator() (ContainedObject *pObj)
| Standard destructor. More...
const SmartRefVector< TYPE > & | operator() (const ContainedObject *pObj) const
| operator() const: assigns parent object for serialisation More...
SmartRefVector< TYPE > & | operator() (DataObject *pObj)
| operator(): assigns parent object for serialisation More...
const SmartRefVector< TYPE > & | operator() (const DataObject *pObj) const
| operator() const: assigns parent object for serialisation More...
SmartRefVector< TYPE > & | operator= (const SmartRefVector< TYPE > &copy)
| Assignment. More...
const std::type_info * | type () const
| Access to embedded type. More...
StreamBuffer & | readRefs (StreamBuffer &s)
| Helper to read references. More...
StreamBuffer & | writeRefs (StreamBuffer &s) const
| Helper to write references. More...
Public Member Functions inherited from std::vector< SmartRef< TYPE > >
SmartRef< TYPE > | push_back (SmartRef< TYPE >...args)
SmartRef< TYPE > | crbegin (SmartRef< TYPE >...args)
SmartRef< TYPE > | erase (SmartRef< TYPE >...args)
SmartRef< TYPE > | data (SmartRef< TYPE >...args)
SmartRef< TYPE > | insert (SmartRef< TYPE >...args)
SmartRef< TYPE > | pop_back (SmartRef< TYPE >...args)
SmartRef< TYPE > | shrink_to_fit (SmartRef< TYPE >...args)
SmartRef< TYPE > | back (SmartRef< TYPE >...args)
SmartRef< TYPE > | end (SmartRef< TYPE >...args)
SmartRef< TYPE > | resize (SmartRef< TYPE >...args)
SmartRef< TYPE > | emplace_back (SmartRef< TYPE >...args)
SmartRef< TYPE > | size (SmartRef< TYPE >...args)
SmartRef< TYPE > | cbegin (SmartRef< TYPE >...args)
SmartRef< TYPE > | front (SmartRef< TYPE >...args)
SmartRef< TYPE > | ~vector (SmartRef< TYPE >...args)
SmartRef< TYPE > | rbegin (SmartRef< TYPE >...args)
SmartRef< TYPE > | crend (SmartRef< TYPE >...args)
SmartRef< TYPE > | assign (SmartRef< TYPE >...args)
SmartRef< TYPE > | operator= (SmartRef< TYPE >...args)
SmartRef< TYPE > | vector (SmartRef< TYPE >...args)
SmartRef< TYPE > | reserve (SmartRef< TYPE >...args)
SmartRef< TYPE > | capacity (SmartRef< TYPE >...args)
SmartRef< TYPE > | empty (SmartRef< TYPE >...args)
SmartRef< TYPE > | cend (SmartRef< TYPE >...args)
SmartRef< TYPE > | swap (SmartRef< TYPE >...args)
SmartRef< TYPE > | max_size (SmartRef< TYPE >...args)
SmartRef< TYPE > | rend (SmartRef< TYPE >...args)
SmartRef< TYPE > | get_allocator (SmartRef< TYPE >...args)
SmartRef< TYPE > | clear (SmartRef< TYPE >...args)
SmartRef< TYPE > | at (SmartRef< TYPE >...args)
SmartRef< TYPE > | emplace (SmartRef< TYPE >...args)
SmartRef< TYPE > | operator[] (SmartRef< TYPE >...args)
SmartRef< TYPE > | begin (SmartRef< TYPE >...args)

## Protected Types
typedef SmartRef< TYPE > | _Entry
| That's the type of crap I am hosting. More...
typedef std::vector< _Entry > | _Base
| Object types: typedef myself as Base. More...
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. More...

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

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

## Additional Inherited Members
Public Attributes inherited from std::vector< SmartRef< TYPE > >
SmartRef< TYPE > | elements
| STL member. More...

## 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 55 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 61 of file SmartRefVector.h.

template<class TYPE>

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

Definition at line 62 of file SmartRefVector.h.

template<class TYPE>

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

Definition at line 63 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 59 of file SmartRefVector.h.

## Constructor & Destructor Documentation

template<class TYPE>

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

Standard Constructor.

Definition at line 82 of file SmartRefVector.h.

83 {
84 m_contd = 0;
85 m_data = 0;
86 }
SmartRefVector::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefVector.h:68
SmartRefVector::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefVector.h:66
template<class TYPE>
template<class ITERATOR >

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

templated Constructor

Definition at line 89 of file SmartRefVector.h.

90 : std::vector<SmartRef<TYPE>>( first, last ), m_data( 0 ), m_contd( 0 )
91 {
92 }
SmartRefVector::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefVector.h:68
std::vector
STL class.
SmartRefVector::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefVector.h:66
template<class TYPE>

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

Copy Constructor.

Definition at line 94 of file SmartRefVector.h.

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

## 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 71 of file SmartRefVector.h.

72 {
73 m_data = pObj;
74 m_contd = pContd;
75 for ( _BaseConstIter i = _Base::begin(); i != _Base::end(); i++ ) {
76 ( *i )._setEnvironment( pObj, pContd );
77 }
78 }
std::vector::end
T end(T...args)
SmartRefVector::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefVector.h:68
SmartRefVector::_BaseConstIter
std::vector< _Entry >::const_iterator _BaseConstIter
Definition: SmartRefVector.h:62
std::vector::begin
T begin(T...args)
SmartRefVector::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefVector.h:66
template<class TYPE>

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

Standard destructor.

operator(): assigns parent object for serialisation

Definition at line 100 of file SmartRefVector.h.

101 {
102 _setEnvironment( ( 0 == pObj ) ? 0 : pObj->parent(), pObj );
103 return *this;
104 }
ContainedObject::parent
const ObjectContainerBase * parent() const
Access to parent object.
Definition: ContainedObject.h:52
SmartRefVector::_setEnvironment
void _setEnvironment(const DataObject *pObj, const ContainedObject *pContd) const
Set the environment for the vector and all contained objects references.
Definition: SmartRefVector.h:71
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.

107 {
108 _setEnvironment( ( 0 == pObj ) ? 0 : pObj->parent(), pObj );
109 return *this;
110 }
ContainedObject::parent
const ObjectContainerBase * parent() const
Access to parent object.
Definition: ContainedObject.h:52
SmartRefVector::_setEnvironment
void _setEnvironment(const DataObject *pObj, const ContainedObject *pContd) const
Set the environment for the vector and all contained objects references.
Definition: SmartRefVector.h:71
template<class TYPE>

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

operator(): assigns parent object for serialisation

Definition at line 112 of file SmartRefVector.h.

113 {
114 _setEnvironment( pObj, 0 );
115 return *this;
116 }
SmartRefVector::_setEnvironment
void _setEnvironment(const DataObject *pObj, const ContainedObject *pContd) const
Set the environment for the vector and all contained objects references.
Definition: SmartRefVector.h:71
template<class TYPE>

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

operator() const: assigns parent object for serialisation

Definition at line 118 of file SmartRefVector.h.

119 {
120 _setEnvironment( pObj, 0 );
121 return *this;
122 }
SmartRefVector::_setEnvironment
void _setEnvironment(const DataObject *pObj, const ContainedObject *pContd) const
Set the environment for the vector and all contained objects references.
Definition: SmartRefVector.h:71
template<class TYPE>

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

Assignment.

Definition at line 124 of file SmartRefVector.h.

125 {
126 _Base::operator=( copy );
127 // Harms.... MF
128 // on copy we MUST make a 1 to 1 copy
129 // _setEnvironment( copy.m_data, copy.m_contd );
130 // use instead:
131 m_data = copy.m_data;
132 m_contd = copy.m_contd;
133 return *this;
134 }
std::vector::operator=
T operator=(T...args)
SmartRefVector::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefVector.h:68
SmartRefVector::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefVector.h:66
template<class TYPE >

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

Helper to read references.

Definition at line 162 of file SmartRefVector.h.

163 {
164 long len;
165 _Base::erase( _Base::begin(), _Base::end() );
166 s >> len;
167 for ( long i = 0; i < len; i++ ) {
168 _BaseValueType entry;
169 entry._setEnvironment( m_data, m_contd );
170 entry.readRef( s );
171 _Base::push_back( entry );
172 }
173 return s;
174 }
SmartRefVector::_BaseValueType
std::vector< _Entry >::value_type _BaseValueType
Definition: SmartRefVector.h:63
std::vector::end
T end(T...args)
SmartRefVector::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefVector.h:68
std::vector::push_back
T push_back(T...args)
std::vector::erase
T erase(T...args)
std::vector::begin
T begin(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253
SmartRefVector::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefVector.h:66
template<class TYPE>

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

Access to embedded type.

Definition at line 136 of file SmartRefVector.h.

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

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

Helper to write references.

Definition at line 150 of file SmartRefVector.h.

151 {
152 long len = _Base::size();
153 s << len;
154 for ( _BaseConstIter i = _Base::begin(); i != _Base::end(); i++ ) {
155 ( *i )._setEnvironment( m_data, m_contd );
156 ( *i ).writeRef( s );
157 }
158 return s;
159 }
std::vector::end
T end(T...args)
SmartRefVector::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefVector.h:68
SmartRefVector::_BaseConstIter
std::vector< _Entry >::const_iterator _BaseConstIter
Definition: SmartRefVector.h:62
std::vector::size
T size(T...args)
std::vector::begin
T begin(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253
SmartRefVector::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefVector.h:66

## Friends And Related Function Documentation

template<class TYPE>

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

Output Streamer operator.

Definition at line 143 of file SmartRefVector.h.

143 { return ptr.writeRefs( _s ); }
SmartRefVector::writeRefs
StreamBuffer & writeRefs(StreamBuffer &s) const
Helper to write references.
Definition: SmartRefVector.h:150
template<class TYPE>

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

Input Streamer operator.

Definition at line 146 of file SmartRefVector.h.

146 { return ptr.readRefs( _s ); }
SmartRefVector::readRefs
StreamBuffer & readRefs(StreamBuffer &s)
Helper to read references.
Definition: SmartRefVector.h:162

## 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 68 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 66 of file SmartRefVector.h.

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

- GaudiKernel/GaudiKernel/SmartRefVector.h