A PtMethodRef is used to specify callback functions. Please see the chapter "Event Handling" for a complete set of the methods which use a PtMethodRefs.
Three different kinds of functions may be placed in a PtMethodRef:
Use the PtFuncCallback data type when creating your method references for setting watches. POET uses the other two function types internally for progress monitoring callbacks.
Files to include | Class declaration | Base class |
poet.hxx | ptcllbck.hxx | none |
constructor | PtMethodRef(); |
Call | int Call(); |
Set | void Set(PtCallback* , PtFunc); |
Valid | int Valid(); |
- PtMethodRef::PtMethodRef() PtMethodRef::PtMethodRef(PtCallback* , PtFunc) PtMethodRef::PtMethodRef(PtCallback* , PtFuncCallback) PtMethodRef::PtMethodRef(PtCallback* , PtFuncInt)
Constructors. The first form does not install a function. The last three forms each install a function of the given type and the address of an object which contains this function:
- int PtMethodRef::Call() int PtMethodRef::Call(int) int PtMethodRef::Call(PtObjectNote*)
Calls the function stored in the PtMethodRef, passing the parameters to this function. You will not normally call this function yourself - POET calls it when a callback function is triggered.
The second form of the function looks to see if a function with an integer parameter has been installed. If not, it calls the void function. The last form of the function calls the Notify() method of the callback object if no function is stored in the PtMethodRef.
Returns the return value from the function.
- void PtMethodRef::Set(PtCallback* , PtFunc) void PtMethodRef::Set(PtCallback* , PtFuncInt) void PtMethodRef::Set(PtCallback* , PtFuncCallback)
Installs a function of the given type:
- int PtMethodRef::Valid()
Returns a non-zero value if the PtMethodRef has an object pointer stored in it. This generally means that the PtMethodRef is valid.
Copyright (c) 1996 POET Software, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without the express permission of POET Software, Inc. is prohibited.