ldas-tools-al  2.6.4
Public Member Functions | Private Attributes | 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. More...
 
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...
 
 LdasException ()
 
 LdasException (int library, int code, const std::string &1, const std::string &info="", const char *file=0, size_t line=0)
 
 LdasException (const ErrorInfo &e)
 
 LdasException (const LdasException &e)
 
virtual ~LdasException ()
 
LdasExceptionoperator= (const LdasException &e)
 
bool operator== (const LdasException &e) const
 
bool operator!= (const LdasException &e) const
 
const ErrorInfogetError (size_t i) const
 
const ErrorInfooperator[] (size_t i) const
 
size_t getSize () const
 
void addError (int library, int code, const std::string &1, const std::string &info="", const char *file=0, size_t line=0)
 
void addError (const ErrorInfo &e)
 

Private Attributes

std::vector< ErrorInfomErrors
 

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/8]

LdasException::LdasException ( )

Default Constructor.

Creates an exception with no error information.

◆ LdasException() [2/8]

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/8]

LdasException::LdasException ( const ErrorInfo e)

Constructor.

Creates an exception holding the passed ErrorInfo object.

Parameters
e

◆ LdasException() [4/8]

LdasException::LdasException ( const LdasException e)

Copy Constructor.

Parameters
e

◆ ~LdasException() [1/2]

LdasException::~LdasException ( )
virtual

Destructor.

◆ LdasException() [5/8]

LdasException::LdasException ( )

◆ LdasException() [6/8]

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

◆ LdasException() [7/8]

LdasException::LdasException ( const ErrorInfo e)

◆ LdasException() [8/8]

LdasException::LdasException ( const LdasException e)

◆ ~LdasException() [2/2]

virtual LdasException::~LdasException ( )
virtual

Member Function Documentation

◆ addError() [1/4]

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

◆ addError() [2/4]

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

◆ addError() [3/4]

void LdasException::addError ( const ErrorInfo e)

Add Error.

Add another error info object to the class.

Parameters
e

◆ addError() [4/4]

void LdasException::addError ( const ErrorInfo e)

◆ getError() [1/2]

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

◆ getError() [2/2]

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

Get Error Info.

Parameters
i
Returns
const ErrorInfo&

exc: range_error

◆ getSize() [1/2]

size_t LdasException::getSize ( ) const

◆ getSize() [2/2]

size_t LdasException::getSize ( ) const
inline

Get Size.

Return the number of ErrorInfo objects contained in this object.

Returns
size_t

◆ operator!=() [1/2]

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

Not-Equal Comparison.

Parameters
e
Returns
bool

◆ operator!=() [2/2]

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Assignment Operator.

Parameters
e
Returns
LdasException&

◆ operator==() [1/2]

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

◆ operator==() [2/2]

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

Equal Comparison.

Parameters
e
Returns
bool

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

Array Operator.

Parameters
i
Returns
const ErrorInfo&

exc: range_error

Member Data Documentation

◆ mErrors

std::vector< ErrorInfo > LdasException::mErrors
private

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