VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtObserver Class Reference

Instances of DtObserver are used to manage interest in other objects by this object. More...

+ Collaboration diagram for DtObserver:

Public Member Functions

 DtObserver ()
 default constructor More...
 
virtual ~DtObserver ()
 destructor Deregisters this object from observing any other objects. More...
 
 DtObserver (const DtObserver &orig)
 copy constructor Copies what the original is observing to this object. More...
 
DtObserveroperator= (const DtObserver &orig)
 assignment operator Stops observing any objects which this object has seen. More...
 
virtual bool startObserving (DtObservee *toObserve)
 Start observing another object from this object. More...
 
virtual bool stopObserving (DtObservee *observed)
 Stop observing another object from this object. More...
 
virtual bool isBeingObserved (DtObservee *object)
 Determine if object is being observed. More...
 
virtual bool notifyFromYourObserved (const DtObservee *observed, const DtObservee::DtWhyNotifyObserver &why)
 Called by DtAbsNotifyObserver for notification from objects which this object is observing. More...
 

Protected Member Functions

virtual bool pendingDeleteOfYourObserved (const DtObservee *observed)
 Called by notifyFromYourObserved when an observed object is pending deletion. More...
 
virtual bool deleteOfYourObserved (const DtObservee *observed)
 Called by notifyFromYourObserved when an observed object is being deleted. More...
 
virtual bool removeObservedReference (const DtObservee *observed)
 Remove reference to observed object which is being deleted. More...
 
bool internalStartObserving (DtObservee *toObserve)
 Non-virtual members for calling from constructors/destructors. More...
 
bool internalStopObserving (DtObservee *observed)
 Stop observing another object from this object. More...
 

Protected Attributes

DtList myObjectsAmObserving
 List of DtObservee's which this object is observing. More...
 
DtObserverNotifier myNotifier
 Used to get notification from objects this object is observing. More...
 

Detailed Description

Instances of DtObserver are used to manage interest in other objects by this object.

This class works in conjunction with DtObservee, since without its cooperation, this observer cannot know when the watched object goes away.

Uses DtDECLARE_OBSERVER_NOTIFIER and DtDEFINE_OBSERVER_NOTIFIER to create a derived notifier class which knows how to communicate with this observer class which can observe DtObservee objects. A single instance of DtObserver can watch multiple instances of the DtObservee class.

Deprecated:

Constructor & Destructor Documentation

DtObserver::DtObserver ( )

default constructor

virtual DtObserver::~DtObserver ( )
virtual

destructor Deregisters this object from observing any other objects.

DtObserver::DtObserver ( const DtObserver orig)

copy constructor Copies what the original is observing to this object.

Does NOT copy what is observing the original to this object.

Member Function Documentation

virtual bool DtObserver::deleteOfYourObserved ( const DtObservee observed)
protectedvirtual

Called by notifyFromYourObserved when an observed object is being deleted.

Observers must not examine the observed object as it is almost entirely deconstructed. Observers do not need to deregister themselves, but they should no longer try to observe the deleted object or reference it, i.e. they should remove it from their list of items they are observing. Default calls removeObservedReference();

bool DtObserver::internalStartObserving ( DtObservee toObserve)
protected

Non-virtual members for calling from constructors/destructors.

Start observing another object from this object. Registers observation with the observed object. Returns false if already observing the object. Non-virtual, since meant to be used from constructors/destructors.

bool DtObserver::internalStopObserving ( DtObservee observed)
protected

Stop observing another object from this object.

Deregisters observation with the observed object. Returns false if not already observing the object. Non-virtual, since meant to be used from constructors/destructors.

virtual bool DtObserver::isBeingObserved ( DtObservee object)
virtual

Determine if object is being observed.

virtual bool DtObserver::notifyFromYourObserved ( const DtObservee observed,
const DtObservee::DtWhyNotifyObserver why 
)
virtual

Called by DtAbsNotifyObserver for notification from objects which this object is observing.

Returns false if the reason why was not handled.

DtObserver& DtObserver::operator= ( const DtObserver orig)

assignment operator Stops observing any objects which this object has seen.

Maintains what was observing this object. Copies what the original is observing to this object. Does NOT copy what is observing the original to this object.

virtual bool DtObserver::pendingDeleteOfYourObserved ( const DtObservee observed)
protectedvirtual

Called by notifyFromYourObserved when an observed object is pending deletion.

Observers may examine the observed object for any information one last time before the object is deleted. Observers do not need to deregister themselves, but they should no longer try to observe the deleted object or reference it, i.e. they should remove it from their list of items they are observing. Default calls removeObservedReference();

virtual bool DtObserver::removeObservedReference ( const DtObservee observed)
protectedvirtual

Remove reference to observed object which is being deleted.

Should only be called upon notification of one of the deletion statuses. Returns whether observed was found and removed.

virtual bool DtObserver::startObserving ( DtObservee toObserve)
virtual

Start observing another object from this object.

virtual bool DtObserver::stopObserving ( DtObservee observed)
virtual

Stop observing another object from this object.

Member Data Documentation

DtObserverNotifier DtObserver::myNotifier
protected

Used to get notification from objects this object is observing.

DtList DtObserver::myObjectsAmObserving
protected

List of DtObservee's which this object is observing.


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

Document ID: Generated on Tue Aug 10 00:12:31 EDT 2021 from SVN revision 232765
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)