universal_error.cpp
1 #include "universal_error.hpp"
2 
3 using namespace std;
4 
5 UniversalError::UniversalError(std::string const& err_msg):
6  err_msg_(err_msg),
7  fields_(vector<string>()),
8  values_(vector<double>()) {}
9 
11  err_msg_(origin.err_msg_),
12  fields_(origin.fields_),
13  values_(origin.values_) {}
14 
15 void UniversalError::Append2ErrorMessage(string const& msg)
16 {
17  err_msg_ += msg;
18 }
19 
20 void UniversalError::AddEntry(string const& field,
21  double value)
22 {
23  fields_.push_back(field);
24  values_.push_back(value);
25 }
26 
27 string const& UniversalError::GetErrorMessage(void) const
28 {
29  return err_msg_;
30 }
31 
32 vector<string> const& UniversalError::GetFields(void) const
33 {
34  return fields_;
35 }
36 
37 vector<double> const& UniversalError::GetValues(void) const
38 {
39  return values_;
40 }
41 
42 UniversalError::~UniversalError(void) {}
Container for error reports.
std::vector< double > const & GetValues(void) const
Returns entry values.
std::vector< std::string > const & GetFields(void) const
Returns entry fields.
UniversalError(std::string const &err_msg)
Class constructor.
void AddEntry(std::string const &field, double value)
Adds an entry to the list.
void Append2ErrorMessage(std::string const &msg)
Appends std::string to the error message.
A class for storing error and debug information.
std::string const & GetErrorMessage(void) const
Returns the error message.