Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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
 
 __Callback (TargetType *target_, ConstActionType action_)
 
 __Callback (const __Callback< TargetType > &cb_)
 __Callback copy constructor
 
virtual ~__Callback ()
 __Callback destructor; no-op at this time
 
virtual __Callback< TargetType > * clone () const
 Convenience method to clone a __Callback object.
 
virtual void execute () const
 Executes the callback.
 
- Public Member Functions inherited from hdi::core::Callback
virtual void execute () const =0
 Pure virtual callback execution method, so __Callback objects can be stored as Callback*.
 
virtual Callbackclone () const =0
 Pure virtual callback cloning method, so __Callback objects can be stored as Callback*.
 
virtual ~Callback ()
 Callback destructor, no-op at this time.
 

Additional Inherited Members

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

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

◆ __Callback() [1/2]

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_

◆ __Callback() [2/2]

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

◆ ~__Callback()

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

◆ clone()

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.

◆ execute()

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.