COPASI API  4.16.103
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CSBMLunitInformation Class Reference

#include <CSBMLunit.h>

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

Public Types

enum  INFO {
  UNKNOWN = 0, DEFAULT, GLOBAL, PROVIDED,
  DERIVED
}
 this enum encodes the status of a units information More...
 

Public Member Functions

 CSBMLunitInformation (unsigned int sbmlLevel, unsigned int sbmlVersion)
 Default constructor. More...
 
 CSBMLunitInformation (unsigned int sbmlLevel, unsigned int sbmlVersion, INFO info, bool conflict=false)
 
 CSBMLunitInformation (const CSBMLunit &u, INFO info, bool conflict=false)
 
 CSBMLunitInformation (const UnitDefinition *ud, INFO info, bool conflict=false)
 
virtual std::string getDisplayString () const
 
INFO getInfo () const
 get the status information More...
 
bool isConflict () const
 retrieve the conflict flag More...
 
void setConflict (bool c)
 set the conflict flag More...
 
void setInfo (INFO info)
 set the status information More...
 
- Public Member Functions inherited from CSBMLunit
void applyExponent (double exp)
 apply numeric exponent to the unit. More...
 
void applyExponent (const std::string &id, size_t frame)
 apply symbolic exponent to the unit More...
 
void applyInverseExponent (const std::string &id, size_t frame)
 apply inverse of symbolic exponent to the unit More...
 
 CSBMLunit (unsigned int sbmlLevel, unsigned int sbmlVersion)
 Default constructor. More...
 
 CSBMLunit (const CSBMLunit &src)
 Copy constructor. More...
 
 CSBMLunit (const UnitDefinition *ud)
 Constructor from libsbml units. More...
 
UnitDefinition & getSBMLUnitDefinition ()
 
const UnitDefinition & getSBMLUnitDefinition () const
 
int getSymbolicExpExp () const
 
const std::string & getSymbolicExponent () const
 
void invert ()
 
bool isDimensionless () const
 
bool multiply (const CSBMLunit &unit)
 
virtual ~CSBMLunit ()
 

Static Public Member Functions

static bool isEqual (const CSBMLunitInformation &unit1, const CSBMLunitInformation &unit2)
 
- Static Public Member Functions inherited from CSBMLunit
static bool isEqual (const CSBMLunit &unit1, const CSBMLunit &unit2)
 

Private Attributes

bool mConflict
 indicated whether a conflict occurred while trying to determine the unit. More...
 
INFO mInfo
 

Detailed Description

This class contains one unit definition plus some meta information, e.g. whether the unit was provided or calculated, if it is unknown or if there is a conflict.

Definition at line 99 of file CSBMLunit.h.

Member Enumeration Documentation

this enum encodes the status of a units information

Enumerator
UNKNOWN 

the units is unknown

DEFAULT 

the units is determined from the sbml defaults

GLOBAL 

the units is determined from the model-wide definitions

PROVIDED 

the units if provided for a specific object explicitly

DERIVED 

the units was determined by reasoning

Definition at line 103 of file CSBMLunit.h.

104  {
105  /// the units is unknown
106  UNKNOWN = 0,
107  /// the units is determined from the sbml defaults
108  DEFAULT,
109  /// the units is determined from the model-wide definitions
110  GLOBAL,
111  ///the units if provided for a specific object explicitly
112  PROVIDED,
113  ///the units was determined by reasoning
114  DERIVED
115  };
the units is determined from the sbml defaults
Definition: CSBMLunit.h:108
the units is unknown
Definition: CSBMLunit.h:106
the units is determined from the model-wide definitions
Definition: CSBMLunit.h:110
the units if provided for a specific object explicitly
Definition: CSBMLunit.h:112
the units was determined by reasoning
Definition: CSBMLunit.h:114

Constructor & Destructor Documentation

CSBMLunitInformation::CSBMLunitInformation ( unsigned int  sbmlLevel,
unsigned int  sbmlVersion 
)

Default constructor.

Definition at line 182 of file CSBMLunit.cpp.

183  : CSBMLunit(sbmlLevel, sbmlVersion),
184  mInfo(UNKNOWN),
185  mConflict(false)
186 {
187 }
the units is unknown
Definition: CSBMLunit.h:106
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
CSBMLunit(unsigned int sbmlLevel, unsigned int sbmlVersion)
Default constructor.
Definition: CSBMLunit.cpp:12
CSBMLunitInformation::CSBMLunitInformation ( unsigned int  sbmlLevel,
unsigned int  sbmlVersion,
INFO  info,
bool  conflict = false 
)

Definition at line 189 of file CSBMLunit.cpp.

