COPASI API  4.40.278
CVersion Class Reference

#include <CVersion.h>

Public Member Functions

 CVersion ()
 
const std::string & getVersion () const
 
C_INT32 getVersionDevel () const
 
C_INT32 getVersionMajor () const
 
C_INT32 getVersionMinor () const
 
bool isCompatible (const CVersion &version) const
 
const bool & isSourceModified () const
 
bool mayBeUpdated () const
 
bool operator!= (const CVersion &other) const
 
bool operator< (const CVersion &other) const
 
bool operator<= (const CVersion &other) const
 
bool operator== (const CVersion &other) const
 
bool operator> (const CVersion &other) const
 
bool operator>= (const CVersion &other) const
 
void setVersion (const C_INT32 &major, const C_INT32 &minor, const C_INT32 &devel, const bool &sourcesModified, const std::string &comment="", const std::string &creator="")
 
const CVersionsetVersion (const std::string &version)
 
 ~CVersion ()
 

Static Public Attributes

static const CVersion VERSION
 

Private Member Functions

 CVersion (C_INT32 major, C_INT32 minor, C_INT32 build, const bool &sourcesModified, const std::string &comment, const std::string &creator)
 
void setString ()
 

Private Attributes

C_INT32 mBuild
 
std::string mComment
 
std::set< C_INT32mCompatible
 
std::string mCreator
 
C_INT32 mMajor
 
C_INT32 mMinor
 
bool mSourcesModified
 
std::string mVersion
 

Detailed Description

CVersion

(C) Pedro Mendes 2001

Constructor & Destructor Documentation

◆ CVersion() [1/2]

CVersion::CVersion ( C_INT32  major,
C_INT32  minor,
C_INT32  build,
const bool &  sourcesModified,
const std::string &  comment,
const std::string &  creator 
)
private

Constructor with four arguments.

References C_INT32, COPASI_VERSION_COMPATIBILITY, mBuild, mCompatible, and setString().

◆ CVersion() [2/2]

CVersion::CVersion ( )

Default constructor. This creates a version object without any version info.

References setString().

◆ ~CVersion()

CVersion::~CVersion ( )

Destructor.

Member Function Documentation

◆ getVersion()

const std::string & CVersion::getVersion ( ) const

◆ getVersionDevel()

C_INT32 CVersion::getVersionDevel ( ) const

Returns the development version number.

Returns
mBuild
See also
mBuild

References mBuild.

Referenced by CCopasiXML::load(), operator<(), operator==(), operator>(), and EventHandler::processStart().

◆ getVersionMajor()

C_INT32 CVersion::getVersionMajor ( ) const

Returns the major version number.

Returns
mMajor
See also
mMajor

References mMajor.

Referenced by operator<(), operator==(), and operator>().

◆ getVersionMinor()

C_INT32 CVersion::getVersionMinor ( ) const

Returns the minor version number.

Returns
mMinor
See also
mMinor

References mMinor.

Referenced by operator<(), operator==(), and operator>().

◆ isCompatible()

bool CVersion::isCompatible ( const CVersion version) const

Compare Versions

Parameters
constCVersion & version
Returns
bool isCompatible

References mBuild, mCompatible, mMajor, and mMinor.

◆ isSourceModified()

const bool & CVersion::isSourceModified ( ) const

Retrieve the whether the source code is modified compared to the official build

Returns
const bool & isSourceModified

References mSourcesModified.

◆ mayBeUpdated()

bool CVersion::mayBeUpdated ( ) const

References mComment.

◆ operator!=()

bool CVersion::operator!= ( const CVersion other) const

◆ operator<()

bool CVersion::operator< ( const CVersion other) const

◆ operator<=()

bool CVersion::operator<= ( const CVersion other) const

◆ operator==()

bool CVersion::operator== ( const CVersion other) const

◆ operator>()

bool CVersion::operator> ( const CVersion other) const

◆ operator>=()

bool CVersion::operator>= ( const CVersion other) const

◆ setString()

void CVersion::setString ( )
private

Creates the version string.

References mBuild, mComment, mMajor, mMinor, mSourcesModified, mVersion, and StringPrint().

Referenced by CVersion(), and setVersion().

◆ setVersion() [1/2]

void CVersion::setVersion ( const C_INT32 major,
const C_INT32 minor,
const C_INT32 devel,
const bool &  sourcesModified,
const std::string &  comment = "",
const std::string &  creator = "" 
)

Sets a version number

Parameters
constC_INT32 & major
constC_INT32 & minor
constC_INT32 & build
constbool & sourcesModified
conststd::string & comment
conststd::string & creator

References mBuild, mComment, mCreator, mMajor, mMinor, mSourcesModified, and setString().

Referenced by COPASIHandler::processStart().

◆ setVersion() [2/2]

const CVersion & CVersion::setVersion ( const std::string &  version)

Set a version number

Parameters
conststd::string & version

References CVectorCore< CType >::array(), mBuild, mComment, mMajor, mMinor, mSourcesModified, setString(), and strToInt().

Member Data Documentation

◆ mBuild

C_INT32 CVersion::mBuild
private

The monotonously increasing build number

Referenced by CVersion(), getVersionDevel(), isCompatible(), operator<(), operator==(), operator>(), setString(), and setVersion().

◆ mComment

std::string CVersion::mComment
private

Comment appended to the version string

Referenced by mayBeUpdated(), setString(), and setVersion().

◆ mCompatible

std::set< C_INT32 > CVersion::mCompatible
private

The list of compatible builds

Referenced by CVersion(), and isCompatible().

◆ mCreator

std::string CVersion::mCreator
private

Creator who compiled this version for official unmodified sources it is copasi.org

Referenced by setVersion().

◆ mMajor

C_INT32 CVersion::mMajor
private

Major version number. (4 for first COPASI release)

Referenced by getVersionMajor(), isCompatible(), operator<(), operator==(), operator>(), setString(), and setVersion().

◆ mMinor

C_INT32 CVersion::mMinor
private

Minor version number. (changes with releases that are mostly bug fixes)

Referenced by getVersionMinor(), isCompatible(), operator<(), operator==(), operator>(), setString(), and setVersion().

◆ mSourcesModified

bool CVersion::mSourcesModified
private

Boolean value indicating whether mBuild is describing the current state of the sources.

Referenced by isSourceModified(), setString(), and setVersion().

◆ mVersion

std::string CVersion::mVersion
private

Version string.

Referenced by getVersion(), and setString().

◆ VERSION


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