COPASI API  4.16.103
Public Member Functions | Private Member Functions | Friends | List of all members
CQBrowserPaneDM::CNode Class Reference

#include <CQBrowserPaneDM.h>

Inheritance diagram for CQBrowserPaneDM::CNode:
Inheritance graph
[legend]
Collaboration diagram for CQBrowserPaneDM::CNode:
Collaboration graph
[legend]

Public Member Functions

 CNode (const size_t &id, const std::string &key, const QString &displayRole, CNode *pParent)
 
const QString & getDisplayRole () const
 
const size_t & getId () const
 
const std::string & getKey () const
 
int getRow () const
 
QString getSortRole () const
 
void setDisplayRole (const QString &displayRole)
 
void setKey (const std::string &key)
 
 ~CNode ()
 
- Public Member Functions inherited from CCopasiNode< SData >
virtual bool addChild (CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
 
bool addSibling (CCopasiNode< Data > *pSibling, CCopasiNode< Data > *pAfter=NULL)
 
 CCopasiNode (CCopasiNode< Data > *pParent=NULL)
 
 CCopasiNode (const CCopasiNode< Data > &src)
 
 CCopasiNode (const Data &data, CCopasiNode< Data > *pParent=NULL)
 
bool deleteChildren ()
 
CCopasiNode< Data > * getChild ()
 
const CCopasiNode< Data > * getChild () const
 
CCopasiNode< Data > * getChild (const size_t &index)
 
const CCopasiNode< Data > * getChild (const size_t &index) const
 
virtual const DatagetData () const
 
CCopasiNode< Data > * getNext ()
 
const CCopasiNode< Data > * getNext () const
 
CCopasiNode< Data > * getNextNonChild ()
 
const CCopasiNode< Data > * getNextNonChild () const
 
size_t getNumChildren () const
 
CCopasiNode< Data > * getParent ()
 
const CCopasiNode< Data > * getParent () const
 
CCopasiNode< Data > * getSibling ()
 
const CCopasiNode< Data > * getSibling () const
 
virtual bool removeChild (CCopasiNode< Data > *pChild)
 
virtual bool setData (const Data &data)
 
virtual ~CCopasiNode ()
 

Private Member Functions

 CNode ()
 

Friends

std::ostream & operator<< (std::ostream &os, const CNode &d)
 

Additional Inherited Members

- Public Types inherited from CCopasiNode< SData >
typedef SData Data
 
- Protected Member Functions inherited from CCopasiNode< SData >
bool setChild (CCopasiNode< Data > *pChild)
 
bool setParent (CCopasiNode< Data > *pParent)
 
bool setSibling (CCopasiNode< Data > *pSibling)
 
- Protected Attributes inherited from CCopasiNode< SData >
Data mData
 

Detailed Description

Definition at line 41 of file CQBrowserPaneDM.h.

Constructor & Destructor Documentation

CQBrowserPaneDM::CNode::CNode ( )
private

Definition at line 735 of file CQBrowserPaneDM.cpp.

CQBrowserPaneDM::CNode::CNode ( const size_t &  id,
const std::string &  key,
const QString &  displayRole,
CNode pParent 
)

Definition at line 739 of file CQBrowserPaneDM.cpp.

References CCopasiNode< _Data >::addChild(), and CCopasiNode< SData >::mData.

742  :
744 {
745  mData.mId = id;
746  mData.mKey = key;
747  mData.mDisplayRole = displayRole;
748 
749  if (pParent != NULL)
750  {
751  pParent->addChild(this);
752  }
753 }
CQBrowserPaneDM::CNode::~CNode ( )

Definition at line 755 of file CQBrowserPaneDM.cpp.

756 {}

Member Function Documentation

const QString & CQBrowserPaneDM::CNode::getDisplayRole ( ) const

Definition at line 768 of file CQBrowserPaneDM.cpp.

Referenced by CQBrowserPaneDM::data(), CQBrowserPaneDM::load(), and CQBrowserPaneDM::rename().

769 {
770  return mData.mDisplayRole;
771 }
const size_t & CQBrowserPaneDM::CNode::getId ( ) const

Definition at line 758 of file CQBrowserPaneDM.cpp.

Referenced by CQBrowserPaneDM::data(), and CQBrowserPaneDM::getIdFromIndex().

759 {
760  return mData.mId;
761 }
const std::string & CQBrowserPaneDM::CNode::getKey ( ) const

Definition at line 788 of file CQBrowserPaneDM.cpp.

Referenced by CQBrowserPaneDM::getKeyFromIndex().

789 {
790  return mData.mKey;
791 }
int CQBrowserPaneDM::CNode::getRow ( ) const

Definition at line 793 of file CQBrowserPaneDM.cpp.

References CCopasiNode< _Data >::getChild(), and CCopasiNode< _Data >::getSibling().

Referenced by CQBrowserPaneDM::index(), CQBrowserPaneDM::parent(), and CQBrowserPaneDM::remove().

794 {
795  int count = 0;
796 
798 
799  if (pParent == NULL)
800  {
801  return 0;
802  }
803 
804  const CCopasiNode< CQBrowserPaneDM::SData > * pChild = pParent->getChild();
805 
806  while (pChild != NULL && pChild != this)
807  {
808  count++;
809  pChild = pChild->getSibling();
810  }
811 
812  return (pChild != NULL) ? count : -1;
813 }
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
CCopasiNode< Data > * getParent()
Definition: CCopasiNode.h:139
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
QString CQBrowserPaneDM::CNode::getSortRole ( ) const

Definition at line 773 of file CQBrowserPaneDM.cpp.

References C_INVALID_INDEX.

Referenced by CQBrowserPaneDM::data().

774 {
775  if (mData.mId == C_INVALID_INDEX)
776  {
777  return mData.mDisplayRole;
778  }
779 
780  return QString::number(mData.mId);
781 }
#define C_INVALID_INDEX
Definition: copasi.h:222
void CQBrowserPaneDM::CNode::setDisplayRole ( const QString &  displayRole)

Definition at line 763 of file CQBrowserPaneDM.cpp.

Referenced by CQBrowserPaneDM::load(), and CQBrowserPaneDM::rename().

764 {
765  mData.mDisplayRole = displayRole;
766 }
void CQBrowserPaneDM::CNode::setKey ( const std::string &  key)

Definition at line 783 of file CQBrowserPaneDM.cpp.

Referenced by CQBrowserPaneDM::load().

784 {
785  mData.mKey = key;
786 }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CNode d 
)
friend

Definition at line 815 of file CQBrowserPaneDM.cpp.

816 {
817  os << "CQBrowserPaneDM::CNode:" << std::endl;
818  //os << " mChemicalEquation: " << d.getChemicalEquation() << std::endl;
819  //os << " mChemicalEquationConverted: " << d.getChemicalEquationConverted() << std::endl;
820 
821  os << " mId: " << n.mData.mId << std::endl;
822  os << " mKey: " << n.mData.mKey << std::endl;
823  os << " mDisplayRole: " << TO_UTF8(n.mData.mDisplayRole) << std::endl;
824  return os;
825 }
#define TO_UTF8(__x)
Definition: qtUtilities.h:74

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