190  : CSBMLunit(sbmlLevel, sbmlVersion),
191  mInfo(info),
192  mConflict(conflict)
193 {
194 }
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
CSBMLunit(unsigned int sbmlLevel, unsigned int sbmlVersion)
Default constructor.
Definition: CSBMLunit.cpp:12
CSBMLunitInformation::CSBMLunitInformation ( const CSBMLunit u,
INFO  info,
bool  conflict = false 
)

Definition at line 196 of file CSBMLunit.cpp.

197  : CSBMLunit(u),
198  mInfo(info),
199  mConflict(conflict)
200 {
201 }
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
CSBMLunit(unsigned int sbmlLevel, unsigned int sbmlVersion)
Default constructor.
Definition: CSBMLunit.cpp:12
CSBMLunitInformation::CSBMLunitInformation ( const UnitDefinition *  ud,
INFO  info,
bool  conflict = false 
)

Definition at line 203 of file CSBMLunit.cpp.

204  : CSBMLunit(ud),
205  mInfo(info),
206  mConflict(conflict)
207 {
208 }
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
CSBMLunit(unsigned int sbmlLevel, unsigned int sbmlVersion)
Default constructor.
Definition: CSBMLunit.cpp:12

Member Function Documentation

std::string CSBMLunitInformation::getDisplayString ( ) const
virtual

Reimplemented from CSBMLunit.

Definition at line 210 of file CSBMLunit.cpp.

References DEFAULT, DERIVED, CSBMLunit::getDisplayString(), GLOBAL, mConflict, mInfo, PROVIDED, and UNKNOWN.

Referenced by CSBMLunitInterface::debugOutput(), and CSBMLunitInterface::determineUnits().

211 {
212  std::string sss;
213 
214  switch (mInfo)
215  {
216  case UNKNOWN:
217  sss += "unknown";
218  break;
219  case DEFAULT:
220  sss += "default: " + CSBMLunit::getDisplayString();
221  break;
222  case GLOBAL:
223  sss += "global: " + CSBMLunit::getDisplayString();
224  break;
225  case PROVIDED:
226  sss += "provided: " + CSBMLunit::getDisplayString();
227  break;
228  case DERIVED:
229  sss += "derived: " + CSBMLunit::getDisplayString();
230  break;
231  };
232 
233  if (mConflict)
234  sss += "!!!Conflict!!!";
235 
236  return sss;
237 }
the units is determined from the sbml defaults
Definition: CSBMLunit.h:108
virtual std::string getDisplayString() const
Definition: CSBMLunit.cpp:44
the units is unknown
Definition: CSBMLunit.h:106
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
the units is determined from the model-wide definitions
Definition: CSBMLunit.h:110
the units if provided for a specific object explicitly
Definition: CSBMLunit.h:112
the units was determined by reasoning
Definition: CSBMLunit.h:114
INFO CSBMLunitInformation::getInfo ( ) const
inline
bool CSBMLunitInformation::isConflict ( ) const
inline

retrieve the conflict flag

Definition at line 136 of file CSBMLunit.h.

References mConflict.

Referenced by Expression2PresentationMMLUnits::getMathML(), and CSBMLunitInterface::handleTerminalNode().

136 {return mConflict;};
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
bool CSBMLunitInformation::isEqual ( const CSBMLunitInformation unit1,
const CSBMLunitInformation unit2 
)
static

Definition at line 240 of file CSBMLunit.cpp.

References CSBMLunit::isEqual(), mConflict, and mInfo.

Referenced by Expression2PresentationMMLUnits::writeMathMLName().

241 {
242  if (unit1.mInfo == unit2.mInfo && unit1.mConflict == unit2.mConflict)
243  return CSBMLunit::isEqual(unit1, unit2);
244  else
245  return false;
246 }
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
static bool isEqual(const CSBMLunit &unit1, const CSBMLunit &unit2)
Definition: CSBMLunit.cpp:159
void CSBMLunitInformation::setConflict ( bool  c)
inline

set the conflict flag

Definition at line 133 of file CSBMLunit.h.

References mConflict.

Referenced by CSBMLunitInterface::handleTerminalNode().

133 {mConflict = c;};
bool mConflict
indicated whether a conflict occurred while trying to determine the unit.
Definition: CSBMLunit.h:146
void CSBMLunitInformation::setInfo ( INFO  info)
inline

Member Data Documentation

bool CSBMLunitInformation::mConflict
private

indicated whether a conflict occurred while trying to determine the unit.

Definition at line 146 of file CSBMLunit.h.

Referenced by getDisplayString(), isConflict(), isEqual(), and setConflict().

INFO CSBMLunitInformation::mInfo
private

Definition at line 143 of file CSBMLunit.h.

Referenced by getDisplayString(), getInfo(), isEqual(), and setInfo().


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