libStatGen Software 1
GlfException Class Reference

GlfException objects should be thrown by functions that operate on Glf files for exceptions. More...

#include <GlfException.h>

Inheritance diagram for GlfException:
Collaboration diagram for GlfException:

Public Member Functions

 GlfException ()
 Constructor that sets the exception to a default status and error message. More...
 
 GlfException (const std::string &what_arg)
 Constructor that sets the exception to a default status and the specified error message. More...
 
 GlfException (GlfStatus::Status status, const std::string &errorMsg)
 Constructor that sets the exception to the specified status and error message. More...
 
 GlfException (const GlfStatus &status)
 Constructor that sets the exception to the specified status. More...
 
virtual const char * what () const throw ()
 Returns the error message of this exception. More...
 

Detailed Description

GlfException objects should be thrown by functions that operate on Glf files for exceptions.

Definition at line 27 of file GlfException.h.

Constructor & Destructor Documentation

◆ GlfException() [1/4]

GlfException::GlfException ( )

Constructor that sets the exception to a default status and error message.

Definition at line 20 of file GlfException.cpp.

21 : myStatus()
22{
23 myStatus.setStatus(GlfStatus::UNKNOWN, "Failed operating on a GLF.");
24}
void setStatus(Status newStatus, const char *newMessage)
Set the status with the specified values.
Definition: GlfStatus.cpp:74
@ UNKNOWN
unknown result (default value should never be used)
Definition: GlfStatus.h:33

References GlfStatus::setStatus(), and GlfStatus::UNKNOWN.

◆ GlfException() [2/4]

GlfException::GlfException ( const std::string &  what_arg)

Constructor that sets the exception to a default status and the specified error message.

Parameters
what_argerror message associated with this exception.

Definition at line 27 of file GlfException.cpp.

28 : myStatus()
29{
30 myStatus.setStatus(GlfStatus::UNKNOWN, errorMsg.c_str());
31}

References GlfStatus::setStatus(), and GlfStatus::UNKNOWN.

◆ GlfException() [3/4]

GlfException::GlfException ( GlfStatus::Status  status,
const std::string &  errorMsg 
)

Constructor that sets the exception to the specified status and error message.

Parameters
statusglf status associated with this exception.
errorMsgerror message associated with this exception.

Definition at line 33 of file GlfException.cpp.

35 : myStatus()
36{
37 myStatus.setStatus(status, errorMsg.c_str());
38}

References GlfStatus::setStatus().

◆ GlfException() [4/4]

GlfException::GlfException ( const GlfStatus status)

Constructor that sets the exception to the specified status.

Parameters
statusglf status associated with this exception.

Definition at line 40 of file GlfException.cpp.

41 : myStatus()
42{
43 myStatus.addError(status);
44}
void addError(Status newStatus, const char *newMessage)
Adds the specified error message to the status message, setting the status to newStatus if the curren...
Definition: GlfStatus.cpp:85

References GlfStatus::addError().

◆ ~GlfException()

GlfException::~GlfException ( )
throw (
)
virtual

Definition at line 46 of file GlfException.cpp.

47{
48}

Member Function Documentation

◆ what()

const char * GlfException::what ( ) const
throw (
)
virtual

Returns the error message of this exception.

Returns
errror message

Definition at line 50 of file GlfException.cpp.

51{
52 return(myStatus.getStatusMessage());
53}
const char * getStatusMessage() const
Return the status message.
Definition: GlfStatus.cpp:125

References GlfStatus::getStatusMessage().


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