HermesCommon  3.0
Hermes::Exceptions::LengthException Class Reference

Parameter length parameter exception. Internal. Exception occurs when some parameter has wrong length. More...

#include <exceptions.h>

+ Inheritance diagram for Hermes::Exceptions::LengthException:

Public Member Functions

 LengthException ()
 Two parameters do not have equal length.
 
 LengthException (unsigned int wrong, unsigned int right)
 
 LengthException (unsigned int param_idx, unsigned int wrong, unsigned int right)
 
 LengthException (unsigned int fst_param_idx, unsigned int snd_param_idx, unsigned int first, unsigned int second)
 
unsigned int get_first_param_idx () const
 
unsigned int get_second_param_idx () const
 
unsigned int get_first_length () const
 
unsigned int get_expected_length () const
 
 LengthException (const LengthException &e)
 
- Public Member Functions inherited from Hermes::Exceptions::Exception
 Exception ()
 Init exception with default message.
 
 Exception (const Exception &e)
 
 Exception (const char *msg,...)
 
void print_msg () const
 print error message to stderr
 
virtual const char * what () const throw ()
 get pointer to error message
 
std::string info () const
 
const char * get_func_name () const
 

Additional Inherited Members

- Protected Attributes inherited from Hermes::Exceptions::Exception
std::stringstream message
 
char message_char [10000]
 To be compatible with what().
 

Detailed Description

Parameter length parameter exception. Internal. Exception occurs when some parameter has wrong length.

Definition at line 126 of file exceptions.h.

Constructor & Destructor Documentation

Hermes::Exceptions::LengthException::LengthException ( unsigned int  wrong,
unsigned int  right 
)

A parameter has wrong length - simple case.

Parameters
[in]wrongactual length of parameter.
[in]rightright length of parameter.

Definition at line 131 of file exceptions.cpp.

Hermes::Exceptions::LengthException::LengthException ( unsigned int  param_idx,
unsigned int  wrong,
unsigned int  right 
)

One parameter has wrong length.

Parameters
[in]paramnIdxindex wrong parameter.
[in]wrongactual length of parameter.
[in]rightright length of parameter.

Definition at line 139 of file exceptions.cpp.

Hermes::Exceptions::LengthException::LengthException ( unsigned int  fst_param_idx,
unsigned int  snd_param_idx,
unsigned int  first,
unsigned int  second 
)

Two parameters should have same length and they dont have.

Parameters
[in]fstParamnIdxindex first parameter.
[in]sndParamnIdxindex second parameter.
[in]firstactual length of first parameter.
[in]secondactual length of second parameter.

Definition at line 149 of file exceptions.cpp.

Member Function Documentation

unsigned int Hermes::Exceptions::LengthException::get_expected_length ( ) const
Returns
expected length of first parameter.

Definition at line 174 of file exceptions.cpp.

unsigned int Hermes::Exceptions::LengthException::get_first_length ( ) const
Returns
length of first parameter.

Definition at line 169 of file exceptions.cpp.

unsigned int Hermes::Exceptions::LengthException::get_first_param_idx ( ) const
Returns
index of first wrong parameter.

Definition at line 159 of file exceptions.cpp.

unsigned int Hermes::Exceptions::LengthException::get_second_param_idx ( ) const
Returns
index of second wrong parameter. Returns -1 when only one parameter is wrong.

Definition at line 164 of file exceptions.cpp.


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