jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Public Member Functions | Private Attributes | Friends | List of all members
jubatus::core::common::exception::jubatus_exception Class Referenceabstract

#include <exception.hpp>

Inheritance diagram for jubatus::core::common::exception::jubatus_exception:
Inheritance graph
Collaboration diagram for jubatus::core::common::exception::jubatus_exception:
Collaboration graph

Public Member Functions

std::string diagnostic_information (bool display_what=false) const
 
error_info_list_t error_info () const
 
 jubatus_exception () throw ()
 
std::string name () const throw ()
 
virtual exception_thrower_ptr thrower () const =0
 
virtual const char * what () const throw ()
 
virtual ~jubatus_exception () throw ()
 

Private Attributes

std::string exception_class_name_
 
error_info_list_t info_list_
 

Friends

template<class Exception >
const Exception & add_info (const Exception &e, jubatus::util::lang::shared_ptr< error_info_base > info)
 

Detailed Description

Definition at line 90 of file exception.hpp.

Constructor & Destructor Documentation

jubatus::core::common::exception::jubatus_exception::jubatus_exception ( )
throw (
)
inline

Definition at line 92 of file exception.hpp.

92  {
93  }
virtual jubatus::core::common::exception::jubatus_exception::~jubatus_exception ( )
throw (
)
inlinevirtual

Definition at line 94 of file exception.hpp.

94  {
95  }

Member Function Documentation

std::string jubatus::core::common::exception::jubatus_exception::diagnostic_information ( bool  display_what = false) const

Definition at line 31 of file exception.cpp.

References info_list_, and what().

31  {
32  std::ostringstream tmp;
33 
34  tmp << "Dynamic exception type: ";
35  tmp << jubatus::util::lang::demangle(typeid(*this).name());
36 
37  if (display_what && strcmp(what(), "")) {
38  tmp << "::what: " << what();
39  }
40 
41  tmp << '\n';
42 
43  size_t frame = 0;
44  for (error_info_list_t::const_iterator it = info_list_.begin(), end =
45  info_list_.end(); it != end; ++it) {
46  if ((*it)->splitter()) {
47  frame++;
48  continue;
49  }
50  tmp << " #" << frame << " [" << (*it)->tag_typeid_name() << "] = "
51  << (*it)->as_string() << '\n';
52  }
53  return tmp.str();
54 }

Here is the call graph for this function:

error_info_list_t jubatus::core::common::exception::jubatus_exception::error_info ( ) const

Definition at line 27 of file exception.cpp.

References info_list_.

27  {
28  return info_list_;
29 }
std::string jubatus::core::common::exception::jubatus_exception::name ( ) const
throw (
)
inline

Definition at line 104 of file exception.hpp.

References exception_class_name_.

Referenced by what().

104  {
105  // does not assume multithreading
106  if (exception_class_name_.empty()) {
107  exception_class_name_ = jubatus::util::lang::demangle(
108  typeid(*this).name());
109  }
110 
111  return exception_class_name_;
112  }

Here is the caller graph for this function:

virtual exception_thrower_ptr jubatus::core::common::exception::jubatus_exception::thrower ( ) const
pure virtual
virtual const char* jubatus::core::common::exception::jubatus_exception::what ( ) const
throw (
)
inlinevirtual

Friends And Related Function Documentation

template<class Exception >
const Exception& add_info ( const Exception &  e,
jubatus::util::lang::shared_ptr< error_info_base info 
)
friend

Definition at line 128 of file exception.hpp.

130  {
131  e.info_list_.push_back(info);
132  return e;
133 }

Member Data Documentation

std::string jubatus::core::common::exception::jubatus_exception::exception_class_name_
mutableprivate

Definition at line 123 of file exception.hpp.

Referenced by name(), and what().

error_info_list_t jubatus::core::common::exception::jubatus_exception::info_list_
mutableprivate

Definition at line 124 of file exception.hpp.

Referenced by diagnostic_information(), and error_info().


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