| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# Objects Namespace Reference

Namespace for basic object handling within container classes. More...

## Functions
bool | access (const ContainedObject *from, ContainedObject **to)
bool | access (const DataObject *from, DataObject **to)
template<class TO, class FROM>
TO * | reference (FROM *from)

## Detailed Description

Namespace for basic object handling within container classes.

## Function Documentation

bool Objects::access | ( | const DataObject * | from,
|  | DataObject ** | to |
| ) |  |  |

Definition at line 30 of file KeyedObject.cpp.

    00031 {
    00032   DataObject* src  = const_cast<DataObject*>(from);
    00033   DataObject* tar = 0;
    00034   if ( src != 0 )
    00035   {
    00036     LinkManager* mgr = src->linkMgr();
    00037     if ( 0 != mgr )
    00038     {
    00039       LinkManager::Link* link = mgr->link(long(0));
    00040       if ( 0 != link )
    00041       {
    00042         tar = link->object();
    00043         if ( 0 == tar )
    00044         {
    00045           IRegistry* reg = src->registry();
    00046           if ( 0 != reg )
    00047           {
    00048             IDataProviderSvc* ds = reg->dataSvc();
    00049             if ( 0 != ds )
    00050             {
    00051               if ( ds->retrieveObject(link->path(), tar).isSuccess() )
    00052               {
    00053                 link->setObject(tar);
    00054               }
    00055             }
    00056           }
    00057         }
    00058       }
    00059     }
    00060   }
    00061   *to = tar;
    00062   return tar != 0;
    00063 }

bool Objects::access | ( | const ContainedObject * | from,
|  | ContainedObject ** | to |
| ) |  |  |

Definition at line 66 of file KeyedObject.cpp.

    00067 {
    00068   *to = 0;
    00069   if ( from )
    00070   {
    00071     DataObject *tar = 0;
    00072     if ( access(from->parent(), &tar) )
    00073     {
    00074       ObjectContainerBase* cnt = dynamic_cast<ObjectContainerBase*>(tar);
    00075       if ( cnt )
    00076       {
    00077         *to = cnt->containedObject(from->index());
    00078       }
    00079     }
    00080   }
    00081   return (*to) != 0;
    00082 }

template<class TO, class FROM>

TO* Objects::reference | ( | FROM * | from | ) | `[inline]`

Definition at line 21 of file KeyedObject.cpp.

    00021                                {
    00022     ContainedObject* to = 0;
    00023     if ( access(from, &to) )    {
    00024       return dynamic_cast<TO*>(to);
    00025     }
    00026     return 0;
    00027   }