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

#include <CReportDefinition.h>

Inheritance diagram for CReportDefinition:
Inheritance graph
[legend]
Collaboration diagram for CReportDefinition:
Collaboration graph
[legend]

Public Member Functions

void cleanup ()
 
 CReportDefinition (const std::string &name="NoName", const CCopasiContainer *pParent=NULL)
 
 CReportDefinition (const CReportDefinition &src, const CCopasiContainer *pParent=NULL)
 
std::vector
< CRegisteredObjectName > * 
getBodyAddr ()
 
const std::string & getComment () const
 
std::vector
< CRegisteredObjectName > * 
getFooterAddr ()
 
std::vector
< CRegisteredObjectName > * 
getHeaderAddr ()
 
virtual const std::string & getKey () const
 
const unsigned C_INT32getPrecision () const
 
const CCopasiReportSeparatorgetSeparator () const
 
std::vector
< CRegisteredObjectName > * 
getTableAddr ()
 
const CCopasiTask::TypegetTaskType () const
 
bool getTitle () const
 
bool isTable () const
 
bool preCompileTable (const std::vector< CCopasiContainer * > &listOfContainer=CCopasiContainer::EmptyList)
 
void setComment (const std::string &comment)
 
void setIsTable (bool table)
 
void setPrecision (const unsigned C_INT32 &precision)
 
void setSeparator (const CCopasiReportSeparator &Separator)
 
bool setTaskType (const CCopasiTask::Type &taskType)
 
void setTitle (bool title)
 
 ~CReportDefinition ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
virtual std::string getUnits () const
 
UpdateMethodgetUpdateMethod () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Member Functions

void addTableElement (const CCopasiObject *pObject)
 

Private Attributes

std::vector
< CRegisteredObjectName
mBodyVector
 
bool mbTitle
 
std::string mComment
 
std::vector
< CRegisteredObjectName
mFooterVector
 
std::vector
< CRegisteredObjectName
mHeaderVector
 
std::string mKey
 
unsigned C_INT32 mPrecision
 
CCopasiReportSeparator mSeparator
 
bool mTable
 
std::vector
< CRegisteredObjectName
mTableVector
 
CCopasiTask::Type mTaskType
 

Additional Inherited Members

- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 40 of file CReportDefinition.h.

Constructor & Destructor Documentation

CReportDefinition::CReportDefinition ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL 
)

Default constructor.

CReportDefinition class. This class describes the Report Definition

Created for Copasi by Mudita Singhal

Definition at line 44 of file CReportDefinition.cpp.

45  :
46  CCopasiObject(name, pParent, "ReportDefinition"),
47  mKey(CCopasiRootContainer::getKeyFactory()->add("Report", this)),
48  mComment(""),
50  mSeparator("\t"),
51  mTable(true),
52  mbTitle(true),
53  mPrecision(6)
54 {}
CCopasiTask::Type mTaskType
CCopasiReportSeparator mSeparator
static CKeyFactory * getKeyFactory()
unsigned C_INT32 mPrecision
CReportDefinition::CReportDefinition ( const CReportDefinition src,
const CCopasiContainer pParent = NULL 
)

Copy constructor.

Definition at line 56 of file CReportDefinition.cpp.

57  :
58  CCopasiObject(src, pParent),
59  mKey(CCopasiRootContainer::getKeyFactory()->add("Report", this)),
60  mComment(src.mComment),
61  mTaskType(src.mTaskType),
63  mTable(src.mTable),
64  mbTitle(src.mbTitle),
70 {}
std::vector< CRegisteredObjectName > mHeaderVector
std::vector< CRegisteredObjectName > mFooterVector
CCopasiTask::Type mTaskType
std::vector< CRegisteredObjectName > mTableVector
std::vector< CRegisteredObjectName > mBodyVector
CCopasiReportSeparator mSeparator
static CKeyFactory * getKeyFactory()
unsigned C_INT32 mPrecision
CReportDefinition::~CReportDefinition ( )

Destructor.

Definition at line 72 of file CReportDefinition.cpp.

References cleanup().

73 {cleanup();}

Member Function Documentation

void CReportDefinition::addTableElement ( const CCopasiObject pObject)
private

This adds header and body entries for one table element (including separator if necessary)

Parameters
constCCopasiObject * pObject

Definition at line 160 of file CReportDefinition.cpp.

References CCopasiObject::getCN(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), mBodyVector, mbTitle, mHeaderVector, and mSeparator.

Referenced by preCompileTable().

