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

children of data row is some addition data rows. More...

#include <DataTable.h>

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

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 ICollection< CDataRow > * GetChildRows ()
 
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 const CDataCellItemGetAt (int index) const
 get the IObject at a given position More...
 
virtual CDataCellItemGetAt (int index)
 
virtual void Delete ()
 delete the row,
 
virtual int Resize (int newsize)
 Resize the current row or column, if m_IsFixedSize==true, it will fail. More...
 
virtual void BeingEdit ()
 Begin the edit transaction. More...
 
virtual void CancelEdit ()
 
virtual int EndEdit ()
 validates all modified data and set m_bEditing =false More...
 
virtual int GetRowState ()
 
const CDataCellItemoperator[] (const string &szName) const
 
const CDataCellItemoperator[] (int index) const
 
CDataCellItemoperator[] (const string &szName)
 
CDataCellItemoperator[] (int index)
 
virtual CColumnCollectionColumnInfos ()
 
- Public Member Functions inherited from ParaEngine::CBaseRowColumn
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 Insert (IObject &obj, int index)
 insert an object at a given position,, will failed if m_bIsFixedSize==true 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 Attributes

Collection_Vector< CDataRowm_children
 
CColumnCollectionm_ColumnInfo
 
bool m_bEditing
 
int m_eRowState
 
- Protected Attributes inherited from ParaEngine::CBaseRowColumn
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
 

Additional Inherited Members

- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 
- Protected Member Functions inherited from ParaEngine::CBaseRowColumn
 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...
 

Detailed Description

children of data row is some addition data rows.

they do not attach to any table TODO: add undo support of the rows, so changes only take place when EndEdit() is executed

Member Function Documentation

§ BeingEdit()

virtual void ParaEngine::CDataRow::BeingEdit ( )
inlinevirtual

Begin the edit transaction.

Operation such as SetAt(), Delete, operator [] will not actually take place until EndEdit() is executed

§ Clone() [1/2]

IObject * CDataRow::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::CBaseRowColumn.

§ Clone() [2/2]

void CDataRow::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::CBaseRowColumn.

§ EndEdit()

int CDataRow::EndEdit ( )
virtual

validates all modified data and set m_bEditing =false

§ GetAt()

const CDataCellItem * CDataRow::GetAt ( int  index) const
virtual

get the IObject at a given position

Returns
: NULL if not exists.

Reimplemented from ParaEngine::CBaseRowColumn.

§ Resize()

int CDataRow::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 from ParaEngine::CBaseRowColumn.

§ SetAt()

int CDataRow::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 from ParaEngine::CBaseRowColumn.


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