ANNA Suite  2020b
Multipurpose development suite for Telco applications
Classes | Public Member Functions | Protected Member Functions | List of all members
anna::Exception Class Reference

#include <Exception.hpp>

Inheritance diagram for anna::Exception:
Inheritance graph
[legend]
Collaboration diagram for anna::Exception:
Collaboration graph
[legend]

Classes

struct  Mode
 

Public Member Functions

 Exception (const char *text, const char *fromFile, const int fromLine)
 
 Exception (const Exception &other)
 
virtual ~Exception ()
 
const std::string & getText () const
 
const char * getFromFile () const
 
int getFromLine () const
 
void setErrorCode (const int errorCode)
 
int getErrorCode () const
 
Exceptionoperator= (const Exception &right)
 
std::string asString () const
 
const char * what () const noexcept
 
void trace () const
 

Protected Member Functions

 Exception (const char *text, const char *name, const char *fromFile, const int fromLine)
 
void setText (const char *text)
 
void setText (const std::string &text)
 

Detailed Description

Excepcion generica usada en las aplicaciones functions.

Constructor & Destructor Documentation

◆ Exception() [1/3]

anna::Exception::Exception ( const char *  text,
const char *  fromFile,
const int  fromLine 
)

Constructor.

Parameters
textTexto explicativo de la excepcion.
fromFileFichero en el que se provoco la situacion de error.
fromLineLinea del fichero en la que se detecto el error.

◆ Exception() [2/3]

anna::Exception::Exception ( const Exception other)

Constructor copia.

Parameters
otherInstancia de la una excepcion a partir de la que vamos a obtener los datos.

◆ ~Exception()

virtual anna::Exception::~Exception ( )
inlinevirtual

Destructor.

46 {;}

◆ Exception() [3/3]

anna::Exception::Exception ( const char *  text,
const char *  name,
const char *  fromFile,
const int  fromLine 
)
protected

Member Function Documentation

◆ asString()

std::string anna::Exception::asString ( ) const

Devuelve una cadena conteniendo toda la informacion referente a la excepcion en un formato que sea facil de interpretar.

Returns
Instancia de la cadena conteniendo la informacion de la excepcion.

◆ getErrorCode()

int anna::Exception::getErrorCode ( ) const
inline
Returns
El codigo de error asociado a esta excepcion.
77 { return m_errorCode; }
Here is the call graph for this function:

◆ getFromFile()

const char* anna::Exception::getFromFile ( ) const
inline
Returns
El nombre del fichero donde se genero la excepcion. Coincidira con el indicado en el constructor.
58 { return m_fromFile.c_str(); }

◆ getFromLine()

int anna::Exception::getFromLine ( ) const
inline
Returns
La linea del fichero donde se genero la excepcion. Coincidira con la indicada en el constructor.
64 { return m_fromLine; }

◆ getText()

const std::string& anna::Exception::getText ( ) const
inline
Returns
Devuelve el texto explicativo asociado a esta excepcion.
52 { return m_text;}

◆ operator=()

Exception& anna::Exception::operator= ( const Exception right)

Operador copia.

Parameters
rightInstancia de la excepcion de la que vamos a obtener los datos.
Returns
Referencia a esta instancia.

◆ setErrorCode()

void anna::Exception::setErrorCode ( const int  errorCode)
inline

Establecer un codigo de error asociado a esta excepcion.

Parameters
errorCodeValor a establecer. El significado de este error dependera de la interpretacion particular que queramos darle en nuestra aplicacion.
72 { m_errorCode = errorCode; }

◆ setText() [1/2]

void anna::Exception::setText ( const char *  text)
inlineprotected

Establece el texto asociado a esta excepcion.

Parameters
textNuevo texto asociado a esta excepcion.
124 { m_text = text; }

◆ setText() [2/2]

void anna::Exception::setText ( const std::string &  text)
inlineprotected

Establece el texto asociado a esta excepcion.

Parameters
textNuevo texto asociado a esta excepcion.
131 { m_text = text; }

◆ trace()

void anna::Exception::trace ( ) const

Saca una traza de error en el fichero de log con el texto asociado a este excepcion.

See also
asString
Logger::write

◆ what()

const char* anna::Exception::what ( ) const
inlinenoexcept

Devuelve una cadena conteniendo toda la informacion referente a la excepcion en un formato que sea facil de interpretar.

Sobreescribe el metodo de la clase base.

Returns
Puntero a la cadena conteniendo la informacion de la excepcion.
106 { return asString().c_str(); } // JASC, 23/9/2003 antes dAata() ( no tenia el trailing null )
std::string asString() const
Here is the call graph for this function:

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