COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CMathEventN::CAssignment Class Reference

#include <CMathEvent.h>

Collaboration diagram for CMathEventN::CAssignment:
Collaboration graph
[legend]

Public Member Functions

 CAssignment ()
 
bool compile (CEventAssignment *pDataAssignment, CMathContainer &container)
 
void copy (const CAssignment &src, CMathContainer &container, const size_t &valueOffset, const size_t &objectOffset)
 
void initialize (CMath::sPointers &pointers)
 
void setExpression (CMathObject *pExpression)
 
void setTarget (CMathObject *pTarget)
 
 ~CAssignment ()
 

Private Attributes

CMathObjectmpAssignment
 
CMathObjectmpTarget
 

Detailed Description

Definition at line 23 of file CMathEvent.h.

Constructor & Destructor Documentation

CMathEventN::CAssignment::CAssignment ( )

Default constructor

Definition at line 21 of file CMathEvent.cpp.

21  :
22  mpTarget(NULL),
23  mpAssignment(NULL)
24 {}
CMathObject * mpTarget
Definition: CMathEvent.h:55
CMathObject * mpAssignment
Definition: CMathEvent.h:56
CMathEventN::CAssignment::~CAssignment ( )

Destructor

Definition at line 26 of file CMathEvent.cpp.

27 {}

Member Function Documentation

bool CMathEventN::CAssignment::compile ( CEventAssignment pDataAssignment,
CMathContainer container 
)

Definition at line 47 of file CMathEvent.cpp.

References CExpression::compile(), CMath::EventTarget, CMath::Fixed, CEventAssignment::getExpression(), CMathContainer::getMathObject(), CEventAssignment::getTargetObject(), CExpression::setInfix(), and CMathObject::setSimulationType().

Referenced by CMathEventN::compile().

49 {
50  // A compiled pDataAssignment is prerequisite.
51  bool success = true;
52 
53  // Determine the target object
54  mpTarget = container.getMathObject(pDataAssignment->getTargetObject());
55 
56  if (mpTarget != NULL &&
58  {
60  }
61 
62  std::vector< CCopasiContainer * > ListOfContainer;
63 
64  // Compile the assignment object in the model context
65  CExpression AssignmentExpression("AssignmentExpression", &container);
66  success &= AssignmentExpression.setInfix(pDataAssignment->getExpression());
67  success &= AssignmentExpression.compile(ListOfContainer);
68  success &= mpAssignment->setExpression(AssignmentExpression, container);
69 
70  return success;
71 }
void setSimulationType(const CMath::SimulationType &simulationType)
CMathObject * mpTarget
Definition: CMathEvent.h:55
CMathObject * getMathObject(const CObjectInterface *pObject) const
CMathObject * mpAssignment
Definition: CMathEvent.h:56
const CMath::SimulationType & getSimulationType() const
bool setExpression(const std::string &infix, const bool &isBoolean, CMathContainer &container)
const CCopasiObject * getTargetObject() const
Definition: CEvent.cpp:146
std::string getExpression() const
Definition: CEvent.cpp:216
void CMathEventN::CAssignment::copy ( const CAssignment src,
CMathContainer container,
const size_t &  valueOffset,
const size_t &  objectOffset 
)

Copy an existing object

Parameters
constCAssignment & src
CMathContainer& container
constsize_t & valueOffset
constsize_t & objectOffset

Definition at line 38 of file CMathEvent.cpp.

References mpAssignment, and mpTarget.

Referenced by CMathEventN::copy().

42 {
43  mpTarget = src.mpTarget + objectOffset;
44  mpAssignment = src.mpAssignment + objectOffset;
45 }
CMathObject * mpTarget
Definition: CMathEvent.h:55
CMathObject * mpAssignment
Definition: CMathEvent.h:56
void CMathEventN::CAssignment::initialize ( CMath::sPointers pointers)

Definition at line 29 of file CMathEvent.cpp.

References CMath::Event, CMath::EventAssignment, CMathObject::initialize(), CMath::sPointers::pEventAssignments, CMath::sPointers::pEventAssignmentsObject, and CMath::SimulationTypeUndefined.

Referenced by CMathEventN::initialize().

30 {
31  // Initialize the assignment object
35  false, false, NULL);
36 }
CMathObject * mpAssignment
Definition: CMathEvent.h:56
C_FLOAT64 * pEventAssignments
Definition: CMathEnum.h:109
CMathObject * pEventAssignmentsObject
Definition: CMathEnum.h:136
static void initialize(CMathObject *&pObject, C_FLOAT64 *&pValue, const CMath::ValueType &valueType, const CMath::EntityType &entityType, const CMath::SimulationType &simulationType, const bool &isIntensiveProperty, const bool &isInitialValue, const CCopasiObject *pDataObject)
Definition: CMathObject.cpp:23
void CMathEventN::CAssignment::setExpression ( CMathObject pExpression)

Definition at line 78 of file CMathEvent.cpp.

Referenced by CMathEventN::addAssignment().

79 {
80  mpAssignment = pExpression;
81 }
CMathObject * mpAssignment
Definition: CMathEvent.h:56
void CMathEventN::CAssignment::setTarget ( CMathObject pTarget)

Definition at line 73 of file CMathEvent.cpp.

Referenced by CMathEventN::addAssignment().

74 {
75  mpTarget = pTarget;
76 }
CMathObject * mpTarget
Definition: CMathEvent.h:55

Member Data Documentation

CMathObject* CMathEventN::CAssignment::mpAssignment
private

Definition at line 56 of file CMathEvent.h.

Referenced by copy().

CMathObject* CMathEventN::CAssignment::mpTarget
private

Definition at line 55 of file CMathEvent.h.

Referenced by copy().


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