| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

Functions

# 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 ContainedObject * | from,
|  | ContainedObject ** | to
| ) |  |

Definition at line 66 of file KeyedObject.cpp.

    {
      *to = 0;
      if ( from )
      {
        DataObject *tar = 0;
        if ( access(from->parent(), &tar) )
        {
          ObjectContainerBase* cnt = dynamic_cast<ObjectContainerBase*>(tar);
          if ( cnt )
          {
            *to = cnt->containedObject(from->index());
          }
        }
      }
      return (*to) != 0;
    }

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

Definition at line 30 of file KeyedObject.cpp.

    {
      DataObject* src  = const_cast<DataObject*>(from);
      DataObject* tar = 0;
      if ( src != 0 )
      {
        LinkManager* mgr = src->linkMgr();
        if ( 0 != mgr )
        {
          LinkManager::Link* link = mgr->link(long(0));
          if ( 0 != link )
          {
            tar = link->object();
            if ( 0 == tar )
            {
              IRegistry* reg = src->registry();
              if ( 0 != reg )
              {
                IDataProviderSvc* ds = reg->dataSvc();
                if ( 0 != ds )
                {
                  if ( ds->retrieveObject(link->path(), tar).isSuccess() )
                  {
                    link->setObject(tar);
                  }
                }
              }
            }
          }
        }
      }
      *to = tar;
      return tar != 0;
    }

template<class TO , class FROM >

TO* Objects::reference | ( | FROM * | from ) |

Definition at line 21 of file KeyedObject.cpp.

                                   {
        ContainedObject* to = 0;
        if ( access(from, &to) )    {
          return dynamic_cast<TO*>(to);
        }
        return 0;
      }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines