Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler Struct Reference

Exception handler for functional object. More...

#include <JFunctional.hh>

Inheritance diagram for JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler:
JLANG::JException JTOOLS::JFunctional< JArgument_t, JResult_t >::JDefaultResult

Public Member Functions

 JExceptionHandler ()
 Default constructor. More...
 
virtual ~JExceptionHandler ()
 Virtual destructor. More...
 
result_type action () const
 Implementation of exception handler. More...
 
virtual result_type action (const JException &error) const
 Implementation of exception handler. More...
 

Private Member Functions

virtual const char * what () const override throw ()
 Get error message. More...
 

Static Private Member Functions

static std::string getDateAndTime ()
 Get date and time [UTC]. More...
 
static std::ostream & getOstream ()
 Get output stream for conversion of exception. More...
 

Detailed Description

template<class JArgument_t = JNullType, class JResult_t = JNullType>
struct JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler

Exception handler for functional object.

Definition at line 131 of file JFunctional.hh.

Constructor & Destructor Documentation

template<class JArgument_t = JNullType, class JResult_t = JNullType>
JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler::JExceptionHandler ( )
inline

Default constructor.

Definition at line 137 of file JFunctional.hh.

137  :
138  JException("unknown")
139  {}
JException(const std::string &error)
Constructor.
Definition: JException.hh:46
template<class JArgument_t = JNullType, class JResult_t = JNullType>
virtual JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler::~JExceptionHandler ( )
inlinevirtual

Virtual destructor.

Definition at line 145 of file JFunctional.hh.

146  {}

Member Function Documentation

template<class JArgument_t = JNullType, class JResult_t = JNullType>
result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler::action ( ) const
inline

Implementation of exception handler.

This implementation throws the exception.

Returns
value

Definition at line 155 of file JFunctional.hh.

156  {
157  return this->action(static_cast<const JException&>(*this));
158  }
result_type action() const
Implementation of exception handler.
Definition: JFunctional.hh:155
template<class JArgument_t = JNullType, class JResult_t = JNullType>
virtual result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler::action ( const JException error) const
inlinevirtual

Implementation of exception handler.

This implementation throws the exception.

Parameters
errorerror
Returns
value

Reimplemented in JTOOLS::JFunctional< JArgument_t, JResult_t >::JDefaultResult.

Definition at line 168 of file JFunctional.hh.

169  {
170  throw error;
171  }
static std::string JLANG::JException::getDateAndTime ( )
inlinestaticinherited

Get date and time [UTC].

Returns
date and time [UTC]

Definition at line 31 of file JException.hh.

32  {
33  using namespace std;
34 
35  time_t result = time(NULL);
36 
37  return asctime(gmtime(&result));
38  }
virtual const char* JLANG::JException::what ( ) const
throw (
)
inlineoverridevirtualinherited

Get error message.

Returns
error message

Definition at line 64 of file JException.hh.

65  {
66  return buffer.c_str();
67  }
const std::string buffer
Definition: JException.hh:99
static std::ostream& JLANG::JException::getOstream ( )
inlinestaticinherited

Get output stream for conversion of exception.

Note that the ostream is emptied before use.

Returns
ostream

Definition at line 89 of file JException.hh.

90  {
91  static std::ostringstream buffer;
92 
93  buffer.str("");
94 
95  return buffer;
96  }
const std::string buffer
Definition: JException.hh:99

The documentation for this struct was generated from the following file: