ldas-tools-al 2.6.4
Public Member Functions | List of all members
LdasException Class Reference

LDAS Exception Class. More...

#include <ldasexception.hh>

Inheritance diagram for LdasException:
Inheritance graph
[legend]

Public Member Functions

 LdasException ()
 Default Constructor. More...
 
 LdasException (int library, int code, const std::string &1, const std::string &info="", const char *file=0, size_t line=0)
 Constructor. More...
 
 LdasException (const ErrorInfo &e)
 Constructor. More...
 
 LdasException (const LdasException &e)
 Copy Constructor. More...
 
virtual ~LdasException ()
 Destructor.
 
LdasExceptionoperator= (const LdasException &e)
 Assignment Operator. More...
 
bool operator== (const LdasException &e) const
 Equal Comparison. More...
 
bool operator!= (const LdasException &e) const
 Not-Equal Comparison. More...
 
const ErrorInfogetError (size_t i) const
 Get Error Info. More...
 
const ErrorInfooperator[] (size_t i) const
 Array Operator. More...
 
size_t getSize () const
 Get Size. More...
 
void addError (int library, int code, const std::string &1, const std::string &info="", const char *file=0, size_t line=0)
 Add Error. More...
 
void addError (const ErrorInfo &e)
 Add Error. More...
 

Detailed Description

LDAS Exception Class.

This class defines the types of exceptions thrown by the LDAS libraries. The class stores multiple instances of ErrorInfo objects, allowing an exception to be tracked as it is thrown and re-thrown in the code.

This class carries a lot of information with it, so it should only be used to report errors. Throwing this class should not be a normal part of the program flow.

Due to the overhead, this class is probably not very good for reporting memory allocation errors.

Constructor & Destructor Documentation

◆ LdasException() [1/4]

LdasException::LdasException ( )

Default Constructor.

Creates an exception with no error information.

◆ LdasException() [2/4]

LdasException::LdasException ( int  library,
int  code,
const std::string &  1,
const std::string &  info = "",
const char *  file = 0,
size_t  line = 0 
)
explicit

Constructor.

Parameters
library
code
msg
info
file
line

◆ LdasException() [3/4]

LdasException::LdasException ( const ErrorInfo e)

Constructor.

Creates an exception holding the passed ErrorInfo object.

Parameters
e

◆ LdasException() [4/4]

LdasException::LdasException ( const LdasException e)

Copy Constructor.

Parameters
e

Member Function Documentation

◆ addError() [1/2]

void LdasException::addError ( const ErrorInfo e)

Add Error.

Add another error info object to the class.

Parameters
e

◆ addError() [2/2]

void LdasException::addError ( int  library,
int  code,
const std::string &  1,
const std::string &  info = "",
const char *  file = 0,
size_t  line = 0 
)

Add Error.

Add another error info object to the class.

Parameters
library
code
msg
info
file
line

◆ getError()

const ErrorInfo & LdasException::getError ( size_t  i) const

Get Error Info.

Parameters
i
Returns
const ErrorInfo&

exc: range_error

◆ getSize()

size_t LdasException::getSize ( ) const
inline

Get Size.

Return the number of ErrorInfo objects contained in this object.

Returns
size_t

◆ operator!=()

bool LdasException::operator!= ( const LdasException e) const
inline

Not-Equal Comparison.

Parameters
e
Returns
bool

◆ operator=()

LdasException & LdasException::operator= ( const LdasException e)

Assignment Operator.

Parameters
e
Returns
LdasException&

◆ operator==()

bool LdasException::operator== ( const LdasException e) const
inline

Equal Comparison.

Parameters
e
Returns
bool

◆ operator[]()

const ErrorInfo & LdasException::operator[] ( size_t  i) const

Array Operator.

Parameters
i
Returns
const ErrorInfo&

exc: range_error


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