COPASI API  4.16.103
Public Types | Public Member Functions | Protected Attributes | List of all members
SBMLIncompatibility Class Reference

#include <SBMLIncompatibility.h>

Collaboration diagram for SBMLIncompatibility:
Collaboration graph
[legend]

Public Types

enum  SEVERITY { UNDEFINED, WARNING, ERROR }
 

Public Member Functions

std::string getDetails () const
 
std::string getMessage () const
 
SEVERITY getSeverity () const
 
unsigned C_INT32 minSBMLLevel () const
 
unsigned C_INT32 minSBMLVersion () const
 
 SBMLIncompatibility (unsigned C_INT32,...)
 

Protected Attributes

std::string mDetails
 
std::string mMessage
 
unsigned C_INT32 mMinSBMLLevel
 
unsigned C_INT32 mMinSBMLVersion
 
unsigned C_INT32 mNumber
 
SEVERITY mSeverity
 

Detailed Description

Definition at line 24 of file SBMLIncompatibility.h.

Member Enumeration Documentation

Enumerator
UNDEFINED 
WARNING 
ERROR 

Definition at line 27 of file SBMLIncompatibility.h.

Constructor & Destructor Documentation

SBMLIncompatibility::SBMLIncompatibility ( unsigned C_INT32  n,
  ... 
)

Definition at line 28 of file SBMLIncompatibility.cpp.

References C_INT32, Incompatibilities, INITIALTEXTSIZE, mDetails, INCOMPATIBILITY::mDetails, mMessage, INCOMPATIBILITY::mMessage, mMinSBMLLevel, mMinSBMLVersion, INCOMPATIBILITY::mNo, mNumber, INCOMPATIBILITY::mSBMLLevel, INCOMPATIBILITY::mSBMLVersion, mSeverity, and INCOMPATIBILITY::mSeverity.

28  : mNumber(0), mMinSBMLLevel(0),
30 
31 {
32  const INCOMPATIBILITY* pTmp = &(Incompatibilities[0]);
33  while (pTmp->mNo != 9999)
34  {
35  if (pTmp->mNo == n)
36  {
37  break;
38  }
39  pTmp++;
40  }
41  mNumber = pTmp->mNo;
42  mMinSBMLLevel = pTmp->mSBMLLevel;
44  mSeverity = pTmp->mSeverity;
45  mDetails = pTmp->mDetails;
46  // now we have to create the message from the variable parameters
47  if (mNumber != 9999)
48  {
49  const char* fmt = pTmp->mMessage;
50 
51  C_INT32 TextSize = INITIALTEXTSIZE;
52  char *Text = new char[TextSize + 1];
53 
54  va_list args;
55  va_start(args, n);
56  C_INT32 Printed = vsnprintf(Text, TextSize, fmt, args);
57  va_end(args);
58 
59  while (Printed < 0 || TextSize < Printed)
60  {
61  delete [] Text;
62 
63  (Printed < 0) ? TextSize *= 2 : TextSize = Printed;
64  Text = new char[TextSize + 1];
65 
66  va_list args;
67  va_start(args, n);
68  Printed = vsnprintf(Text, TextSize, fmt, args);
69  va_end(args);
70  }
71 
72  mMessage = Text;
73  delete[] Text;
74  }
75 }
unsigned C_INT32 mSBMLLevel
unsigned C_INT32 mNumber
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 mSBMLVersion
const char * mMessage
unsigned C_INT32 mNo
#define INITIALTEXTSIZE
const INCOMPATIBILITY Incompatibilities[]
const char * mDetails
unsigned C_INT32 mMinSBMLVersion
unsigned C_INT32 mMinSBMLLevel
SBMLIncompatibility::SEVERITY mSeverity

Member Function Documentation

std::string SBMLIncompatibility::getDetails ( ) const

Definition at line 82 of file SBMLIncompatibility.cpp.

References mDetails.

Referenced by CSBMLExporter::outputIncompatibilities().

83  {
84  return mDetails;
85  }
std::string SBMLIncompatibility::getMessage ( ) const

Definition at line 77 of file SBMLIncompatibility.cpp.

References mMessage.

Referenced by CSBMLExporter::outputIncompatibilities().

78  {
79  return mMessage;
80  }
SBMLIncompatibility::SEVERITY SBMLIncompatibility::getSeverity ( ) const

Definition at line 87 of file SBMLIncompatibility.cpp.

References mSeverity.

88  {
89  return mSeverity;
90  }
unsigned C_INT32 SBMLIncompatibility::minSBMLLevel ( ) const

Definition at line 97 of file SBMLIncompatibility.cpp.

References mMinSBMLLevel.

Referenced by CSBMLExporter::outputIncompatibilities().

98  {
99  return mMinSBMLLevel;
100  }
unsigned C_INT32 mMinSBMLLevel
unsigned C_INT32 SBMLIncompatibility::minSBMLVersion ( ) const

Definition at line 92 of file SBMLIncompatibility.cpp.

References mMinSBMLVersion.

Referenced by CSBMLExporter::outputIncompatibilities().

93  {
94  return mMinSBMLVersion;
95  }
unsigned C_INT32 mMinSBMLVersion

Member Data Documentation

std::string SBMLIncompatibility::mDetails
protected

Definition at line 44 of file SBMLIncompatibility.h.

Referenced by getDetails(), and SBMLIncompatibility().

std::string SBMLIncompatibility::mMessage
protected

Definition at line 43 of file SBMLIncompatibility.h.

Referenced by getMessage(), and SBMLIncompatibility().

unsigned C_INT32 SBMLIncompatibility::mMinSBMLLevel
protected

Definition at line 40 of file SBMLIncompatibility.h.

Referenced by minSBMLLevel(), and SBMLIncompatibility().

unsigned C_INT32 SBMLIncompatibility::mMinSBMLVersion
protected

Definition at line 41 of file SBMLIncompatibility.h.

Referenced by minSBMLVersion(), and SBMLIncompatibility().

unsigned C_INT32 SBMLIncompatibility::mNumber
protected

Definition at line 36 of file SBMLIncompatibility.h.

Referenced by SBMLIncompatibility().

SEVERITY SBMLIncompatibility::mSeverity
protected

Definition at line 42 of file SBMLIncompatibility.h.

Referenced by getSeverity(), and SBMLIncompatibility().


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