You.i Engine
CYIDataModelIndex Class Reference

Detailed Description

This class is used to locate data in a CYIAbstractDataModel.

Indicies can be obtained through a variety of functions on CYIAbstractDataModel.

Each index refers to an item in a model. It has an associated row and column. It may have a parent, which provides a context for its row and column information.

An invalid index represents the root-level item of a CYIAbstractDataModel.

Warning
Indicies are not persisient. They should not be stored, but rather queried each time they are needed and used immediately.
See also
CYIAbstractDataModel

#include <datamodel/YiDataModelIndex.h>

Public Member Functions

virtual ~CYIDataModelIndex ()
 
CYIDataModelIndex GetChild (int32_t nRow, int32_t nColumn) const
 
CYIDataModelIndex GetParent () const
 
int32_t GetColumn () const
 
int32_t GetRow () const
 
CYIAbstractDataModelGetModel () const
 
bool IsValid () const
 
virtual CYIDataModelIndexoperator= (const CYIDataModelIndex &other)
 
virtual bool operator!= (const CYIDataModelIndex &other) const
 
virtual bool operator== (const CYIDataModelIndex &other) const
 

Protected Member Functions

void SetRow (int32_t nRow)
 
void SetColumn (int32_t nColumn)
 
void SetDataModel (CYIAbstractDataModel *pModel)
 
void SetDataItem (CYIDataModelItem *pItem)
 

Friends

class CYIAbstractDataModel
 
class CYIAbstractDataModelPriv
 

Constructor & Destructor Documentation

virtual CYIDataModelIndex::~CYIDataModelIndex ( )
virtual

Member Function Documentation

CYIDataModelIndex CYIDataModelIndex::GetChild ( int32_t  nRow,
int32_t  nColumn 
) const

Returns an index associated with the child item at coordinates specified by nRow and nColumn.

int32_t CYIDataModelIndex::GetColumn ( ) const

Returns the column of the data model item this index is associated with.

-1 will be returned if this index is invalid.

See also
IsValid
CYIAbstractDataModel* CYIDataModelIndex::GetModel ( ) const

Returns the data model that this index is associated with.

This function will return nullptr if this index is invalid.

See also
IsValid
CYIDataModelIndex CYIDataModelIndex::GetParent ( ) const

Returns an index associated with the parent item.

int32_t CYIDataModelIndex::GetRow ( ) const

Returns the row of the data model item this index is associated with.

-1 will be returned if this index is invalid.

See also
IsValid
bool CYIDataModelIndex::IsValid ( ) const

Returns true if the row and column are both greater than 0, and if the associated data model is valid.

virtual bool CYIDataModelIndex::operator!= ( const CYIDataModelIndex other) const
virtual
virtual CYIDataModelIndex& CYIDataModelIndex::operator= ( const CYIDataModelIndex other)
virtual
virtual bool CYIDataModelIndex::operator== ( const CYIDataModelIndex other) const
virtual
void CYIDataModelIndex::SetColumn ( int32_t  nColumn)
protected
void CYIDataModelIndex::SetDataItem ( CYIDataModelItem *  pItem)
protected
void CYIDataModelIndex::SetDataModel ( CYIAbstractDataModel pModel)
protected
void CYIDataModelIndex::SetRow ( int32_t  nRow)
protected

Friends And Related Function Documentation

friend class CYIAbstractDataModel
friend
friend class CYIAbstractDataModelPriv
friend

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