ʻOhana
Population structure, admixture history, and selection using learning methods.
Public Types | Public Member Functions
jade::basic_error< TChar > Class Template Reference

A template for a class representing an exception thrown from this namespace. More...

#include <jade.error.hpp>

+ Inheritance diagram for jade::basic_error< TChar >:
+ Collaboration diagram for jade::basic_error< TChar >:

Public Types

typedef TChar char_type
 The character type. More...
 
typedef std::basic_string< char_typestring_type
 The string type. More...
 

Public Member Functions

 basic_error ()
 Initializes a new instance of the class with no message. More...
 
 basic_error (const string_type &message)
 Initializes a new instance of the class with the specified message. More...
 
 basic_error (char_type const *const message)
 Initializes a new instance of the class with the specified message. More...
 
const string_typestr () const
 
virtual const char * what () const throw ()
 
template<typename TArgValue >
basic_erroroperator<< (TArgValue rhs)
 Concatenates the specified value with the current message. More...
 

Detailed Description

template<typename TChar>
class jade::basic_error< TChar >

A template for a class representing an exception thrown from this namespace.

Definition at line 19 of file jade.error.hpp.

Member Typedef Documentation

◆ char_type

template<typename TChar >
typedef TChar jade::basic_error< TChar >::char_type

The character type.

Definition at line 23 of file jade.error.hpp.

◆ string_type

template<typename TChar >
typedef std::basic_string<char_type> jade::basic_error< TChar >::string_type

The string type.

Definition at line 26 of file jade.error.hpp.

Constructor & Destructor Documentation

◆ basic_error() [1/3]

template<typename TChar >
jade::basic_error< TChar >::basic_error ( )
inline

Initializes a new instance of the class with no message.

Definition at line 31 of file jade.error.hpp.

32  : _m ()
33  {
34  }

◆ basic_error() [2/3]

template<typename TChar >
jade::basic_error< TChar >::basic_error ( const string_type message)
inlineexplicit

Initializes a new instance of the class with the specified message.

Parameters
messageThe initial message.

Definition at line 39 of file jade.error.hpp.

41  : _m (message)
42  {
43  }

◆ basic_error() [3/3]

template<typename TChar >
jade::basic_error< TChar >::basic_error ( char_type const *const  message)
inlineexplicit

Initializes a new instance of the class with the specified message.

Parameters
messageThe initial message.

Definition at line 48 of file jade.error.hpp.

50  : _m (message)
51  {
52  assert(message != nullptr);
53  }

Member Function Documentation

◆ operator<<()

template<typename TChar >
template<typename TArgValue >
basic_error& jade::basic_error< TChar >::operator<< ( TArgValue  rhs)
inline

Concatenates the specified value with the current message.

Parameters
rhsThe value to concatenate.
Returns
This instance.

Definition at line 75 of file jade.error.hpp.

76  {
77  std::basic_ostringstream<char_type> out;
78  out << rhs;
79  _m += out.str();
80  return *this;
81  }

◆ str()

template<typename TChar >
const string_type& jade::basic_error< TChar >::str ( ) const
inline
Returns
The message.

Definition at line 58 of file jade.error.hpp.

59  {
60  return _m;
61  }

◆ what()

template<typename TChar >
virtual const char* jade::basic_error< TChar >::what ( ) const
throw (
)
inlinevirtual
Returns
An explanatory string.
+ Here is the caller graph for this function:

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