COPASI API  4.16.103
Functions
CCopasiParameter.cpp File Reference
#include <string>
#include "copasi/copasi.h"
#include "copasi/utilities/CCopasiParameter.h"
#include "copasi/utilities/CCopasiParameterGroup.h"
#include "copasi/utilities/CCopasiMessage.h"
#include "copasi/report/CKeyFactory.h"
#include "copasi/report/CCopasiObjectReference.h"
#include "copasi/report/CCopasiRootContainer.h"
Include dependency graph for CCopasiParameter.cpp:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const CCopasiParameter &o)
 
bool operator== (const CCopasiParameter &lhs, const CCopasiParameter &rhs)
 

Function Documentation

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

Output stream operator

Parameters
ostream& os
constCCopasiParameter & A
Returns
ostream & os

Definition at line 319 of file CCopasiParameter.cpp.

References CCopasiParameter::BOOL, CCopasiParameter::CN, CCopasiParameter::DOUBLE, CCopasiParameter::EXPRESSION, CCopasiParameter::FILE, CCopasiObject::getObjectName(), CCopasiParameter::GROUP, CCopasiParameter::INT, CCopasiParameter::INVALID, CCopasiParameter::KEY, CCopasiParameter::mType, CCopasiParameter::mValue, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pCN, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pINT, CCopasiParameter::Value::pSTRING, CCopasiParameter::Value::pUINT, CCopasiParameter::STRING, CCopasiParameter::UDOUBLE, and CCopasiParameter::UINT.

320 {
321  os << " " << o.getObjectName() << ": ";
322 
323  switch (o.mType)
324  {
327  os << * o.mValue.pDOUBLE;
328  break;
329 
331  os << * o.mValue.pINT;
332  break;
333 
335  os << * o.mValue.pUINT;
336  break;
337 
339  os << * o.mValue.pBOOL;
340  break;
341 
346  os << * o.mValue.pSTRING;
347  break;
348 
350  os << * o.mValue.pCN;
351  break;
352 
355  break;
356  }
357 
358  return os;
359 }
const std::string & getObjectName() const
CCopasiParameter::Type mType
CRegisteredObjectName * pCN
unsigned C_INT32 * pUINT
bool operator== ( const CCopasiParameter lhs,
const CCopasiParameter rhs 
)

Comparison operator

Parameters
constCCopasiParameter & lhs
constCCopasiParameter & rhs
Returns
bool equal

Definition at line 361 of file CCopasiParameter.cpp.

References CCopasiParameter::BOOL, CCopasiParameter::CN, CCopasiParameter::DOUBLE, CCopasiParameter::EXPRESSION, CCopasiParameter::FILE, CCopasiObject::getObjectName(), CCopasiParameter::GROUP, CCopasiParameter::INT, CCopasiParameter::INVALID, CCopasiParameter::KEY, CCopasiParameter::mSize, CCopasiParameter::mType, CCopasiParameter::mValue, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pCN, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pINT, CCopasiParameter::Value::pSTRING, CCopasiParameter::Value::pUINT, CCopasiParameter::Value::pVOID, CCopasiParameter::STRING, CCopasiParameter::UDOUBLE, and CCopasiParameter::UINT.

362 {
363  if (lhs.getObjectName() != rhs.getObjectName()) return false;
364 
365  if (lhs.mType != rhs.mType) return false;
366 
367  switch (lhs.mType)
368  {
371  return *lhs.mValue.pDOUBLE == *rhs.mValue.pDOUBLE;
372  break;
373 
375  return *lhs.mValue.pINT == *rhs.mValue.pINT;
376  break;
377 
379  return *lhs.mValue.pUINT == *rhs.mValue.pUINT;
380  break;
381 
383  return *lhs.mValue.pBOOL == *rhs.mValue.pBOOL;
384  break;
385 
390  return *lhs.mValue.pSTRING == *rhs.mValue.pSTRING;
391  break;
392 
394  return *lhs.mValue.pCN == *rhs.mValue.pCN;
395  break;
396 
398  return *static_cast<const CCopasiParameterGroup *>(&lhs) ==
399  *static_cast<const CCopasiParameterGroup *>(&rhs);
400  break;
401 
403  default:
404  return !memcmp(lhs.mValue.pVOID, rhs.mValue.pVOID, lhs.mSize);
405  break;
406  }
407 
408  return false;
409 }
const std::string & getObjectName() const
CCopasiParameter::Type mType
CRegisteredObjectName * pCN
unsigned C_INT32 * pUINT