COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CSensItem Class Reference

#include <CSensProblem.h>

Collaboration diagram for CSensItem:
Collaboration graph
[legend]

Public Member Functions

 CSensItem ()
 
const CObjectLists::ListTypegetListType () const
 
std::string getListTypeDisplayName () const
 
const CCopasiObjectNamegetSingleObjectCN () const
 
std::string getSingleObjectDisplayName (const CCopasiDataModel *pDataModel) const
 
std::vector< CCopasiObject * > getVariablesPointerList (CCopasiDataModel *pDataModel)
 
bool isSingleObject () const
 
bool operator!= (const CSensItem &rhs) const
 
bool operator== (const CSensItem &rhs) const
 
std::string print (const CCopasiDataModel *pDataModel) const
 
void setListType (CObjectLists::ListType lt)
 
void setSingleObjectCN (const CCopasiObjectName &cn)
 

Private Attributes

CObjectLists::ListType mListType
 
CCopasiObjectName mSingleObjectCN
 

Detailed Description

This class describes either one specific COPASI object (represented by a registered object CN internally) or a list of objects (see CObjectLists class).

Definition at line 29 of file CSensProblem.h.

Constructor & Destructor Documentation

CSensItem::CSensItem ( )

Definition at line 22 of file CSensProblem.cpp.

23  : mSingleObjectCN(),
25 {}
CObjectLists::ListType mListType
Definition: CSensProblem.h:56
CCopasiObjectName mSingleObjectCN
Definition: CSensProblem.h:55

Member Function Documentation

const CObjectLists::ListType & CSensItem::getListType ( ) const

Definition at line 59 of file CSensProblem.cpp.

References mListType.

Referenced by CSensProblem::copySensItemToParameterGroup(), getVariablesPointerList(), operator==(), and SensitivitiesWidget::saveTask().

60 {
61  return mListType;
62 }
CObjectLists::ListType mListType
Definition: CSensProblem.h:56
std::string CSensItem::getListTypeDisplayName ( ) const

Definition at line 64 of file CSensProblem.cpp.

References CObjectLists::ListTypeName, and mListType.

Referenced by CSensMethod::initialize(), and print().

65 {
67 }
CObjectLists::ListType mListType
Definition: CSensProblem.h:56
static const std::string ListTypeName[]
Definition: CObjectLists.h:98
const CCopasiObjectName & CSensItem::getSingleObjectCN ( ) const

Definition at line 39 of file CSensProblem.cpp.

References mSingleObjectCN.

Referenced by CSensProblem::copySensItemToParameterGroup(), getVariablesPointerList(), and operator==().

40 {
41  return mSingleObjectCN;
42 }
CCopasiObjectName mSingleObjectCN
Definition: CSensProblem.h:55
std::string CSensItem::getSingleObjectDisplayName ( const CCopasiDataModel pDataModel) const

Definition at line 44 of file CSensProblem.cpp.

References CCopasiDataModel::getDataObject(), CCopasiObject::getObjectDisplayName(), and mSingleObjectCN.

Referenced by print().

45 {
46  const CCopasiObject* tmpObject = pDataModel->getDataObject(mSingleObjectCN);
47 
48  if (tmpObject)
49  return tmpObject->getObjectDisplayName();
50  else
51  return "";
52 }
CCopasiObject * getDataObject(const CCopasiObjectName &CN) const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
CCopasiObjectName mSingleObjectCN
Definition: CSensProblem.h:55
std::vector< CCopasiObject * > CSensItem::getVariablesPointerList ( CCopasiDataModel pDataModel)

Definition at line 90 of file CSensProblem.cpp.

References CCopasiDataModel::getDataObject(), CObjectLists::getListOfObjects(), getListType(), CCopasiDataModel::getModel(), getSingleObjectCN(), isSingleObject(), and CCopasiObject::isValueDbl().

Referenced by CSensMethod::initialize().

91 {
92  std::vector<CCopasiObject*> ret;
93 
94  if (isSingleObject())
95  {
96  CCopasiObject * tmpObject = pDataModel->getDataObject(getSingleObjectCN());
97 
98  if (!tmpObject) {return ret;} //return empty list
99 
100  if (!tmpObject->isValueDbl()) {return ret;} //return empty list
101 
102  ret.push_back(tmpObject);
103  }
104  else
105  {
106  ret = CObjectLists::getListOfObjects(getListType(), pDataModel->getModel());
107  }
108 
109  return ret;
110 }
CCopasiObject * getDataObject(const CCopasiObjectName &CN) const
bool isSingleObject() const
const CObjectLists::ListType & getListType() const
static std::vector< CCopasiObject * > getListOfObjects(ListType t, const CModel *model)
bool isValueDbl() const
const CCopasiObjectName & getSingleObjectCN() const
bool CSensItem::isSingleObject ( ) const
bool CSensItem::operator!= ( const CSensItem rhs) const

Definition at line 85 of file CSensProblem.cpp.

86 {
87  return !(*this == rhs);
88 }
bool CSensItem::operator== ( const CSensItem rhs) const

Definition at line 69 of file CSensProblem.cpp.

References getListType(), getSingleObjectCN(), and isSingleObject().

70 {
71  if (isSingleObject() != rhs.isSingleObject())
72  return false;
73 
74  if (isSingleObject())
75  {
76  if (getSingleObjectCN() != rhs.getSingleObjectCN())
77  return false;
78  }
79  else if (getListType() != rhs.getListType())
80  return false;
81 
82  return true;
83 }
bool isSingleObject() const
const CObjectLists::ListType & getListType() const
const CCopasiObjectName & getSingleObjectCN() const
std::string CSensItem::print ( const CCopasiDataModel pDataModel) const

Had to disable the output operator because the datamodel is needed to print a sensitivity item. std::ostream &operator<<(std::ostream &os, const CSensItem & si) { if (si.isSingleObject()) os << si.getSingleObjectDisplayName(); else os << si.getListTypeDisplayName();

return os; }

Definition at line 600 of file CSensProblem.cpp.

References getListTypeDisplayName(), getSingleObjectDisplayName(), and isSingleObject().

Referenced by operator<<().

601 {
602  std::ostringstream os;
603 
604  if (this->isSingleObject())
605  os << this->getSingleObjectDisplayName(pDataModel);
606  else
607  os << this->getListTypeDisplayName();
608 
609  return os.str();
610 }
std::string getListTypeDisplayName() const
bool isSingleObject() const
std::string getSingleObjectDisplayName(const CCopasiDataModel *pDataModel) const
void CSensItem::setListType ( CObjectLists::ListType  lt)
void CSensItem::setSingleObjectCN ( const CCopasiObjectName cn)

Definition at line 32 of file CSensProblem.cpp.

References mSingleObjectCN, setListType(), and CObjectLists::SINGLE_OBJECT.

Referenced by CSensProblem::copyParameterGroupToSensItem(), CSensProblem::initDebugProblem(), and SensitivitiesWidget::saveTask().

33 {
34  mSingleObjectCN = cn;
35  // if (cn != "")
37 }
CCopasiObjectName mSingleObjectCN
Definition: CSensProblem.h:55
void setListType(CObjectLists::ListType lt)

Member Data Documentation

CObjectLists::ListType CSensItem::mListType
private

Definition at line 56 of file CSensProblem.h.

Referenced by getListType(), getListTypeDisplayName(), isSingleObject(), and setListType().

CCopasiObjectName CSensItem::mSingleObjectCN
private

Definition at line 55 of file CSensProblem.h.

Referenced by getSingleObjectCN(), getSingleObjectDisplayName(), and setSingleObjectCN().


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