\section{Basic\-Exception Class Reference}
\label{class_basic_exception}\index{BasicException@{BasicException}}
Basic\-Exception is a general purpose exception class.  


{\tt \#include $<$Basic\-Exception.h$>$}

Collaboration diagram for Basic\-Exception:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=66pt]{class_basic_exception__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Basic\-Exception} ()
\item 
{\bf Basic\-Exception} (const std::string {\bf message})
\item 
{\bf Basic\-Exception} (const std::string {\bf message}, const {\bf Basic\-File\-Location} \&{\bf location})
\item 
{\bf Basic\-Exception} (const std::string {\bf message}, {\bf Basic\-Exception} \&{\bf cause})
\item 
{\bf Basic\-Exception} (const std::string {\bf message}, const {\bf Basic\-File\-Location} \&{\bf location}, {\bf Basic\-Exception} \&{\bf cause})
\item 
{\bf Basic\-Exception} (const {\bf Basic\-Exception} \&e)
\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
virtual {\bf $\sim$Basic\-Exception} ()
\item 
const std::string {\bf get\-Message} () const
\item 
{\bf Basic\-File\-Location} {\bf get\-Location} () const
\item 
Basic\-Smart\-Pointer$<$ {\bf Basic\-Exception} $>$ {\bf get\-Cause} () const
\item 
Basic\-Smart\-Pointer$<$ std::list$<$ std::string $>$ $>$ {\bf get\-Trace} () const
\item 
std::ostream \& {\bf print} (std::ostream \&stream, bool print\-Locations=true, unsigned int print\-Level=0) const
\begin{CompactList}\small\item\em Prints the complete exception recuring down to the cause exception if not null. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Attributes}
\begin{CompactItemize}
\item 
unsigned int {\bf cause\-Print\-Level} = 10
\item 
bool {\bf enable\-Stack\-Traces} = false
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} ()
\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
std::string {\bf message}
\item 
{\bf Basic\-File\-Location} {\bf location}
\item 
Basic\-Smart\-Pointer$<$ {\bf Basic\-Exception} $>$ {\bf cause}
\item 
Basic\-Smart\-Pointer$<$ std::list$<$ std::string $>$ $>$ {\bf trace}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
std::ostream \& {\bf operator$<$$<$} (std::ostream \&, const {\bf Basic\-Exception} \&)
\begin{CompactList}\small\item\em An stream output operator for Basic\-Exception. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Basic\-Exception is a general purpose exception class. 

It is similar to the java Exception class. A Basic\-Exception can carry a message, a {\bf Basic\-File\-Location}{\rm (p.\,\pageref{class_basic_file_location})} and/or a pointer to an exception which was the original cause.

There are preprocessor macros that can be used to as a convient way to add the current file, line and column where the exception occured. These are:

{\bf THROW(const string message)}{\rm (p.\,\pageref{_basic_exception_8h_a0})}

and

{\bf ASSERT\_\-OR\_\-THROW(const string message, const bool condition)}{\rm (p.\,\pageref{_basic_exception_8h_a2})}

The latter can be used to in place of assert(const bool condition). Throwing an exception instead of aborting overcomes some of the limitations of the standard assert. 



