| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

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

- Search for |

- Namespace List
- Namespace Members

# Objects Namespace Reference

## Detailed Description

Namespace for basic object handling within container classes.

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

## Function Documentation

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

Definition at line 66 of file KeyedObject.cpp.

References access(), ObjectContainerBase::containedObject(), ContainedObject::index(), and ContainedObject::parent().

    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 }

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

Definition at line 30 of file KeyedObject.cpp.

References IRegistry::dataSvc(), LinkManager::link(), DataObject::linkMgr(), LinkManager::Link::object(), LinkManager::Link::path(), DataObject::registry(), IDataProviderSvc::retrieveObject(), and LinkManager::Link::setObject().

    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 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.

Referenced by access(), and reference().

    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 | ) |

Definition at line 21 of file KeyedObject.cpp.

References access().

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