MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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 >:

Public Types

typedef void(ClassType::* ObserverMemberFunction )(const SubjectType &)
 
- Public Types inherited from MAKLogger::DtObserveConnectionComponent
typedef std::list
< DtObserveConnectionSP
ConnectionList
 

Public Member Functions

 DtObserverFunctor (ClassType &object, ObserverMemberFunction function)
 
virtual ~DtObserverFunctor ()
 
void observe (const SubjectType &subject)
 Abstract observe function called when a connected event fires. More...
 
- Public Member Functions inherited from MAKLogger::DtObserver< SubjectType >
virtual ~DtObserver ()
 DTOR which disconnects the observer from all events. More...
 
virtual void disconnect (DtObserveEvent< SubjectType > *event)
 Disconnect the observer from a specific event. More...
 
- Public Member Functions inherited from MAKLogger::DtObserveConnectionComponent
virtual ~DtObserveConnectionComponent ()
 
virtual void connect (DtObserveConnectionSP con)
 
virtual void disconnect (DtObserveConnectionSP con)
 
virtual void disconnect (DtObserveConnectionComponent *component)
 
virtual bool isConnected (DtObserveConnectionComponent *component)
 
void disconnectAll ()
 Must be non virtual since called by destructor. More...
 

Protected Member Functions

 DtObserverFunctor (const DtObserverFunctor &)
 CopyCTOR not implemented. More...
 
DtObserverFunctoroperator= (const DtObserverFunctor &)
 Assignment operator not implemented. More...
 
- Protected Member Functions inherited from MAKLogger::DtObserveConnectionComponent
 DtObserveConnectionComponent ()
 DtObserveConnection C. More...
 
 DtObserveConnectionComponent (const DtObserveConnectionComponent &)
 CopyCTOR not implemented. More...
 
DtObserveConnectionComponentoperator= (const DtObserveConnectionComponent &)
 Assignment operator not implemented. More...
 
DtObserveConnectionSP findEventObserverConnection (DtObserveConnectionComponent *event, DtObserveConnectionComponent *observer)
 

Protected Attributes

ClassType & myObject
 
ObserverMemberFunction myFunction
 
- Protected Attributes inherited from MAKLogger::DtObserveConnectionComponent
ConnectionList myConnections
 

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.

Member Typedef Documentation

template<typename ClassType, typename SubjectType>
typedef void(ClassType::* MAKLogger::DtObserverFunctor< ClassType, SubjectType >::ObserverMemberFunction)(const SubjectType &)

Constructor & Destructor Documentation

template<typename ClassType, typename SubjectType>
MAKLogger::DtObserverFunctor< ClassType, SubjectType >::DtObserverFunctor ( ClassType &  object,
ObserverMemberFunction  function 
)
inline
template<typename ClassType, typename SubjectType>
virtual MAKLogger::DtObserverFunctor< ClassType, SubjectType >::~DtObserverFunctor ( )
inlinevirtual
template<typename ClassType, typename SubjectType>
MAKLogger::DtObserverFunctor< ClassType, SubjectType >::DtObserverFunctor ( const DtObserverFunctor< ClassType, SubjectType > &  )
protected

CopyCTOR not implemented.

Member Function Documentation

template<typename ClassType, typename SubjectType>
void MAKLogger::DtObserverFunctor< ClassType, SubjectType >::observe ( const SubjectType &  )
inlinevirtual

Abstract observe function called when a connected event fires.

Implements MAKLogger::DtObserver< SubjectType >.

template<typename ClassType, typename SubjectType>
DtObserverFunctor& MAKLogger::DtObserverFunctor< ClassType, SubjectType >::operator= ( const DtObserverFunctor< ClassType, SubjectType > &  )
protected

Assignment operator not implemented.

Member Data Documentation

template<typename ClassType, typename SubjectType>
ObserverMemberFunction MAKLogger::DtObserverFunctor< ClassType, SubjectType >::myFunction
protected
template<typename ClassType, typename SubjectType>
ClassType& MAKLogger::DtObserverFunctor< ClassType, SubjectType >::myObject
protected

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

Document ID: Generated on Thu Jul 14 15:45:33 EDT 2022 from SVN revision 244827
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)