\subsection{Constructor \& Destructor Documentation}
\index{BasicException@{Basic\-Exception}!BasicException@{BasicException}}
\index{BasicException@{BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Exception::Basic\-Exception ()\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a0}


\index{BasicException@{Basic\-Exception}!BasicException@{BasicException}}
\index{BasicException@{BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Exception::Basic\-Exception (const std::string {\em message})\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a1}


\index{BasicException@{Basic\-Exception}!BasicException@{BasicException}}
\index{BasicException@{BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Exception::Basic\-Exception (const std::string {\em message}, const {\bf Basic\-File\-Location} \& {\em location})\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a2}


\index{BasicException@{Basic\-Exception}!BasicException@{BasicException}}
\index{BasicException@{BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Exception::Basic\-Exception (const std::string {\em message}, {\bf Basic\-Exception} \& {\em cause})\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a3}


\index{BasicException@{Basic\-Exception}!BasicException@{BasicException}}
\index{BasicException@{BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Exception::Basic\-Exception (const std::string {\em message}, const {\bf Basic\-File\-Location} \& {\em location}, {\bf Basic\-Exception} \& {\em cause})\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a4}


\index{BasicException@{Basic\-Exception}!BasicException@{BasicException}}
\index{BasicException@{BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Exception::Basic\-Exception (const {\bf Basic\-Exception} \& {\em e})\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a5}


Copy constructor. 

\index{BasicException@{Basic\-Exception}!~BasicException@{$\sim$BasicException}}
\index{~BasicException@{$\sim$BasicException}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Basic\-Exception::$\sim${\bf Basic\-Exception} ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{class_basic_exception_a6}




\subsection{Member Function Documentation}
\index{BasicException@{Basic\-Exception}!getCause@{getCause}}
\index{getCause@{getCause}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Smart\-Pointer$<${\bf Basic\-Exception}$>$ Basic\-Exception::get\-Cause () const\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a9}


\begin{Desc}
\item[Returns:]A Basic\-Smart\-Pointer to the Basic\-Exception that caused this exception or NULL. \end{Desc}
\index{BasicException@{Basic\-Exception}!getLocation@{getLocation}}
\index{getLocation@{getLocation}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Basic\-File\-Location} Basic\-Exception::get\-Location () const\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a8}


\index{BasicException@{Basic\-Exception}!getMessage@{getMessage}}
\index{getMessage@{getMessage}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const std::string Basic\-Exception::get\-Message () const\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a7}


\index{BasicException@{Basic\-Exception}!getTrace@{getTrace}}
\index{getTrace@{getTrace}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Smart\-Pointer$<$std::list$<$std::string$>$ $>$ Basic\-Exception::get\-Trace () const\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a10}


\index{BasicException@{Basic\-Exception}!init@{init}}
\index{init@{init}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Basic\-Exception::init ()\hspace{0.3cm}{\tt  [inline, protected]}}\label{class_basic_exception_b0}


\index{BasicException@{Basic\-Exception}!print@{print}}
\index{print@{print}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}std::ostream\& Basic\-Exception::print (std::ostream \& {\em stream}, bool {\em print\-Locations} = {\tt true}, unsigned int {\em print\-Level} = {\tt 0}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_basic_exception_a11}


Prints the complete exception recuring down to the cause exception if not null. 

WARNING: If there are many layers of causes this function could print a very large amount of data. This can be limited by setting the cause\-Print\-Level variable.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em stream}]The output stream. \item[{\em print\-Locations}]Print file locations. \item[{\em print\-Level}]The current cause print level.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A reference to the passed stream. \end{Desc}


\subsection{Friends And Related Function Documentation}
\index{BasicException@{Basic\-Exception}!operator<<@{operator$<$$<$}}
\index{operator<<@{operator$<$$<$}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}std::ostream\& operator$<$$<$ (std::ostream \& {\em stream}, const {\bf Basic\-Exception} \& {\em e})\hspace{0.3cm}{\tt  [friend]}}\label{class_basic_exception_n0}


An stream output operator for Basic\-Exception. 

This allows you to print the text of an exception to a stream like so:

. . . \} catch (Basic\-Exception \&e) \{ cout $<$$<$ e $<$$<$ endl; return 0; \} 

\subsection{Member Data Documentation}
\index{BasicException@{Basic\-Exception}!cause@{cause}}
\index{cause@{cause}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Smart\-Pointer$<${\bf Basic\-Exception}$>$ {\bf Basic\-Exception::cause}\hspace{0.3cm}{\tt  [private]}}\label{class_basic_exception_r2}


\index{BasicException@{Basic\-Exception}!causePrintLevel@{causePrintLevel}}
\index{causePrintLevel@{causePrintLevel}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int {\bf Basic\-Exception::cause\-Print\-Level} = 10\hspace{0.3cm}{\tt  [static]}}\label{class_basic_exception_s0}


\index{BasicException@{Basic\-Exception}!enableStackTraces@{enableStackTraces}}
\index{enableStackTraces@{enableStackTraces}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf Basic\-Exception::enable\-Stack\-Traces} = false\hspace{0.3cm}{\tt  [static]}}\label{class_basic_exception_s1}


\index{BasicException@{Basic\-Exception}!location@{location}}
\index{location@{location}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Basic\-File\-Location} {\bf Basic\-Exception::location}\hspace{0.3cm}{\tt  [private]}}\label{class_basic_exception_r1}


\index{BasicException@{Basic\-Exception}!message@{message}}
\index{message@{message}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}std::string {\bf Basic\-Exception::message}\hspace{0.3cm}{\tt  [private]}}\label{class_basic_exception_r0}


\index{BasicException@{Basic\-Exception}!trace@{trace}}
\index{trace@{trace}!BasicException@{Basic\-Exception}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Basic\-Smart\-Pointer$<$std::list$<$std::string$>$ $>$ {\bf Basic\-Exception::trace}\hspace{0.3cm}{\tt  [private]}}\label{class_basic_exception_r3}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
{\bf Basic\-Exception.h}\item 
{\bf Basic\-Exception.cpp}\end{CompactItemize}
