COPASI API  4.16.103
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Friends | List of all members
CProcessQueue::CAction Class Reference
Collaboration diagram for CProcessQueue::CAction:
Collaboration graph
[legend]

Public Types

enum  Type { Calculation = 0, Assignment, Callback }
 

Public Member Functions

 CAction (const CAction &src)
 
 CAction (CMathEvent *pEvent, CProcessQueue *pProcessQueue)
 
 CAction (const CVector< C_FLOAT64 > &values, CMathEvent *pEvent, CProcessQueue *pProcessQueue)
 
CMathEventgetEvent () const
 
const TypegetType () const
 
bool process ()
 
 ~CAction ()
 

Public Attributes

CMathEventmpEvent
 
CProcessQueuempProcessQueue
 
Type mType
 
CVector< C_FLOAT64mValues
 

Private Member Functions

 CAction ()
 

Friends

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

Detailed Description

Definition at line 95 of file CProcessQueue.h.

Member Enumeration Documentation

Enumerator
Calculation 
Assignment 
Callback 

Definition at line 98 of file CProcessQueue.h.

Constructor & Destructor Documentation

CProcessQueue::CAction::CAction ( )
private

Default constructor (hidden)

Definition at line 56 of file CProcessQueue.cpp.

56  :
57  mType(),
58  mValues(),
59  mpEvent(NULL),
60  mpProcessQueue(NULL)
61 {}
CProcessQueue * mpProcessQueue
CVector< C_FLOAT64 > mValues
CProcessQueue::CAction::CAction ( const CAction src)

Copy constructor

Parameters
constCAction & src

Definition at line 63 of file CProcessQueue.cpp.

63  :
64  mType(src.mType),
65  mValues(src.mValues),
66  mpEvent(src.mpEvent),
67  mpProcessQueue(src.mpProcessQueue)
68 {}
CProcessQueue * mpProcessQueue
CVector< C_FLOAT64 > mValues
CProcessQueue::CAction::CAction ( CMathEvent pEvent,
CProcessQueue pProcessQueue 
)

Specific constructor

Parameters
CMathEvent* pEvent
CProcessQueue* pProcessQueue

Definition at line 70 of file CProcessQueue.cpp.

71  :
73  mValues(),
74  mpEvent(pEvent),
75  mpProcessQueue(pProcessQueue)
76 {}
CProcessQueue * mpProcessQueue
CVector< C_FLOAT64 > mValues
CProcessQueue::CAction::CAction ( const CVector< C_FLOAT64 > &  values,
CMathEvent pEvent,
CProcessQueue pProcessQueue 
)

Specific constructor

Parameters
constCVector< C_FLOAT64 > & values
CMathEvent* pEvent
CProcessQueue* pProcessQueue

Definition at line 78 of file CProcessQueue.cpp.

References Assignment, CEvent::Assignment, Callback, CEvent::CutPlane, CMathEvent::getType(), and mType.

80  :
81  mType(),
82  mValues(values),
83  mpEvent(pEvent),
84  mpProcessQueue(pProcessQueue)
85 {
86  switch (pEvent->getType())
87  {
88  case CEvent::Assignment:
89  mType = Assignment;
90  break;
91 
92  case CEvent::CutPlane:
93  mType = Callback;
94  break;
95  }
96 }
const CEvent::Type & getType() const
CProcessQueue * mpProcessQueue
CVector< C_FLOAT64 > mValues
CProcessQueue::CAction::~CAction ( )

Destructor (hidden)

Definition at line 98 of file CProcessQueue.cpp.

99 {}

Member Function Documentation

CMathEvent* CProcessQueue::CAction::getEvent ( ) const
inline

Retrieve the event id

Returns
CMathEvent * pEvent

Definition at line 152 of file CProcessQueue.h.

References mpEvent.

152 {return mpEvent;}
const CProcessQueue::CAction::Type & CProcessQueue::CAction::getType ( ) const

Retrieve the type of action

Returns
const Type & type

Definition at line 141 of file CProcessQueue.cpp.

142 {
143  return mType;
144 }
bool CProcessQueue::CAction::process ( )

Process the action

Returns
bool stateChanged

Definition at line 101 of file CProcessQueue.cpp.

102 {
103  // Assume that nothing is changed
104  bool StateChanged = false;
105 
106  switch (mType)
107  {
108  case Calculation:
109 
110  if (mpEvent->delayAssignment())
111  {
115  mpEvent);
116  }
117  else
118  {
119  StateChanged = mpEvent->executeAssignment();
120  }
121 
122  break;
123 
124  case Assignment:
125  StateChanged = mpEvent->setTargetValues(mValues);
126  break;
127 
128  case Callback:
129 
131  {
133  }
134 
135  break;
136  }
137 
138  return StateChanged;
139 }
C_FLOAT64 mTime
const bool & delayAssignment() const
bool setTargetValues(const CVector< C_FLOAT64 > &targetValues)
bool executeAssignment()
bool addAssignment(const C_FLOAT64 &executionTime, const bool &equality, const CVector< C_FLOAT64 > &values, CMathEvent *pEvent)
const CEvent::Type & getType() const
EventCallBack mpEventCallBack
CVector< C_FLOAT64 > getTargetValues()
C_FLOAT64 getAssignmentTime(const C_FLOAT64 &currentTime)
void * mpCallbackTask
CProcessQueue * mpProcessQueue
CVector< C_FLOAT64 > mValues

Friends And Related Function Documentation

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

Member Data Documentation

CMathEvent* CProcessQueue::CAction::mpEvent

The event associated with this action

Definition at line 177 of file CProcessQueue.h.

Referenced by getEvent().

CProcessQueue* CProcessQueue::CAction::mpProcessQueue

A pointer to the process queue to which a subsequent assignment must be added if the entry is a calculation.

Definition at line 183 of file CProcessQueue.h.

Type CProcessQueue::CAction::mType

The type of the actions

Definition at line 167 of file CProcessQueue.h.

Referenced by CAction().

CVector< C_FLOAT64 > CProcessQueue::CAction::mValues

The new value if the entry is an assignment.

Definition at line 172 of file CProcessQueue.h.


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