MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / IObjectPtr

Class IObjectPtr

source/script.h:1424–1443  ·  view source on GitHub ↗

This class encapsulates a pointer to an object which can be called by a timer, hotkey, etc. It provides common functionality that wouldn't be suitable for the base IObject interface, but is needed for detection of "Suspend" or "Critical" prior to calling the sub or function.

Source from the content-addressed store, hash-verified

1422// base IObject interface, but is needed for detection of "Suspend" or "Critical"
1423// prior to calling the sub or function.
1424class IObjectPtr
1425{
1426protected:
1427 IObject *mObject;
1428
1429public:
1430 IObjectPtr() : mObject(NULL) {}
1431 IObjectPtr(IObject *object) : mObject(object) {}
1432 ResultType ExecuteInNewThread(TCHAR *aNewThreadDesc
1433 , ExprTokenType *aParamValue = NULL, int aParamCount = 0, __int64 *aRetVal = NULL) const;
1434 const IObjectPtr* operator-> () { return this; } // Act like a pointer.
1435 operator void *() const { return mObject; } // For comparisons and boolean eval.
1436
1437 // Caller beware: does not check for NULL.
1438 Func *ToFunc() const;
1439 IObject *ToObject() const { return mObject; }
1440
1441 // Currently only used by ListLines, listing active timers.
1442 LPCTSTR Name() const;
1443};
1444
1445// IObjectPtr with automatic reference-counting, for storing an object safely,
1446// such as in a HotkeyVariant, UserMenuItem, etc. Its specific purpose is to

Callers 2

EvalMethod · 0.85
MsgSleepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected