35 #include<boost/current_function.hpp>
37 #include "../types/types.hpp"
48 #define EXCEPTION_RECORD\
49 exception_record(__FILE__,__LINE__,BOOST_CURRENT_FUNCTION)
65 #define EXCEPTION_FORWARD(ETYPE)\
70 error.append(EXCEPTION_RECORD);\
89 class exception_record
122 std::ostream &
operator<<(std::ostream &o,
const exception_record &rec);
149 std::ostream &
print(std::ostream &o)
const;
256 const_iterator
begin()
const {
return _records.begin(); }
267 const_iterator
end()
const {
return _records.end(); }
300 exception(
"memory_allocation_eror", i, d)
309 friend std::ostream &
339 exception(
"memory_not_allocated_error",i,d)
348 friend std::ostream &
operator<<(std::ostream &o,
const
387 friend std::ostream &
425 friend std::ostream &
462 friend std::ostream &
497 friend std::ostream &
532 friend std::ostream &
568 friend std::ostream &
604 friend std::ostream &
640 friend std::ostream &
680 friend std::ostream &
717 friend std::ostream &
754 friend std::ostream &
789 friend std::ostream &
860 friend std::ostream &
~type_error()
destructor
Definition: exceptions.hpp:564
data range error
Definition: exceptions.hpp:616
iterator_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:707
friend std::ostream & operator<<(std::ostream &o, const shape_mismatch_error &e)
output operator
value_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:594
Size mismatch error.
Definition: exceptions.hpp:399
~memory_allocation_error()
destructor
Definition: exceptions.hpp:305
~iterator_error()
destructor
Definition: exceptions.hpp:713
exception record
Definition: exceptions.hpp:90
std::ostream & print(std::ostream &o) const
ouptut method
void append(const exception_record &n)
add a new issuer
Definition: exceptions.hpp:228
file_error()
default constructor
Definition: exceptions.hpp:512
help request
Definition: exceptions.hpp:836
range_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:630
~index_error()
destructor
Definition: exceptions.hpp:458
data value error
Definition: exceptions.hpp:580
friend std::ostream & operator<<(std::ostream &o, const size_mismatch_error &e)
output operator
size_mismatch_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:414
friend std::ostream & operator<<(std::ostream &o, const cli_help_request &e)
output operator
data type error
Definition: exceptions.hpp:544
friend std::ostream & operator<<(std::ostream &o, const file_error &e)
output operator
friend std::ostream & operator<<(std::ostream &o, const memory_not_allocated_error &e)
output operator
Shape mismatch error.
Definition: exceptions.hpp:360
friend std::ostream & operator<<(std::ostream &o, const iterator_error &e)
output operator
cli_option_error(const exception_record &r, const string &d)
constructor
Definition: exceptions.hpp:780
type_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:558
std::list< exception_record > _records
exception records
Definition: exceptions.hpp:139
memory allocation error
Definition: exceptions.hpp:284
~file_error()
destructor
Definition: exceptions.hpp:528
size_t line() const
get file line number
Definition: exceptions.hpp:112
~value_error()
destructor
Definition: exceptions.hpp:600
~not_implemented_error()
destructor
Definition: exceptions.hpp:676
friend std::ostream & operator<<(std::ostream &o, const value_error &e)
output operator
const_iterator end() const
get iterator to the last error record
Definition: exceptions.hpp:267
general CLI error
Definition: exceptions.hpp:801
exception_record(const string &file, size_t line, const string &func)
constructor
Definition: exceptions.hpp:102
cli_error(const exception_record &r, const string &d)
constructor
Definition: exceptions.hpp:815
exception_record()=delete
no default constructor
const string & description() const
get the exceptions description
Definition: exceptions.hpp:245
string _file
source file where the exception occured
Definition: exceptions.hpp:93
index_error()
default constructor
Definition: exceptions.hpp:441
friend std::ostream & operator<<(std::ostream &o, const key_error &e)
output operator
index error
Definition: exceptions.hpp:437
not_implemented_error()
default construtor
Definition: exceptions.hpp:657
memory_allocation_error()
default constructor
Definition: exceptions.hpp:288
const string & file() const
get file name
Definition: exceptions.hpp:110
Definition: add_op.hpp:29
size_t _line
line number in the source file
Definition: exceptions.hpp:94
memory_not_allocated_error()
default constructor
Definition: exceptions.hpp:325
friend std::ostream & operator<<(std::ostream &o, const type_error &e)
output operator
const string & name() const
get the exceptions name
Definition: exceptions.hpp:205
not implemented exception
Definition: exceptions.hpp:653
shape_mismatch_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:376
friend std::ostream & operator<<(std::ostream &o, const index_error &e)
output operator
exception()
default constructor
index_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:452
~cli_argument_error()
destructor
Definition: exceptions.hpp:750
key error
Definition: exceptions.hpp:473
string _name
name of the exception
Definition: exceptions.hpp:135
shape_mismatch_error()
default constructor
Definition: exceptions.hpp:364
memory_not_allocated_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:337
file_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:522
Exceptions base class.
Definition: exceptions.hpp:131
void description(const std::string &desc)
set exception desccription
Definition: exceptions.hpp:236
~shape_mismatch_error()
destructor
Definition: exceptions.hpp:383
cli_argument_error()
default constructor
Definition: exceptions.hpp:735
size_mismatch_error()
default constructor
Definition: exceptions.hpp:403
string _description
description of the error occured
Definition: exceptions.hpp:137
iterator error
Definition: exceptions.hpp:692
key_error()
default constructor
Definition: exceptions.hpp:477
const_iterator begin() const
get iterator to first error record
Definition: exceptions.hpp:256
iterator_error()
default constructor
Definition: exceptions.hpp:696
~memory_not_allocated_error()
destructor
Definition: exceptions.hpp:344
type_error()
default constructor
Definition: exceptions.hpp:548
friend std::ostream & operator<<(std::ostream &o, const not_implemented_error &e)
output operator
cli_argument_error(const exception_record &r, const string &d)
constructor
Definition: exceptions.hpp:744
friend std::ostream & operator<<(std::ostream &, const exception &)
output operator for exceptions
string _function
function in which the error occured
Definition: exceptions.hpp:95
command line option error
Definition: exceptions.hpp:766
memory not allocated error
Definition: exceptions.hpp:321
void name(const std::string &name)
set the exception name
Definition: exceptions.hpp:197
cli_help_request(const exception_record &r, const string &d)
constructor
Definition: exceptions.hpp:850
~cli_error()
destructor
Definition: exceptions.hpp:821
~cli_help_request()
destructor
Definition: exceptions.hpp:856
file IO fails
Definition: exceptions.hpp:508
command line argument error
Definition: exceptions.hpp:730
value_error()
default constructor
Definition: exceptions.hpp:584
memory_allocation_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:298
friend std::ostream & operator<<(std::ostream &o, const cli_argument_error &e)
output operator
std::ostream & operator<<(std::ostream &o, const exception_record &rec)
error record output operator
friend std::ostream & operator<<(std::ostream &o, const cli_error &e)
output operator
cli_help_request()
default constructor
Definition: exceptions.hpp:841
~size_mismatch_error()
destructor
Definition: exceptions.hpp:421
std::list< exception_record >::const_iterator const_iterator
const iterator over the error record
Definition: exceptions.hpp:153
~key_error()
destructor
Definition: exceptions.hpp:493
friend std::ostream & operator<<(std::ostream &o, const memory_allocation_error &e)
output operator
range_error()
default constructor
Definition: exceptions.hpp:620
friend std::ostream & operator<<(std::ostream &o, const range_error &e)
output operator
std::string string
String type.
Definition: types/types.hpp:69
cli_option_error()
default constructor
Definition: exceptions.hpp:771
key_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:487
not_implemented_error(const exception_record &i, const string &d)
constructor
Definition: exceptions.hpp:669
cli_error()
default constructor
Definition: exceptions.hpp:806
~range_error()
destructor
Definition: exceptions.hpp:636
friend std::ostream & operator<<(std::ostream &o, const cli_option_error &e)
output operator
virtual ~exception()
virtual destructor
Definition: exceptions.hpp:190