COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
CarmaException Class Reference

Carma exception throw by libcarma. More...

#include <carma_exception.h>

Collaboration diagram for CarmaException:

Public Member Functions

 CarmaException (std::string reason, std::string file, unsigned int line)
 Constructor. More...
 
 ~CarmaException ()
 Destructor. More...
 
const char * show_reason () const
 Format into a const char *. More...
 
std::string show_reason_str () const
 Format into a string. More...
 

Detailed Description

Carma exception throw by libcarma.

Carma exception throw by libcarma

This class is used to throw a Carma exception (generally with libcarma)

Definition at line 59 of file carma_exception.h.

Constructor & Destructor Documentation

◆ CarmaException()

CarmaException::CarmaException ( std::string  reason,
std::string  file,
unsigned int  line 
)

Constructor.

CarmaException Constructor

Parameters
reason: a detailed description of the error
file: which file this exception has been created
line: which line this exception has been created

Definition at line 75 of file carma_exception.h.

76  : a_reason(reason), a_file(file), a_line(line) {}

◆ ~CarmaException()

CarmaException::~CarmaException ( )

Destructor.

CarmaException Destructor

Definition at line 84 of file carma_exception.h.

84 {}

Member Function Documentation

◆ show_reason()

const char* CarmaException::show_reason ( ) const

Format into a const char *.

Format the Carma exception into a const char *

Returns
Formated exception

Definition at line 94 of file carma_exception.h.

94  {
95  std::stringstream buf;
96  buf << a_reason << " in " << a_file << "@" << a_line << std::endl;
97  return buf.str().c_str();
98  }

◆ show_reason_str()

std::string CarmaException::show_reason_str ( ) const

Format into a string.

Format the Carma exception into a string

Returns
Formated exception

Definition at line 108 of file carma_exception.h.

108  {
109  std::stringstream buf;
110  buf << a_reason << " in " << a_file << "@" << a_line << std::endl;
111  return buf.str();
112  }

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