COPASI API  4.16.103
Functions
CCopasiParameterGroup.cpp File Reference
#include <sstream>
#include "copasi.h"
#include "CCopasiParameterGroup.h"
#include "CCopasiMessage.h"
#include "utilities/utility.h"
Include dependency graph for CCopasiParameterGroup.cpp:

Go to the source code of this file.

Functions

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

Function Documentation

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

Output stream operator

Parameters
ostream& os
constCCopasiParameterGroup & o
Returns
ostream & os

Definition at line 199 of file CCopasiParameterGroup.cpp.

References CCopasiObject::getObjectName(), and CCopasiParameterGroup::print().

200 {
201  os << "<<< Parameter Group: " << o.getObjectName() << std::endl;
202 
203  CCopasiParameterGroup::parameterGroup::const_iterator it =
204  o.CCopasiParameter::getValue().pGROUP->begin();
205  CCopasiParameterGroup::parameterGroup::const_iterator end =
206  o.CCopasiParameter::getValue().pGROUP->end();
207 
208  for (; it != end; ++it)
209  {
210  (*it)->print(&os);
211  os << std::endl;
212  }
213 
214  os << ">>> Parameter Group: " << o.getObjectName() << std::endl;
215  return os;
216 }
const std::string & getObjectName() const
virtual void print(std::ostream *ostream) const
bool operator== ( const CCopasiParameterGroup lhs,
const CCopasiParameterGroup rhs 
)

Comparison operator

Parameters
constCCopasiParameterGroup & lhs
constCCopasiParameterGroup & rhs
Returns
bool equal

Definition at line 218 of file CCopasiParameterGroup.cpp.

References CCopasiObject::getObjectName(), CCopasiParameter::mValue, and CCopasiParameter::Value::pGROUP.

220 {
221  if (lhs.getObjectName() != rhs.getObjectName()) return false;
222 
223  if (lhs.mValue.pGROUP->size() != rhs.mValue.pGROUP->size()) return false;
224 
225  CCopasiParameterGroup::parameterGroup::const_iterator itLhs =
226  lhs.mValue.pGROUP->begin();
227  CCopasiParameterGroup::parameterGroup::const_iterator endLhs =
228  lhs.mValue.pGROUP->end();
229 
230  CCopasiParameterGroup::parameterGroup::const_iterator itRhs =
231  rhs.mValue.pGROUP->begin();
232 
233  for (; itLhs != endLhs; ++itLhs, ++itRhs)
234  if (!(**itLhs == **itRhs)) return false;
235 
236  return true;
237 }
const std::string & getObjectName() const
std::vector< CCopasiParameter * > * pGROUP