161 {
162  bool isFirst = false;
163 
164  if ((mHeaderVector.size() == 0) && (mBodyVector.size() == 0))
165  isFirst = true;
166 
167  CCopasiObjectName SeparatorCN(mSeparator.getCN());
168  CCopasiObjectName Title;
169 
170  if (!pObject) return;
171 
172  // Add separator
173  if (!isFirst)
174  {
175  if (mbTitle)
176  mHeaderVector.push_back(SeparatorCN);
177 
178  mBodyVector.push_back(SeparatorCN);
179  }
180 
181  // Determine column title
182  if (pObject->getObjectParent())
183  {
184  Title = pObject->getCN() + ",Property=DisplayName";
185  }
186  else
187  Title =
189 
190  if (mbTitle)
191  mHeaderVector.push_back(Title);
192 
193  mBodyVector.push_back(pObject->getCN());
194 
195  return;
196 }
virtual CCopasiObjectName getCN() const
const std::string & getObjectName() const
std::vector< CRegisteredObjectName > mHeaderVector
std::vector< CRegisteredObjectName > mBodyVector
CCopasiReportSeparator mSeparator
CCopasiContainer * getObjectParent() const
void CReportDefinition::cleanup ( )

cleanup

Definition at line 75 of file CReportDefinition.cpp.

References CCopasiRootContainer::getKeyFactory(), mBodyVector, mFooterVector, mHeaderVector, mKey, mTableVector, and CKeyFactory::remove().

Referenced by ~CReportDefinition().

76 {
78  mHeaderVector.clear();
79  mBodyVector.clear();
80  mFooterVector.clear();
81  mTableVector.clear();
82 }
bool remove(const std::string &key)
std::vector< CRegisteredObjectName > mHeaderVector
std::vector< CRegisteredObjectName > mFooterVector
std::vector< CRegisteredObjectName > mTableVector
std::vector< CRegisteredObjectName > mBodyVector
static CKeyFactory * getKeyFactory()
std::vector< CRegisteredObjectName > * CReportDefinition::getBodyAddr ( )
const std::string& CReportDefinition::getComment ( ) const
inline

Returns the comments in the report tag

Definition at line 92 of file CReportDefinition.h.

References mComment.

Referenced by CQNotes::load(), CQNotes::save(), and CCopasiXML::saveReportList().

93  {
94  return mComment;
95  }
std::vector< CRegisteredObjectName > * CReportDefinition::getFooterAddr ( )

gets the footer in the report tag

Definition at line 121 of file CReportDefinition.cpp.

References mFooterVector.

Referenced by CCopasiDataModel::addReport(), CReport::compile(), CCopasiXMLParser::FooterElement::end(), CQReportDefinition::load(), CQReportDefinition::save(), and CCopasiXML::saveReportList().

122 {return &mFooterVector;}
std::vector< CRegisteredObjectName > mFooterVector
std::vector< CRegisteredObjectName > * CReportDefinition::getHeaderAddr ( )
const std::string & CReportDefinition::getKey ( ) const
virtual
const unsigned C_INT32 & CReportDefinition::getPrecision ( ) const

Retrieve the precsion for floating point numbers;

Returns
const unsigned C_INT32 & precision

Definition at line 154 of file CReportDefinition.cpp.

References mPrecision.

Referenced by CQReportDefinition::load(), CReport::open(), and CCopasiXML::saveReportList().

155 {return mPrecision;}
unsigned C_INT32 mPrecision
const CCopasiReportSeparator & CReportDefinition::getSeparator ( ) const
std::vector< CRegisteredObjectName > * CReportDefinition::getTableAddr ( )
const CCopasiTask::Type & CReportDefinition::getTaskType ( ) const

Definition at line 130 of file CReportDefinition.cpp.

References mTaskType.

Referenced by CQReportDefinition::load(), and CCopasiXML::saveReportList().

131 {return mTaskType;}
CCopasiTask::Type mTaskType
bool CReportDefinition::getTitle ( ) const

Definition at line 139 of file CReportDefinition.cpp.

References mbTitle.

Referenced by CQReportDefinition::load(), and CCopasiXML::saveReportList().

140 {return mbTitle;}
bool CReportDefinition::isTable ( ) const
bool CReportDefinition::preCompileTable ( const std::vector< CCopasiContainer * > &  listOfContainer = CCopasiContainer::EmptyList)

Convert the table list into a header and body list.

