|
std::string | name |
|
std::string | message |
|
bool | has_error |
|
bool | fail_fast |
|
bool | console_out |
|
int | local_purge_flag |
|
int | size |
|
|
static int | global_purge_flag = 0 |
|
static int | limit = 25 |
|
◆ ErrorLog()
larcfm::ErrorLog::ErrorLog |
( |
const std::string & |
name | ) |
|
|
explicit |
Construct a new ErrorLog object. Every message includes the name of this error log.
- Parameters
-
name | the name of this error log |
◆ addError()
void larcfm::ErrorLog::addError |
( |
const std::string & |
msg | ) |
|
Indicate that the given error has occurred.
- Parameters
-
◆ addReporter()
◆ addWarning()
void larcfm::ErrorLog::addWarning |
( |
const std::string & |
msg | ) |
|
Indicate that the given warning has occurred.
- Parameters
-
◆ getMessage()
string larcfm::ErrorLog::getMessage |
( |
| ) |
|
|
virtual |
Return a string representation of any errors or warnings. Calling this method will clear any messages and reset both the error and warning status to none.
- Returns
- error and warning messages. If there are no messages, an empty string is returned.
Implements larcfm::ErrorReporter.
◆ getMessageNoClear()
string larcfm::ErrorLog::getMessageNoClear |
( |
| ) |
const |
|
virtual |
Return a string representation of any errors or warnings. Calling this method will not clear the error or warning status (i.e., hasError() will return the same value before and after this call.)
- Returns
- error and warning messages. If there are no messages, an empty string is returned.
Implements larcfm::ErrorReporter.
◆ hasError()
bool larcfm::ErrorLog::hasError |
( |
| ) |
const |
|
virtual |
◆ hasMessage()
bool larcfm::ErrorLog::hasMessage |
( |
| ) |
const |
|
virtual |
Does this object have an error or a warning?
- Returns
- true if there is an error or warning.
Implements larcfm::ErrorReporter.
◆ isBetween()
bool larcfm::ErrorLog::isBetween |
( |
const std::string & |
method, |
|
|
double |
val, |
|
|
double |
lb, |
|
|
double |
ub |
|
) |
| |
Checks if a value is between lb and ub. Otherwise, adds an error message and returns false.
- Parameters
-
method | name of method |
val | value |
lb | lower bound |
ub | upper bound |
- Returns
- true, if value is between upper and lower bound
Checks if a value is between lb and ub. Otherwise, adds an error message and returns false.
◆ isLessThan()
bool larcfm::ErrorLog::isLessThan |
( |
const std::string & |
method, |
|
|
double |
val, |
|
|
double |
thr |
|
) |
| |
Checks if a value is less than value in internal units. Otherwise, adds an error message and returns false.
- Parameters
-
method | name of method |
val | value #1 |
thr | value #2 |
- Returns
- true, if value #1 is less than value #2
Checks if a value is less than value in internal units. Otherwise, adds an error message and returns false.
◆ isNonNegative()
bool larcfm::ErrorLog::isNonNegative |
( |
const std::string & |
method, |
|
|
double |
val |
|
) |
| |
Checks if a value is non negative and, in that case, returns true. Otherwise, adds an error message and returns false.
- Parameters
-
method | name of method |
val | value |
- Returns
- true, if value is non-negative
Checks if a value is non negative and, in that case, returns true. Otherwise, adds an error message and returns false.
◆ isNonPositive()
bool larcfm::ErrorLog::isNonPositive |
( |
const std::string & |
method, |
|
|
double |
val |
|
) |
| |
Checks if a value is non positive and, in that case, returns true. Otherwise, adds an error message and returns false.
- Parameters
-
method | name of method |
val | value |
- Returns
- true, if value is non-positive
Checks if a value is non positive and, in that case, returns true. Otherwise, adds an error message and returns false.
◆ isPositive()
bool larcfm::ErrorLog::isPositive |
( |
const std::string & |
method, |
|
|
double |
val |
|
) |
| |
Checks if a value is positive and, in that case, returns true. Otherwise, adds an error message and returns false.
- Parameters
-
method | name of method |
val | value |
- Returns
- true, if value is positive
Checks if a value is positive and, in that case, returns true. Otherwise, adds an error message and returns false.
◆ purge()
void larcfm::ErrorLog::purge |
( |
| ) |
|
|
static |
Set a flag that causes all instances to clear their message buffers prior to the next add operation (Note: Java also has an explicit copy constructor). Messages will be preserved if only getMessageNoClear() is called.
◆ setConsoleOutput()
void larcfm::ErrorLog::setConsoleOutput |
( |
bool |
console | ) |
|
If console output is set to true, then every error message and warning is output to the console.
- Parameters
-
console | true, if output should go to console. |
◆ setFailFast()
void larcfm::ErrorLog::setFailFast |
( |
bool |
ff | ) |
|
If fail fast is true, then when an error is added, the program will terminate.
- Parameters
-
ff | true indicates that the program should terminate when an error is added. |
◆ setSizeLimit()
void larcfm::ErrorLog::setSizeLimit |
( |
int |
sz | ) |
|
|
static |
Set this maximum number of messages that can be held in any given ErrorLog
- Parameters
-
sz | number of messages to store per log |
The documentation for this class was generated from the following files:
- Modules/ACCoRD/inc/ErrorLog.h
- Modules/ACCoRD/src/ErrorLog.cpp