Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Public Member Functions | List of all members
hdi::core::__Callback< hdiTargetType > Class Template Reference

Class to describe a target object and a method of it, to be called at a later time. More...

#include <hdicoreCallback.h>

Inheritance diagram for hdi::core::__Callback< hdiTargetType >:
Inheritance graph
[legend]
Collaboration diagram for hdi::core::__Callback< hdiTargetType >:
Collaboration graph
[legend]

Public Member Functions

 __Callback (TargetType *target_, ActionType action_)
 __Callback constructor More...
 
 __Callback (TargetType *target_, ConstActionType action_)
 
 __Callback (const __Callback< TargetType > &cb_)
 __Callback copy constructor More...
 
virtual ~__Callback ()
 __Callback destructor; no-op at this time More...
 
virtual __Callback< TargetType > * clone () const
 Convenience method to clone a __Callback object. More...
 
virtual void execute () const
 Executes the callback. More...
 
- Public Member Functions inherited from hdi::core::Callback
virtual ~Callback ()
 Callback destructor, no-op at this time. More...
 

Additional Inherited Members

- Protected Member Functions inherited from hdi::core::Callback
 Callback ()
 Callback constructor, no-op at this time. More...
 

Detailed Description

template<class hdiTargetType>
class hdi::core::__Callback< hdiTargetType >

Class to describe a target object and a method of it, to be called at a later time.

C++ has no callbacks (in the sense of an action [method] of a target [object]), so we had to roll our own. You can use this class directly, but the HDI_CORE_CALLBACK macro is easier.

Constructor & Destructor Documentation

template<class hdiTargetType>
hdi::core::__Callback< hdiTargetType >::__Callback ( TargetType *  target_,
ActionType  action_ 
)
inlineexplicit

__Callback constructor

Constructs a __Callback object from a target (object) and action (method) for the target

Author
GW
Date
08/2013
Parameters
target_Object pointer, whose method (action_) will be called, once executed
action_Function/method pointer, which will be called on target_, once executed
Warning
The resulting __Callback object does not assume responsibility for the memory of target_
template<class hdiTargetType>
hdi::core::__Callback< hdiTargetType >::__Callback ( const __Callback< TargetType > &  cb_)
inline

__Callback copy constructor

Use to create a new __Callback object that points to the same target (object) and action (method) as the original

Author
GW
Date
08/2013
Parameters
cb_Existing __Callback object to be copied
template<class hdiTargetType>
virtual hdi::core::__Callback< hdiTargetType >::~__Callback ( )
inlinevirtual

__Callback destructor; no-op at this time

Author
GW
Date
08/2013

Member Function Documentation

template<class hdiTargetType>
virtual __Callback<TargetType>* hdi::core::__Callback< hdiTargetType >::clone ( ) const
inlinevirtual

Convenience method to clone a __Callback object.

Clones the __Callback object, such that a new duplicated object is created that points to the same target (object) and action (method)

Author
GW
Date
08/2013
Returns
Pointer to __Callback<TargetType>, a clone of the original
Warning
The caller assumes responsibility of the memory for the returned object

Implements hdi::core::Callback.

template<class hdiTargetType>
virtual void hdi::core::__Callback< hdiTargetType >::execute ( ) const
inlinevirtual

Executes the callback.

Calls the specified action (method) of the target (object)

Author
GW
Date
08/2013

Implements hdi::core::Callback.