COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
Cxerrwd Class Reference

#include <Cxerrwd.h>

Collaboration diagram for Cxerrwd:
Collaboration graph
[legend]

Public Member Functions

 Cxerrwd (const bool &print)
 
void enablePrint (const bool &print=true)
 
void operator() (const std::string &msg, const C_INT *nmes, const C_INT *nerr, const C_INT *level, const C_INT *ni, const C_INT *i1, const C_INT *i2, const C_INT *nr, const double *r1, const double *r2, C_INT msg_len)
 
void setOstream (std::ostream &os)
 
 ~Cxerrwd ()
 

Private Attributes

std::ostream * mpOstream
 
bool mPrint
 

Detailed Description

Definition at line 27 of file Cxerrwd.h.

Constructor & Destructor Documentation

Cxerrwd::Cxerrwd ( const bool &  print)

Definition at line 25 of file Cxerrwd.cpp.

25  :
26  mPrint(print),
27  mpOstream(NULL)
28 {}
std::ostream * mpOstream
Definition: Cxerrwd.h:43
bool mPrint
Definition: Cxerrwd.h:42
Cxerrwd::~Cxerrwd ( )

Definition at line 30 of file Cxerrwd.cpp.

30 {}

Member Function Documentation

void Cxerrwd::enablePrint ( const bool &  print = true)

Definition at line 35 of file Cxerrwd.cpp.

References mPrint.

Referenced by CInternalSolver::enablePrint().

36 {mPrint = print;}
bool mPrint
Definition: Cxerrwd.h:42
void Cxerrwd::operator() ( const std::string &  msg,
const C_INT nmes,
const C_INT nerr,
const C_INT level,
const C_INT ni,
const C_INT i1,
const C_INT i2,
const C_INT nr,
const double *  r1,
const double *  r2,
C_INT  msg_len 
)

Definition at line 38 of file Cxerrwd.cpp.

References mpOstream, and mPrint.

41 {
42  /* ***BEGIN PROLOGUE XERRWD */
43  /* ***SUBSIDIARY */
44  /* ***PURPOSE Write error message with values. */
45  /* ***CATEGORY R3C */
46  /* ***TYPE DOUBLE PRECISION (XERRWV-S, XERRWD-D) */
47  /* ***AUTHOR Hindmarsh, Alan C., (LLNL) */
48  /* ***DESCRIPTION */
49 
50  /* Subroutines XERRWD, XSETF, XSETUN, and the function routine IXSAV, */
51  /* as given here, constitute a simplified version of the SLATEC error */
52  /* handling package. */
53 
54  /* All arguments are input arguments. */
55 
56  /* MSG = The message (character array). */
57  /* NMES = The length of MSG (number of characters). */
58  /* NERR = The error number (not used). */
59  /* LEVEL = The error level.. */
60  /* 0 or 1 means recoverable (control returns to caller). */
61  /* 2 means fatal (run is aborted--see note below). */
62  /* NI = Number of integers (0, 1, or 2) to be printed with message. */
63  /* I1,I2 = Integers to be printed, depending on NI. */
64  /* NR = Number of reals (0, 1, or 2) to be printed with message. */
65  /* R1,R2 = Reals to be printed, depending on NR. */
66 
67  /* Note.. this routine is machine-dependent and specialized for use */
68  /* in limited context, in the following ways.. */
69  /* 1. The argument MSG is assumed to be of type CHARACTER, and */
70  /* the message is printed with a format of (1X,A). */
71  /* 2. The message is assumed to take only one line. */
72  /* Multi-line messages are generated by repeated calls. */
73  /* 3. If LEVEL = 2, control passes to the statement STOP */
74  /* to abort the run. This statement may be machine-dependent. */
75  /* 4. R1 and R2 are assumed to be in double precision and are printed */
76  /* in D21.13 format. */
77 
78  /* ***ROUTINES CALLED IXSAV */
79  /* ***REVISION HISTORY (YYMMDD) */
80  /* 920831 DATE WRITTEN */
81  /* 921118 Replaced MFLGSV/LUNSAV by IXSAV. (ACH) */
82  /* 930329 Modified prologue to SLATEC format. (FNF) */
83  /* 930407 Changed MSG from CHARACTER*1 array to variable. (FNF) */
84  /* 930922 Minor cosmetic change. (FNF) */
85  /* ***END PROLOGUE XERRWD */
86 
87  /* *Internal Notes: */
88 
89  /* For a different default logical unit number, IXSAV (or a subsidiary */
90  /* routine that it calls) will need to be modified. */
91  /* For a different run-abort command, change the statement following */
92  /* statement 100 at the end. */
93  /* ----------------------------------------------------------------------- */
94  /* Subroutines called by XERRWD.. None */
95  /* Function routine called by XERRWD.. IXSAV */
96  /* ----------------------------------------------------------------------- */
97  /* **End */
98 
99  /* Declare arguments. */
100 
101  /* Declare local variables. */
102 
103  /* Get logical unit number and message print flag. */
104 
105  /* ***FIRST EXECUTABLE STATEMENT XERRWD */
106  if (!mPrint && !mpOstream)
107  {
108  goto L100;
109  }
110 
111  /* Write the message. */
112 
113  *mpOstream << msg << std::endl;
114 
115  if (*ni == 1)
116  {
117  *mpOstream << "\tIn above message, I1 = '" << *i1 << "'\n";
118  }
119  if (*ni == 2)
120  {
121  *mpOstream << "\tIn above message, I1 = '" << *i1
122  << "', I2 = '" << *i2 << "'\n";
123  }
124  if (*nr == 1)
125  {
126  *mpOstream << "\tIn above message, R1 = '" << *r1 << "'\n";
127  }
128  if (*nr == 2)
129  {
130  *mpOstream << "\tIn above message, R1 = '" << *r1
131  << "', R2 = '" << *r2 << "'\n";
132  }
133 
134  /* Abort the run if LEVEL = 2. */
135  if (*level == 2)
136  {
137  // :TODO: We need to abort here
138  }
139 
140 L100:
141 
142  /* ----------------------- End of Subroutine XERRWD ---------------------- */
143  return;
144 } /* xerrwd_ */
std::ostream * mpOstream
Definition: Cxerrwd.h:43
bool mPrint
Definition: Cxerrwd.h:42
void Cxerrwd::setOstream ( std::ostream &  os)

Definition at line 32 of file Cxerrwd.cpp.

References mpOstream.

Referenced by CInternalSolver::setOstream().

33 {mpOstream = &os;}
std::ostream * mpOstream
Definition: Cxerrwd.h:43

Member Data Documentation

std::ostream* Cxerrwd::mpOstream
private

Definition at line 43 of file Cxerrwd.h.

Referenced by operator()(), and setOstream().

bool Cxerrwd::mPrint
private

Definition at line 42 of file Cxerrwd.h.

Referenced by enablePrint(), and operator()().


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