CHAI SDK  Version 1.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CPNS::IHookedObject Class Referenceabstract

Hooked Object base interface. More...

+ Inheritance diagram for CPNS::IHookedObject:
+ Collaboration diagram for CPNS::IHookedObject:

Public Member Functions

virtual void Acquire ()=0
 Acquire an object. More...
 
virtual void Release ()=0
 Release an object. More...
 
virtual CPNS::uint32 GetHookCounter () const =0
 Get object's hook counter. More...
 
- Public Member Functions inherited from CPNS::IObject
virtual CPNS::ICHAIGetCHAI ()=0
 Get a pointer to the CHAI hosting this object. More...
 
virtual void RegisterObjectNotificationHandler (CPNS::IObject_NotificationHandler *const pHandler)=0
 Register an Object's notification handler. More...
 
virtual void UnregisterObjectNotificationHandler (CPNS::IObject_NotificationHandler *const pHandler)=0
 Unregister an Object's notification handler. More...
 
virtual CPNS::Enums::ObjectTypes GetObjectType () const =0
 Get the object type. More...
 
virtual CPNS::uint32 GetHandle () const =0
 Get a unique handle to the object if this object is handled by the trashcan. More...
 
virtual void SetUserDataPtr (void const *const pData)=0
 Set a custom user ptr data. More...
 
virtual void * GetUserDataPtr () const =0
 Get custom user ptr data. More...
 
virtual void SetUserDataUInt32 (const CPNS::uint32 dwData)=0
 Set a custom user uint32 data. More...
 
virtual CPNS::uint32 GetUserDataUInt32 () const =0
 Get custom user uint32 data. More...
 

Detailed Description

Hooked Object base interface.

This is used by objects that are not handled by the CHAI. Those objects are destroyed when their hook counter drop to 0. Objects that do not inherit from IHookedObjet are maintained by the CHAI, in this case the application must use some AddXXX or RemoveXXX methods to control their life time.

Member Function Documentation

virtual void CPNS::IHookedObject::Acquire ( )
pure virtual

Acquire an object.

Use this method to acquire an object, preventing the CHAI to destroy it.

virtual CPNS::uint32 CPNS::IHookedObject::GetHookCounter ( ) const
pure virtual

Get object's hook counter.

Returns
Returns a 32 bits value representing the number of acquire performed on the object.
virtual void CPNS::IHookedObject::Release ( )
pure virtual

Release an object.

Use this method to release an object, allowing the CHAI to destroy it if the hook counter reaches 0.