Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
MAKLogger::DtObserverFunctor< ClassType, SubjectType > Class Template Reference

ObserverFunctor is an observer implemented via Functor object which will call an object's member function. More...

+ Inheritance diagram for MAKLogger::DtObserverFunctor< ClassType, SubjectType >:
+ Collaboration diagram for MAKLogger::DtObserverFunctor< ClassType, SubjectType >:

List of all members.

Public Types

typedef void(ClassType::* ObserverMemberFunction )(const SubjectType &)

Public Member Functions

 DtObserverFunctor (ClassType &object, ObserverMemberFunction function)
void observe (const SubjectType &subject)
 Abstract observe function called when a connected event fires.

Protected Member Functions

 DtObserverFunctor (const DtObserverFunctor &)
 CopyCTOR not implemented.
DtObserverFunctoroperator= (const DtObserverFunctor &)
 Assignment operator not implemented.

Protected Attributes

ClassType & myObject
ObserverMemberFunction myFunction

Detailed Description

template<typename ClassType, typename SubjectType>
class MAKLogger::DtObserverFunctor< ClassType, SubjectType >

ObserverFunctor is an observer implemented via Functor object which will call an object's member function.

The ObserverFunctor should be used with Value semantics (ie a value member of the calling object) however they are not copyable and this is since if the owner object is copied the copy's functor will need to be reassigned.

Warning:
If the calling object life time is less than the Functor object calls will result in seg-faults. Solution is to have the calling object be the owner of the Functor which should ensure this condition.

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

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)