COPASI API  4.16.103
Public Member Functions | Private Attributes | Friends | List of all members
CZeroSet::CIndex Class Reference

#include <CZeroSet.h>

Public Member Functions

 CIndex (const size_t &index=0)
 
 CIndex (const CIndex &src)
 
CIndexoperator++ ()
 
bool operator< (const CIndex &rhs) const
 
CIndexoperator= (const CIndex &rhs)
 
CIndexoperator= (const size_t &index)
 
 ~CIndex ()
 

Private Attributes

size_t mBit
 
size_t mIndex
 
size_t mNotBit
 

Friends

class CZeroSet
 

Detailed Description

Definition at line 33 of file CZeroSet.h.

Constructor & Destructor Documentation

CZeroSet::CIndex::CIndex ( const size_t &  index = 0)

Definition at line 24 of file CZeroSet.cpp.

24  :
25  mIndex(index / (CHAR_BIT * sizeof(size_t))),
26  mBit(1 << (index % (CHAR_BIT * sizeof(size_t)))),
28 {}
size_t mIndex
Definition: CZeroSet.h:55
#define C_INVALID_INDEX
Definition: copasi.h:222
size_t mNotBit
Definition: CZeroSet.h:57
CZeroSet::CIndex::CIndex ( const CIndex src)

Definition at line 30 of file CZeroSet.cpp.

30  :
31  mIndex(src.mIndex),
32  mBit(src.mBit),
33  mNotBit(src.mNotBit)
34 {}
size_t mIndex
Definition: CZeroSet.h:55
size_t mNotBit
Definition: CZeroSet.h:57
CZeroSet::CIndex::~CIndex ( )

Definition at line 36 of file CZeroSet.cpp.

37 {}

Member Function Documentation

CZeroSet::CIndex & CZeroSet::CIndex::operator++ ( )

Definition at line 39 of file CZeroSet.cpp.

References C_INVALID_INDEX.

40 {
41  mBit <<= 1;
43 
44  if (mBit == 0)
45  {
46  mIndex++;
47  mBit = 1;
49  }
50 
51  return *this;
52 }
size_t mIndex
Definition: CZeroSet.h:55
#define C_INVALID_INDEX
Definition: copasi.h:222
size_t mNotBit
Definition: CZeroSet.h:57
bool CZeroSet::CIndex::operator< ( const CIndex rhs) const

Definition at line 72 of file CZeroSet.cpp.

References mBit, and mIndex.

73 {
74  if (mIndex == rhs.mIndex)
75  return mBit < rhs.mBit;
76 
77  return mIndex < rhs.mIndex;
78 }
size_t mIndex
Definition: CZeroSet.h:55
CZeroSet::CIndex & CZeroSet::CIndex::operator= ( const CIndex rhs)

Definition at line 54 of file CZeroSet.cpp.

References mBit, mIndex, and mNotBit.

55 {
56  mIndex = rhs.mIndex;
57  mBit = rhs.mBit;
58  mNotBit = rhs.mNotBit;
59 
60  return *this;
61 }
size_t mIndex
Definition: CZeroSet.h:55
size_t mNotBit
Definition: CZeroSet.h:57
CZeroSet::CIndex & CZeroSet::CIndex::operator= ( const size_t &  index)

Definition at line 63 of file CZeroSet.cpp.

References C_INVALID_INDEX.

64 {
65  mIndex = index / (CHAR_BIT * sizeof(size_t));
66  mBit = ((size_t) 1) << (index % (CHAR_BIT * sizeof(size_t)));
68 
69  return *this;
70 }
size_t mIndex
Definition: CZeroSet.h:55
#define C_INVALID_INDEX
Definition: copasi.h:222
size_t mNotBit
Definition: CZeroSet.h:57

Friends And Related Function Documentation

friend class CZeroSet
friend

Definition at line 35 of file CZeroSet.h.

Member Data Documentation

size_t CZeroSet::CIndex::mBit
private

Definition at line 56 of file CZeroSet.h.

Referenced by CZeroSet::isSet(), operator<(), operator=(), and CZeroSet::setBit().

size_t CZeroSet::CIndex::mIndex
private
size_t CZeroSet::CIndex::mNotBit
private

Definition at line 57 of file CZeroSet.h.

Referenced by operator=(), and CZeroSet::unsetBit().


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