My Project
Public Types | Public Member Functions | Protected Attributes | List of all members
ParaEngine::IObject Class Reference

base class for object, such as CBaseObject, IAttributeObject, GUI object. More...

#include <PERef.h>

Inheritance diagram for ParaEngine::IObject:
ParaEngine::CRefCounted ParaEngine::CBaseRowColumn ParaEngine::CDataBool ParaEngine::CDataCellItem ParaEngine::CDataColumnInfo ParaEngine::CDataDouble ParaEngine::CDataFloat ParaEngine::CDataInt32 ParaEngine::CDataString ParaEngine::CEventBinding ParaEngine::CGUIEvent ParaEngine::CGUIHighlight ParaEngine::CGUIResource ParaEngine::CObjectFactory ParaEngine::CParaEngineAppBase ParaEngine::CParaEngineGLView ParaEngine::IAttributeFields

Public Types

typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 

Public Member Functions

virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
virtual const ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Protected Attributes

WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Detailed Description

base class for object, such as CBaseObject, IAttributeObject, GUI object.

this class support weak reference

Member Function Documentation

§ Clone() [1/2]

void ParaEngine::IObject::Clone ( IObject obj) const
virtual

Clone the object's contains to a pointer.

The caller should allocate the memory and pass the pointer to this function.. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior In some cases, if you want to avoid Dead Reference( one object is being referred to by many objects and you can't update all the references). It is possible to use this function to replace the contains at a given pointer. But this may result in memory leak if you do not implement this function carefully or misuse it.

Reimplemented in ParaEngine::CDataString, ParaEngine::CDataDouble, ParaEngine::CDataFloat, ParaEngine::CGUIResource, ParaEngine::CDataBool, ParaEngine::CGUIContainer, ParaEngine::CDataInt32, ParaEngine::CGUIEvent, ParaEngine::CDataRow, ParaEngine::CGUIEditBox, ParaEngine::CGUIListBox, ParaEngine::CGUIScrollBar, ParaEngine::CGUIWebBrowser, ParaEngine::CEventBinding, ParaEngine::CGUIText, ParaEngine::CGUINStageAnimation, ParaEngine::CDataCellItem, ParaEngine::CGUI4OutsideArrow, ParaEngine::CGUIButton, ParaEngine::CGUICanvas, ParaEngine::CBaseRowColumn, ParaEngine::CDataColumnInfo, and ParaEngine::CGUISlider.

§ Clone() [2/2]

IObject * ParaEngine::IObject::Clone ( ) const
virtual

§ Equals()

bool ParaEngine::IObject::Equals ( const IObject obj) const
virtual

Compare the object with another object.

Inheritance should implement this function

Reimplemented in ParaEngine::CGUIResource, ParaEngine::CGUIEvent, ParaEngine::CEventBinding, and ParaEngine::CBaseRowColumn.

§ GetWeakReference()

IObject::WeakPtr_type & IObject::GetWeakReference ( )

get weak reference object.

§ ProcessObjectEvent()

virtual int ParaEngine::IObject::ProcessObjectEvent ( const ObjectEvent event)
inlinevirtual

this function is only used to backward compatibility of ParaObject:AddEvent() function.

Reimplemented in ParaEngine::CBipedObject.


The documentation for this class was generated from the following files: