Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
virtual ~JExceptionHandler ()
 Virtual destructor.
 
result_type action () const
 Implementation of exception handler.
 
virtual result_type action (const JException &error) const
 Implementation of exception handler.
 

Private Member Functions

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

Static Private Member Functions

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

Private Attributes

const std::string buffer
 

Detailed Description

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

Exception handler for functional object.

Definition at line 127 of file JFunctional.hh.

Constructor & Destructor Documentation

◆ JExceptionHandler()

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

Default constructor.

Definition at line 133 of file JFunctional.hh.

133 :
134 JException("unknown")
135 {}
JException(const std::string &error)
Constructor.
Definition JException.hh:46

◆ ~JExceptionHandler()

template<class JArgument_t , class JResult_t >
virtual JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler::~JExceptionHandler ( )
inlinevirtual

Virtual destructor.

Definition at line 141 of file JFunctional.hh.

142 {}

Member Function Documentation

◆ action() [1/2]

template<class JArgument_t , class JResult_t >
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 151 of file JFunctional.hh.

152 {
153 return this->action(static_cast<const JException&>(*this));
154 }
result_type action() const
Implementation of exception handler.

◆ action() [2/2]

template<class JArgument_t , class JResult_t >
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 164 of file JFunctional.hh.

165 {
166 throw error;
167 }

◆ getDateAndTime()

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 }

◆ what()

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

◆ getOstream()

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 }

Member Data Documentation

◆ buffer

const std::string JLANG::JException::buffer
privateinherited

Definition at line 99 of file JException.hh.


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