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

Public Member Functions

 CKey ()
 
 CKey (const CKey &src)
 
 CKey (const C_FLOAT64 &executionTime, const bool &equality, const size_t &cascadingLevel)
 
const C_FLOAT64getExecutionTime () const
 
bool operator< (const CKey &rhs) const
 
 ~CKey ()
 

Private Attributes

size_t mCascadingLevel
 
bool mEquality
 
C_FLOAT64 mExecutionTime
 

Friends

std::ostream & operator<< (std::ostream &os, const CProcessQueue &o)
 
std::ostream & operator<< (std::ostream &os, const CKey &o)
 

Detailed Description

Definition at line 27 of file CProcessQueue.h.

Constructor & Destructor Documentation

CProcessQueue::CKey::CKey ( )

Default constructor

Definition at line 20 of file CProcessQueue.cpp.

20  :
21  mExecutionTime(0.0),
22  mCascadingLevel(0),
23  mEquality(false)
24 {}
C_FLOAT64 mExecutionTime
Definition: CProcessQueue.h:79
CProcessQueue::CKey::CKey ( const CKey src)

Copy constructor

Parameters
constCKey & src

Definition at line 26 of file CProcessQueue.cpp.

26  :
27  mExecutionTime(src.mExecutionTime),
28  mCascadingLevel(src.mCascadingLevel),
29  mEquality(src.mEquality)
30 {}
C_FLOAT64 mExecutionTime
Definition: CProcessQueue.h:79
CProcessQueue::CKey::CKey ( const C_FLOAT64 executionTime,
const bool &  equality,
const size_t &  cascadingLevel 
)

Specific constructor

Parameters
constC_FLOAT64 & executionTime
constbool & equality
constsize_t & cascadingLevel

Definition at line 32 of file CProcessQueue.cpp.

34  :
35  mExecutionTime(executionTime),
36  mCascadingLevel(cascadingLevel),
37  mEquality(equality)
38 {}
C_FLOAT64 mExecutionTime
Definition: CProcessQueue.h:79
CProcessQueue::CKey::~CKey ( )

Destructor

Definition at line 40 of file CProcessQueue.cpp.

41 {}

Member Function Documentation

const C_FLOAT64& CProcessQueue::CKey::getExecutionTime ( ) const
inline

Retrieve the execution time.

Returns
const C_FLOAT64 & executionTime

Definition at line 70 of file CProcessQueue.h.

References mExecutionTime.

70 {return mExecutionTime;}
C_FLOAT64 mExecutionTime
Definition: CProcessQueue.h:79
bool CProcessQueue::CKey::operator< ( const CKey rhs) const

A less than sort operator for sorting the entries in the queue

Parameters
constCKey & rhs
Returns
bool lessThan

Definition at line 43 of file CProcessQueue.cpp.

References mCascadingLevel, CProcessQueue::mCascadingLevel, mEquality, CProcessQueue::mEquality, and mExecutionTime.

44 {
45  if (mExecutionTime != rhs.mExecutionTime)
46  return mExecutionTime < rhs.mExecutionTime;
47 
48  if (mCascadingLevel != rhs.mCascadingLevel)
49  return mCascadingLevel > rhs.mCascadingLevel;
50 
51  return mEquality > rhs.mEquality;
52 }
C_FLOAT64 mExecutionTime
Definition: CProcessQueue.h:79

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CProcessQueue o 
)
friend

Definition at line 505 of file CProcessQueue.cpp.

506 {
507  os << "Process Queue" << std::endl;
508  std::multimap< CProcessQueue::CKey, CProcessQueue::CAction >::const_iterator it;
509 
510  if (o.mActions.size()) os << " Actions:" << std::endl;
511 
512  for (it = o.mActions.begin(); it != o.mActions.end(); ++it)
513  {
514  os << "exec time " << it->first.mExecutionTime
515  << ", cascading lvl " << it->first.mCascadingLevel
516  << ", " << (it->first.mEquality ? "equality, " : "inequality");
517 
518  os << std::endl;
519 
520  CMathEvent * pEvent = it->second.mpEvent;
521 
522  os << "pEvent: 0x" << pEvent << ", Action: ";
523 
524  switch (it->second.mType)
525  {
527 
528  if (pEvent->delayAssignment())
529  {
530  os << "Calculation";
531  }
532  else
533  {
534  os << "Calculation & Assignment";
535  }
536 
537  break;
538 
540  os << "Assignment";
541  break;
542 
544  os << "Callback";
545  break;
546  }
547 
548  os << std::endl << std::endl;
549  }
550 
551  return os;
552 }
std::multimap< CKey, CAction > mActions
std::ostream& operator<< ( std::ostream &  os,
const CKey o 
)
friend

Member Data Documentation

size_t CProcessQueue::CKey::mCascadingLevel
private

Cascading level

Definition at line 84 of file CProcessQueue.h.

Referenced by operator<().

bool CProcessQueue::CKey::mEquality
private

A Boolean value indication whether we have equality or inequality. Equalities have to be handled prior to inequalities

Definition at line 90 of file CProcessQueue.h.

Referenced by operator<().

C_FLOAT64 CProcessQueue::CKey::mExecutionTime
private

The time the entry is scheduled to be executed.

Definition at line 79 of file CProcessQueue.h.

Referenced by getExecutionTime(), and operator<().


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