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

Although this class inherits the CRefCounted interface, I don't manage it in GC. More...

#include <BaseTable.h>

Inheritance diagram for ParaEngine::CBaseRowColumn:
ParaEngine::IObject ParaEngine::CRefCounted ParaEngine::CDataRow

Public Member Functions

virtual IObjectClone () const
 Clone never clones the m_nIndex, m_parent, m_bIsFixedSize new object is: m_nIndex=-1;m_parent=NULL;m_bIsFixedSize=false. More...
 
virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual void Clear ()
 
virtual bool Equals (const IObject *obj) const
 Size and corresponding members of the two objects must equal to return true; It uses the Equals() member function of the object to compare.
 
bool Update ()
 
virtual int Add (IObject &obj)
 Add an object to the row or column, will failed if m_bIsFixedSize==true Only the. More...
 
virtual int SetAt (IObject &obj, int index)
 Set the object at a given position in a row or column This will change the corresponding records in the CBaseTable. More...
 
virtual int Insert (IObject &obj, int index)
 insert an object at a given position,, will failed if m_bIsFixedSize==true More...
 
virtual const IObjectGetAt (int index) const
 get the IObject at a given position More...
 
virtual IObjectGetAt (int index)
 
virtual int Resize (int newsize)
 Resize the current row or column, if m_IsFixedSize==true, it will fail. More...
 
virtual int Size () const
 
virtual bool IsValid () const
 Check if the data in the row or column is valid if not valid, the row or column's Update() must be called to make it valid.
 
virtual int Remove (int index)
 Remove an object, if m_IsFixedSize==true, it will fail. More...
 
- Public Member Functions inherited from ParaEngine::IObject
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 Member Functions

 CBaseRowColumn (int index, int etype)
 
 CBaseRowColumn (int index, int etype, bool fixedsize)
 
 CBaseRowColumn (int index, bool fixedsize)
 
virtual int InternalSetAt (IObject &obj, int index)
 Internal function. More...
 

Protected Attributes

bool m_bIsFixedSize
 
int m_nIndex
 
CBaseTablem_parent
 
Collection_Vector< IObjectm_data
 
int m_etype
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Friends

class CBaseTable
 
class CDataRow
 

Additional Inherited Members

- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 

Detailed Description

Although this class inherits the CRefCounted interface, I don't manage it in GC.

Member Function Documentation

§ Add()

int CBaseRowColumn::Add ( IObject obj)
virtual

Add an object to the row or column, will failed if m_bIsFixedSize==true Only the.

Add an object to the row or column, will failed if m_bIsFixedSize==true.

Returns
: new size of the row or column, -1 if failed

§ Clone() [1/2]

IObject * CBaseRowColumn::Clone ( ) const
virtual

Clone never clones the m_nIndex, m_parent, m_bIsFixedSize new object is: m_nIndex=-1;m_parent=NULL;m_bIsFixedSize=false.

Clone never clones the m_nIndex, m_parent, m_bIsFixedSize and m_bIsValid new object is: m_nIndex=-1;m_parent=NULL;m_bIsFixedSize=false;m_bIsValid=false;.

Reimplemented from ParaEngine::IObject.

Reimplemented in ParaEngine::CDataRow.

§ Clone() [2/2]

void CBaseRowColumn::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 from ParaEngine::IObject.

Reimplemented in ParaEngine::CDataRow.

§ GetAt()

const IObject * CBaseRowColumn::GetAt ( int  index) const
virtual

get the IObject at a given position

Returns
: NULL if not exists.

Reimplemented in ParaEngine::CDataRow.

§ Insert()

int CBaseRowColumn::Insert ( IObject obj,
int  index 
)
virtual

insert an object at a given position,, will failed if m_bIsFixedSize==true

Returns
: the index of the inserted object. -1 if failed.

§ InternalSetAt()

int CBaseRowColumn::InternalSetAt ( IObject obj,
int  index 
)
protectedvirtual

Internal function.

Only set the object itself

§ Remove()

int CBaseRowColumn::Remove ( int  index)
virtual

Remove an object, if m_IsFixedSize==true, it will fail.

Returns
: new size of the row or column, -1 if failed

§ Resize()

int CBaseRowColumn::Resize ( int  newsize)
virtual

Resize the current row or column, if m_IsFixedSize==true, it will fail.

Returns
: new size if successes, -1 if failed

Reimplemented in ParaEngine::CDataRow.

§ SetAt()

int CBaseRowColumn::SetAt ( IObject obj,
int  index 
)
virtual

Set the object at a given position in a row or column This will change the corresponding records in the CBaseTable.

Returns
: the index of the inserted object. -1 if failed.

Reimplemented in ParaEngine::CDataRow.


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