Parameters
conststd::vector< CCopasiContainer * > & listOfContainer (default: CCopasiContainer::EmptyList)
Returns
bool success

Definition at line 84 of file CReportDefinition.cpp.

References addTableElement(), CCopasiObject::getObjectDataModel(), mBodyVector, MCCopasiTask, mFooterVector, mHeaderVector, mTableVector, CCopasiDataModel::ObjectFromName(), and CCopasiMessage::WARNING.

Referenced by CQReportDefinition::btnAdvancedClicked(), and CReport::compile().

85 {
86  bool success = true;
87 
88  mHeaderVector.clear();
89  mBodyVector.clear();
90  mFooterVector.clear();
91 
92  std::vector<CRegisteredObjectName>::const_iterator it = mTableVector.begin();
93  std::vector<CRegisteredObjectName>::const_iterator end = mTableVector.end();
94 
95  CCopasiDataModel* pDataModel = getObjectDataModel();
96  CCopasiObject * pObject;
97 
98  for (; it != end; ++it)
99  {
100  pObject = pDataModel->ObjectFromName(listOfContainer, *it);
101 
102  if (pObject != NULL)
103  {
104  addTableElement(pObject);
105  }
106  else
107  {
109  }
110  }
111 
112  return success;
113 }
CCopasiDataModel * getObjectDataModel()
std::vector< CRegisteredObjectName > mHeaderVector
std::vector< CRegisteredObjectName > mFooterVector
std::vector< CRegisteredObjectName > mTableVector
#define MCCopasiTask
std::vector< CRegisteredObjectName > mBodyVector
void addTableElement(const CCopasiObject *pObject)
CCopasiObject * ObjectFromName(const std::vector< CCopasiContainer * > &listOfContainer, const CCopasiObjectName &CN) const
void CReportDefinition::setComment ( const std::string &  comment)
inline
void CReportDefinition::setIsTable ( bool  table)
void CReportDefinition::setPrecision ( const unsigned C_INT32 precision)

Set the precsion for floating point numbers;

Parameters
constunsigned C_INT32 & precision

Definition at line 151 of file CReportDefinition.cpp.

References mPrecision.

Referenced by CQReportDefinition::save(), and CCopasiXMLParser::ReportElement::start().

152 {mPrecision = precision;}
unsigned C_INT32 mPrecision
void CReportDefinition::setSeparator ( const CCopasiReportSeparator Separator)
bool CReportDefinition::setTaskType ( const CCopasiTask::Type taskType)
void CReportDefinition::setTitle ( bool  title)

Member Data Documentation

std::vector<CRegisteredObjectName> CReportDefinition::mBodyVector
private

Definition at line 49 of file CReportDefinition.h.

Referenced by addTableElement(), cleanup(), getBodyAddr(), and preCompileTable().

bool CReportDefinition::mbTitle
private

Definition at line 55 of file CReportDefinition.h.

Referenced by addTableElement(), getTitle(), and setTitle().

std::string CReportDefinition::mComment
private

Definition at line 45 of file CReportDefinition.h.

Referenced by getComment(), and setComment().

std::vector<CRegisteredObjectName> CReportDefinition::mFooterVector
private

Definition at line 50 of file CReportDefinition.h.

Referenced by cleanup(), getFooterAddr(), and preCompileTable().

std::vector<CRegisteredObjectName> CReportDefinition::mHeaderVector
private

Definition at line 48 of file CReportDefinition.h.

Referenced by addTableElement(), cleanup(), getHeaderAddr(), and preCompileTable().

std::string CReportDefinition::mKey
private

Definition at line 44 of file CReportDefinition.h.

Referenced by cleanup(), and getKey().

unsigned C_INT32 CReportDefinition::mPrecision
private

Definition at line 56 of file CReportDefinition.h.

Referenced by getPrecision(), and setPrecision().

CCopasiReportSeparator CReportDefinition::mSeparator
private

Definition at line 53 of file CReportDefinition.h.

Referenced by addTableElement(), getSeparator(), and setSeparator().

bool CReportDefinition::mTable
private

Definition at line 54 of file CReportDefinition.h.

Referenced by isTable(), and setIsTable().

std::vector<CRegisteredObjectName> CReportDefinition::mTableVector
private

Definition at line 51 of file CReportDefinition.h.

Referenced by cleanup(), getTableAddr(), and preCompileTable().

CCopasiTask::Type CReportDefinition::mTaskType
private

Definition at line 46 of file CReportDefinition.h.

Referenced by getTaskType(), and setTaskType().


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