- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# CoinError Class Reference

Error Class thrown by an exception. More...

`#include <CoinError.hpp>`

Collaboration diagram for CoinError:

[legend]
List of all members.

## Public Member Functions
Get error attributes
const std::string & | message () const
| get message text
const std::string & | methodName () const
| get name of method instantiating error
const std::string & | className () const
| get name of class instantiating error (or hint for assert)
const std::string & | fileName () const
| get name of file for assert
int | lineNumber () const
| get line number of assert (-1 if not assert)
void | print (bool doPrint=true) const
| Just print (for asserts).
Constructors and destructors
| CoinError (std::string message, std::string methodName, std::string className, std::string fileName=std::string(), int line=-1)
| Alternate Constructor.
| CoinError (const CoinError &source)
| Copy constructor.
CoinError & | operator= (const CoinError &rhs)
| Assignment operator.
virtual | ~CoinError ()
| Destructor.
## Static Public Attributes
static bool | printErrors_
| Whether to print every error.
## Private Member Functions
| CoinError ()
## Private Attributes
Private member data
std::string | message_
| message test
std::string | method_
| method name
std::string | class_
| class name or hint
std::string | file_
| file name
int | lineNumber_
| Line number.
## Friends
void | CoinErrorUnitTest ()
| A function that tests the methods in the CoinError class.

## Detailed Description

Error Class thrown by an exception.

This class is used when exceptions are thrown. It contains:

- message text
- name of method throwing exception
- name of class throwing exception or hint
- name of file if assert
- line number

For asserts class=> optional hint

Definition at line 34 of file CoinError.hpp.

## Constructor & Destructor Documentation

CoinError::CoinError | ( |  | ) | `[inline, private]`

Definition at line 38 of file CoinError.hpp.

CoinError::CoinError | ( | std::string | message,
|  | std::string | methodName,
|  | std::string | className,
|  | std::string | fileName = `std::string()`,
|  | int | line = `-1` |
| ) |  |  | `[inline]`

Alternate Constructor.

Definition at line 91 of file CoinError.hpp.

References print(), and printErrors_.

CoinError::CoinError | ( | const CoinError & | source | ) | `[inline]`

Copy constructor.

Definition at line 108 of file CoinError.hpp.

virtual CoinError::~CoinError | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 133 of file CoinError.hpp.

## Member Function Documentation

const std::string& CoinError::message | ( |  | ) | const`[inline]`

get message text

Definition at line 57 of file CoinError.hpp.

References message_.

const std::string& CoinError::methodName | ( |  | ) | const`[inline]`

get name of method instantiating error

Definition at line 60 of file CoinError.hpp.

References method_.

const std::string& CoinError::className | ( |  | ) | const`[inline]`

get name of class instantiating error (or hint for assert)

Definition at line 63 of file CoinError.hpp.

References class_.

const std::string& CoinError::fileName | ( |  | ) | const`[inline]`

get name of file for assert

Definition at line 66 of file CoinError.hpp.

References file_.

int CoinError::lineNumber | ( |  | ) | const`[inline]`

get line number of assert (-1 if not assert)

Definition at line 69 of file CoinError.hpp.

References lineNumber_.

void CoinError::print | ( | bool | doPrint = `true` | ) | const`[inline]`

Just print (for asserts).

Definition at line 72 of file CoinError.hpp.

References class_, file_, lineNumber_, message_, and method_.

Referenced by CoinError().

CoinError& CoinError::operator= | ( | const CoinError & | rhs | ) | `[inline]`

Assignment operator.

Definition at line 120 of file CoinError.hpp.

References class_, file_, lineNumber_, message_, and method_.

## Friends And Related Function Documentation

void CoinErrorUnitTest | ( |  | ) | `[friend]`

A function that tests the methods in the CoinError class.

The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.

## Member Data Documentation

std::string CoinError::message_`[private]`

message test

Definition at line 144 of file CoinError.hpp.

Referenced by message(), operator=(), and print().

std::string CoinError::method_`[private]`

method name

Definition at line 146 of file CoinError.hpp.

Referenced by methodName(), operator=(), and print().

std::string CoinError::class_`[private]`

class name or hint

Definition at line 148 of file CoinError.hpp.

Referenced by className(), operator=(), and print().

std::string CoinError::file_`[private]`

file name

Definition at line 150 of file CoinError.hpp.

Referenced by fileName(), operator=(), and print().

int CoinError::lineNumber_`[private]`

Line number.

Definition at line 152 of file CoinError.hpp.

Referenced by lineNumber(), operator=(), and print().

bool CoinError::printErrors_`[static]`

Whether to print every error.

Definition at line 157 of file CoinError.hpp.

Referenced by CoinError().

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

- /home/coin/SVN-release/Osi-0.98.1/CoinUtils/src/CoinError.hpp