| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# RefTable1toN< FROM, TO > Class Template Reference

`#include <RefTable.h>`

Inheritance diagram for RefTable1toN< FROM, TO >:
[legend]
Collaboration diagram for RefTable1toN< FROM, TO >:
[legend]

List of all members.

## Public Member Functions
| RefTable1toN (const CLID &clid, int len=16)
| Standard Constructor.
virtual | ~RefTable1toN ()
| Standard Destructor.
virtual const CLID & | clID () const
| Retrieve reference to class definition structure.
bool | insert (const FROM *from, TO *to)
| Insert new Entry into Reference container.
bool | insert (const FROM *from, const SmartRef< TO > &to)
| Insert new Entry into Reference container.
bool | insert (const FROM *from, const EntryType &to)
| Insert new Entry into Reference container.
EntryType & | reference (const FROM *from)
| Find Reference from it's source entry.
const EntryType & | reference (const FROM *from) const
| Find Reference from it's source entry (CONST).
bool | isReferenced (const FROM *from, const EntryType &to)
| Check if two entries are Referenced to each other.
bool | isReferenced (const FROM *from, const TO *to)
| Check if two entries are Referenced to each other.
bool | isReferenced (const FROM *from, const SmartRef< TO > &to)
| Check if two entries are Referenced to each other.

## Detailed Description

### template<class FROM, class TO>
class RefTable1toN< FROM, TO >

Definition at line 209 of file RefTable.h.

## Constructor & Destructor Documentation

template<class FROM, class TO>

RefTable1toN< FROM, TO >::RefTable1toN | ( | const CLID & | clid,
|  | int | len = `16` |
| ) |  |  | `[inline]`

Standard Constructor.

Definition at line 213 of file RefTable.h.

    00214   : RefTableBase< FROM , SmartRefVector<TO> >(clid, len)    {
    00215   }

template<class FROM, class TO>

virtual RefTable1toN< FROM, TO >::~RefTable1toN | ( |  | ) | `[inline, virtual]`

Standard Destructor.

Definition at line 217 of file RefTable.h.

    00217                             {
    00218   }

## Member Function Documentation

template<class FROM, class TO>

virtual const CLID& RefTable1toN< FROM, TO >::clID | ( |  | ) | const`[inline, virtual]`

Retrieve reference to class definition structure.

Reimplemented from DataObject.

Definition at line 220 of file RefTable.h.

    00220                                           {
    00221     return m_clid;
    00222   }

template<class FROM, class TO>

bool RefTable1toN< FROM, TO >::insert | ( | const FROM * | from,
|  | TO * | to |
| ) |  |  | `[inline]`

Insert new Entry into Reference container.

Definition at line 224 of file RefTable.h.

    00224                                              {
    00225     EntryType* entry = i_reference(from);
    00226     if ( 0 == entry )   {
    00227       bool result = insertMapElement(from, EntryType());
    00228       EntryType* newEntry = i_reference(from);
    00229       if ( !( 0 == newEntry) )    {
    00230         newEntry->push_back( SmartRef<TO>(to) );
    00231         return true;
    00232       }
    00233       return false;
    00234     }
    00235     entry->push_back( SmartRef<TO>(to) );
    00236     return true;
    00237   }

template<class FROM, class TO>

bool RefTable1toN< FROM, TO >::insert | ( | const FROM * | from,
|  | const SmartRef< TO > & | to |
| ) |  |  | `[inline]`

Insert new Entry into Reference container.

Definition at line 239 of file RefTable.h.

    00239                                                              {
    00240     EntryType* entry = i_reference(from);
    00241     if ( 0 == entry )   {
    00242       bool result = insertMapElement(from, EntryType());
    00243       EntryType* newEntry = i_reference(from);
    00244       if ( !(0 == newEntry) )    {
    00245         newEntry->push_back( to );
    00246         return true;
    00247       }
    00248       return false;
    00249     }
    00250     entry->push_back( to );
    00251     return true;
    00252   }

template<class FROM, class TO>

bool RefTable1toN< FROM, TO >::insert | ( | const FROM * | from,
|  | const EntryType & | to |
| ) |  |  | `[inline]`

Insert new Entry into Reference container.

Definition at line 254 of file RefTable.h.

    00254                                                           {
    00255     return insertMapElement(from, const_cast<EntryType&>(to));
    00256   }

template<class FROM, class TO>

EntryType& RefTable1toN< FROM, TO >::reference | ( | const FROM * | from | ) | `[inline]`

Find Reference from it's source entry.

Definition at line 258 of file RefTable.h.

    00258                                           {
    00259     static EntryType empty;
    00260     EntryType* e = i_reference(from);
    00261     return (0 == e) ? empty : *e;
    00262   }

template<class FROM, class TO>

const EntryType& RefTable1toN< FROM, TO >::reference | ( | const FROM * | from | ) | const`[inline]`

Find Reference from it's source entry (CONST).

Definition at line 264 of file RefTable.h.

    00264                                                       {
    00265     static EntryType empty;
    00266     EntryType* e = i_reference(from);
    00267     return (0 == e) ? empty : (*e);
    00268   }

template<class FROM, class TO>

bool RefTable1toN< FROM, TO >::isReferenced | ( | const FROM * | from,
|  | const EntryType & | to |
| ) |  |  | `[inline]`

Check if two entries are Referenced to each other.

Definition at line 270 of file RefTable.h.

    00270                                                               {
    00271     const EntryType* e = i_reference(from);
    00272     return (0 == e) ? false : (*e == to);
    00273   }

template<class FROM, class TO>

bool RefTable1toN< FROM, TO >::isReferenced | ( | const FROM * | from,
|  | const TO * | to |
| ) |  |  | `[inline]`

Check if two entries are Referenced to each other.

Definition at line 275 of file RefTable.h.

    00275                                                        {
    00276     return isReferenced(from, SmartRef<TO>(to));
    00277   }

template<class FROM, class TO>

bool RefTable1toN< FROM, TO >::isReferenced | ( | const FROM * | from,
|  | const SmartRef< TO > & | to |
| ) |  |  | `[inline]`

Check if two entries are Referenced to each other.

Definition at line 279 of file RefTable.h.

    00279                                                                  {
    00280     const EntryType* e = i_reference(from);
    00281     if ( 0 != assoc )   {
    00282       SmartRefVector<TO>::const_iterator i = std::find(e->begin(), e->end(), to);
    00283       return (i == e->end()) ? false : true;
    00284     }
    00285     return false;
    00286   }

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r11/GaudiKernel/GaudiKernel/RefTable.h