NamedRefI Class Reference
[DynI derived classes]

#include <DoBaseI.h>

Inheritance diagram for NamedRefI:

DynI VObj DoRunTimeC

List of all members.

Public Member Functions

Virtuals
Interface members

virtual DynObjType *docall doGetType (const DynI **pself=0) const
virtual DynI *docall GetByName (const char *name, int type_id)
virtual DynI *docall GetByIndex (int index, DynStr &ds, int type_id=0)
virtual bool docall Set (const char *name, DynI *pdi)
virtual bool docall Remove (DynI *pdi)
Inlines
Inline convenience functions

DynIGet (const char *name)


Detailed Description

This interface allows for retrieving named 'related objects' to an object. A Tree browser may have a "contents" related object ,...etc. The sibling object is usually an object with its own life span. If the object implementing NamedRefI also implements NotifiableI there is no need for the Remove function, since we get destructor notifications.

Member Function Documentation

virtual DynObjType* docall NamedRefI::doGetType ( const DynI **  pself = 0  )  const [virtual]

Returns type of this object. Each type that wants to make itself known should override this method. DynI knows its own type so we get the type without any lookup. It is faster and works without registration.

Parameters:
pself allows fetching the actual 'this' used inside doGetType (from a side base, this will be different to the 'this' of the caller).
Returns:
A DynObjType pointer

Reimplemented from DynI.

Reimplemented in DoRunTimeC.

virtual DynI* docall NamedRefI::GetByName ( const char *  name,
int  type_id 
) [inline, virtual]

Lookup a named object.

Parameters:
name is the name which the object is known by
type_id is the type of the object or 0 if don't care
Returns:
An interface pointer or NULL if not found

virtual DynI* docall NamedRefI::GetByIndex ( int  index,
DynStr ds,
int  type_id = 0 
) [inline, virtual]

Lookup a named object using index.

Parameters:
index lookup the n:th object of this type
ds store name of object here
type_id is the type of the object or 0 if don't care
Returns:
An interface pointer or NULL if not found

virtual bool docall NamedRefI::Set ( const char *  name,
DynI pdi 
) [inline, virtual]

Store a named object. An implementation is free to return false if the object is not accepted (i.e. it does not implement NotifierI)

Parameters:
name is the name by which the object can later be looked up
pdi the object to be known with this name
Returns:
true on success

virtual bool docall NamedRefI::Remove ( DynI pdi  )  [inline, virtual]

Manually remove a named object.

Parameters:
pdi the object to be removed
Returns:
true on success


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

Generated on Sun Feb 15 16:35:57 2009 for DynObj by  doxygen 1.5.6