dynamicgraph::ExceptionAbstract Class Reference

Abstract root class for all dynamic-graph exceptions. More...

#include <dynamic-graph/exception-abstract.h>

Inheritance diagram for dynamicgraph::ExceptionAbstract:
[legend]
Collaboration diagram for dynamicgraph::ExceptionAbstract:
[legend]

Classes

class  Param
 Class owned by exceptions to store error locations. More...
 

Public Types

enum  ExceptionEnum {
  ABSTRACT = 0,
  SIGNAL = 100,
  FACTORY = 200,
  TRACES = 300,
  TOOLS = 700
}
 Categories error code. More...
 

Public Member Functions

 ExceptionAbstract (const int &code, const std::string &msg="")
 
virtual ~ExceptionAbstract () throw ()
 
virtual const std::string & getExceptionName () const
 
int getCode () const
 Access to the error code. More...
 
const std::string & getStringMessage () const
 Reference access to the error message (can be empty). More...
 
const char * getMessage () const
 Access to the pointer on the array of char related to the error string. More...
 
virtual const char * what () const throw ()
 

Static Public Attributes

static const std::string EXCEPTION_NAME
 

Protected Attributes

int code
 Error code. More...
 
std::string message
 Error message (can be empty). More...
 

Friends

DYNAMIC_GRAPH_DLLAPI friend std::ostream & operator<< (std::ostream &os, const ExceptionAbstract &err)
 Print the error structure. More...
 

Detailed Description

Abstract root class for all dynamic-graph exceptions.

Member Enumeration Documentation

◆ ExceptionEnum

Categories error code.

Each value matches categories used by a subclass of ExceptionAbstract.

This is the programmer responsibility to make sure there is enough room between two categories error code.

Enumerator
ABSTRACT 
SIGNAL 
FACTORY 
TRACES 
TOOLS 

Constructor & Destructor Documentation

◆ ExceptionAbstract()

dynamicgraph::ExceptionAbstract::ExceptionAbstract ( const int &  code,
const std::string &  msg = "" 
)
explicit

◆ ~ExceptionAbstract()

virtual dynamicgraph::ExceptionAbstract::~ExceptionAbstract ( )
throw (
)
inlinevirtual

Member Function Documentation

◆ getCode()

int dynamicgraph::ExceptionAbstract::getCode ( ) const

Access to the error code.

◆ getExceptionName()

virtual const std::string& dynamicgraph::ExceptionAbstract::getExceptionName ( ) const
inlinevirtual

◆ getMessage()

const char* dynamicgraph::ExceptionAbstract::getMessage ( ) const

Access to the pointer on the array of char related to the error string.

Cannot be NULL.

◆ getStringMessage()

const std::string& dynamicgraph::ExceptionAbstract::getStringMessage ( ) const

Reference access to the error message (can be empty).

◆ what()

virtual const char* dynamicgraph::ExceptionAbstract::what ( ) const
throw (
)
inlinevirtual

Friends And Related Function Documentation

◆ operator<<

DYNAMIC_GRAPH_DLLAPI friend std::ostream& operator<< ( std::ostream &  os,
const ExceptionAbstract err 
)
friend

Print the error structure.

Member Data Documentation

◆ code

int dynamicgraph::ExceptionAbstract::code
protected

Error code.

See also
ErrorCodeEnum

◆ EXCEPTION_NAME

const std::string dynamicgraph::ExceptionAbstract::EXCEPTION_NAME
static

◆ message

std::string dynamicgraph::ExceptionAbstract::message
protected

Error message (can be empty).