COPASI API  4.16.103
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
CNormalItem Class Reference

#include <CNormalItem.h>

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

Public Types

enum  Type { CONSTANT, VARIABLE }
 

Public Member Functions

 CNormalItem ()
 
 CNormalItem (const std::string &name, const Type &type)
 
 CNormalItem (const CNormalItem &src)
 
virtual CNormalBasecopy () const
 
const std::string getName () const
 
const TypegetType () const
 
bool operator< (const CNormalItem &rhs) const
 
CNormalItemoperator= (const CNormalItem &src)
 
bool operator== (const CNormalItem &rhs) const
 
bool setName (const std::string &name)
 
bool setType (const Type &type)
 
virtual bool simplify ()
 
virtual std::string toString () const
 
- Public Member Functions inherited from CNormalBase
virtual bool areEqual (const CNormalBase &rhs) const
 
virtual ~CNormalBase ()
 

Public Attributes

std::string mName
 
Type mType
 

Friends

std::ostream & operator<< (std::ostream &os, const CNormalItem &d)
 

Detailed Description

The class for items used in CNormal

Definition at line 22 of file CNormalItem.h.

Member Enumeration Documentation

Enumeration of possible item types.

Enumerator
CONSTANT 
VARIABLE 

Definition at line 28 of file CNormalItem.h.

Constructor & Destructor Documentation

CNormalItem::CNormalItem ( )

Default constructor

Definition at line 33 of file CNormalItem.cpp.

Referenced by copy().

33  : CNormalBase(), mName("no name")
34 {}
std::string mName
Definition: CNormalItem.h:34
CNormalItem::CNormalItem ( const std::string &  name,
const Type type 
)

Data constructor

Definition at line 39 of file CNormalItem.cpp.

39  : CNormalBase(), mName(name), mType(type)
40 {}
std::string mName
Definition: CNormalItem.h:34
CNormalItem::CNormalItem ( const CNormalItem src)

Copy contructor

Definition at line 45 of file CNormalItem.cpp.

45  : CNormalBase(src), mName(src.mName), mType(src.mType)
46 {}
std::string mName
Definition: CNormalItem.h:34

Member Function Documentation

CNormalBase * CNormalItem::copy ( ) const
virtual

Implements CNormalBase.

Definition at line 127 of file CNormalItem.cpp.

References CNormalItem().

128  {
129  return new CNormalItem(*this);
130  }
const std::string CNormalItem::getName ( ) const

Retrieve the name of this item.

Returns
mName

Definition at line 82 of file CNormalItem.cpp.

References mName.

Referenced by CNormalChoice::checkConditionTree(), CNormalChoiceLogical::checkConditionTree(), contains_necessary_mass_action_elements(), convertToCEvaluationNode(), and normalize_variable_names().

83  {
84  return mName;
85  }
std::string mName
Definition: CNormalItem.h:34
const CNormalItem::Type & CNormalItem::getType ( ) const

Retrieve the type of this item.

Returns
mType

Definition at line 91 of file CNormalItem.cpp.

References mType.

Referenced by CNormalChoice::checkConditionTree(), CNormalChoiceLogical::checkConditionTree(), contains_necessary_mass_action_elements(), convertToCEvaluationNode(), and normalize_variable_names().

92  {
93  return mType;
94  }
bool CNormalItem::operator< ( const CNormalItem rhs) const

Examine inequality of two item.

Returns
bool.

Definition at line 107 of file CNormalItem.cpp.

References mName, and mType.

108  {
109  if (mType < rhs.mType)
110  return true;
111  if (rhs.mType < mType)
112  return false;
113  return (mName < rhs.mName);
114  }
std::string mName
Definition: CNormalItem.h:34
CNormalItem & CNormalItem::operator= ( const CNormalItem src)

Assignment operator

Definition at line 51 of file CNormalItem.cpp.

References mName, and mType.

52 {
53  this->mName = src.mName;
54  this->mType = src.mType;
55  return *this;
56 }
std::string mName
Definition: CNormalItem.h:34
bool CNormalItem::operator== ( const CNormalItem rhs) const

Examine equality of two items.

Returns
bool.

Definition at line 100 of file CNormalItem.cpp.

References mName, and mType.

101  {return ((rhs.mName == mName) && (rhs.mType == mType));}
std::string mName
Definition: CNormalItem.h:34
bool CNormalItem::setName ( const std::string &  name)

Set the name of this item

Returns
true.

Definition at line 62 of file CNormalItem.cpp.

References mName.

Referenced by normalize_variable_names(), and test_simplify::test_simplify_1().

63 {
64  mName = name;
65  return true;
66 }
std::string mName
Definition: CNormalItem.h:34
bool CNormalItem::setType ( const Type type)

Set the type of this item.

Returns
true.

Definition at line 72 of file CNormalItem.cpp.

References mType.

Referenced by test_simplify::test_simplify_1().

73 {
74  mType = type;
75  return true;
76 }
virtual bool CNormalItem::simplify ( )
inlinevirtual

Implements CNormalBase.

Definition at line 97 of file CNormalItem.h.

97 {return true;};
std::string CNormalItem::toString ( ) const
virtual

Implements CNormalBase.

Definition at line 116 of file CNormalItem.cpp.

References mName.

Referenced by operator<<().

117  {
118  return this->mName;
119  }
std::string mName
Definition: CNormalItem.h:34

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CNormalItem d 
)
friend

Definition at line 121 of file CNormalItem.cpp.

122 {
123  os << d.toString();
124  return os;
125 }
virtual std::string toString() const

Member Data Documentation

std::string CNormalItem::mName

Definition at line 34 of file CNormalItem.h.

Referenced by getName(), operator<(), operator=(), operator==(), setName(), and toString().

Type CNormalItem::mType

Definition at line 35 of file CNormalItem.h.

Referenced by getType(), operator<(), operator=(), operator==(), and setType().


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