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

Object base interface. More...

+ Inheritance diagram for CPNS::IObject:

Public Member Functions

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

Object base interface.

Each object whose lifetime is handled by the CHAI derives from this class. Its allowing to perform generic operations such as getting the detailed object type, assigning user data, being notified on destruction,...

Member Function Documentation

virtual CPNS::ICHAI* CPNS::IObject::GetCHAI ( )
pure virtual

Get a pointer to the CHAI hosting this object.

virtual CPNS::uint32 CPNS::IObject::GetHandle ( ) const
pure virtual

Get a unique handle to the object if this object is handled by the trashcan.

Returns
Returns a 32 bits value representing a unique identifier for the object, or 0 if the object is not handled by the trashcan
See Also
ICHAI::GetAcquiredObjectFromHandle, ICHAI::SetTrashcanUsageForMessageObjects
virtual CPNS::Enums::ObjectTypes CPNS::IObject::GetObjectType ( ) const
pure virtual

Get the object type.

Use this method to determine the object type related to the pointer.

Returns
Returns an OT_* value
virtual void* CPNS::IObject::GetUserDataPtr ( ) const
pure virtual

Get custom user ptr data.

Warning
user data is stored in a void pointer. In case of using this data to store a pointer to memory/object allocated in the application side, do not forget to free/delete the pointer before releasing/removing this object.
Returns
Returns a pointer containing data associated to the object
virtual CPNS::uint32 CPNS::IObject::GetUserDataUInt32 ( ) const
pure virtual

Get custom user uint32 data.

Returns
Returns User uint32 data
virtual void CPNS::IObject::RegisterObjectNotificationHandler ( CPNS::IObject_NotificationHandler *const  pHandler)
pure virtual

Register an Object's notification handler.

The Object's notification handler is used to signal application side that the object is ready to be destroyed. Can be used to clean User Data pointer.

Parameters
[in]pHandlerPointer to the application object implementing IObject_NotificationHandler. If pHandler is NULL, clear all registered handlers.
virtual void CPNS::IObject::SetUserDataPtr ( void const *const  pData)
pure virtual

Set a custom user ptr data.

Warning
user data is stored in a void pointer. In case of using this data to store a pointer to memory/object allocated in the application side, do not forget to free/delete the pointer before releasing/removing this object.
Parameters
[in]pDataUser data pointer
virtual void CPNS::IObject::SetUserDataUInt32 ( const CPNS::uint32  dwData)
pure virtual

Set a custom user uint32 data.

Parameters
[in]dwDataUser uint32 data
virtual void CPNS::IObject::UnregisterObjectNotificationHandler ( CPNS::IObject_NotificationHandler *const  pHandler)
pure virtual

Unregister an Object's notification handler.

Parameters
[in]pHandlerPointer to the application object implementing IObject_NotificationHandler. If pHandler is NULL, clear all registered handlers.