libdap::SignalHandlerRegisteredErr Class Reference

`#include <SignalHandlerRegisteredErr.h>`

Inheritance diagram for libdap::SignalHandlerRegisteredErr:

## Public Member Functions

ErrorCode | get_error_code () const
std::string | get_error_message () const
std::string | get_file () const
int | get_line () const
bool | OK () const
| Is the Error object valid?
bool | parse (FILE *fp)
| Parse an Error object.
void | print (FILE *out) const
void | print (std::ostream &out) const
void | set_error_code (ErrorCode ec=undefined_error)
void | set_error_message (std::string msg="")
void | set_file (std::string f)
void | set_line (int l)
| SignalHandlerRegisteredErr (const string &msg)
const char * | what () const noexcept override
| The pointer is valid only for the lifetime of the Error instance. jhrg 9/22/20.

## Protected Attributes

ErrorCode | _error_code
std::string | _error_message
std::string | d_file
int | d_line = 0

## Detailed Description

SignalHandlerRegisteredErr is thrown by HTTPCache::instance() if a signal handler is already registered.

Author
  jhrg

Definition at line 42 of file SignalHandlerRegisteredErr.h.

## Constructor & Destructor Documentation

## SignalHandlerRegisteredErr() [1/2]

libdap::SignalHandlerRegisteredErr::SignalHandlerRegisteredErr | ( | const string & | msg | ) |

inline

Definition at line 45 of file SignalHandlerRegisteredErr.h.

## SignalHandlerRegisteredErr() [2/2]

libdap::SignalHandlerRegisteredErr::SignalHandlerRegisteredErr | ( |  | ) |

inline

Definition at line 52 of file SignalHandlerRegisteredErr.h.

## Member Function Documentation

## get_error_code()

ErrorCode libdap::Error::get_error_code | ( |  | ) | const

inherited

Get the ErrorCode for this instance.

Definition at line 189 of file Error.cc.

## get_error_message()

string libdap::Error::get_error_message | ( |  | ) | const

inherited

Return the current error message.

Definition at line 212 of file Error.cc.

## get_file()

std::string libdap::Error::get_file | ( |  | ) | const

inline inherited

Definition at line 146 of file Error.h.

## get_line()

int libdap::Error::get_line | ( |  | ) | const

inline inherited

Definition at line 148 of file Error.h.

## OK()

bool libdap::Error::OK | ( |  | ) | const

inherited

Is the Error object valid?

Use this function to determine whether an Error object is valid. To be a valid, an Error object must either be: 1) empty or contain a message and a code.

Returns
  TRUE if the object is valid, FALSE otherwise.

Definition at line 87 of file Error.cc.

## parse()

bool libdap::Error::parse | ( | FILE * | fp | ) |

inherited

Parse an Error object.

Given an input stream (FILE *) fp, parse an Error object from stream. Values for fields of the Error object are parsed and `this` is set accordingly. This is how a client program receives an error object from a server.

Parameters

  fp | A valid file pointer to an input stream.

Returns
  TRUE if no error was detected, FALSE otherwise.

Definition at line 106 of file Error.cc.

## print() [1/2]

void libdap::Error::print | ( | FILE * | out | ) | const

inherited

Creates a printable representation of the Error object. It is suitable for framing, and also for printing and sending over a network.

The printed representation produced by this function can be parsed by the parse() member function. Thus parse and print form a symmetrical pair that can be used to send and receive an Error object over the network in a MIME document.

Parameters

  out | A pointer to the output stream on which the Error object is to be rendered.

Definition at line 144 of file Error.cc.

## print() [2/2]

void libdap::Error::print | ( | std::ostream & | out | ) | const

inherited

Creates a printable representation of the Error object. It is suitable for framing, and also for printing and sending over a network.

The printed representation produced by this function can be parsed by the parse() member function. Thus parse and print form a symmetrical pair that can be used to send and receive an Error object over the network in a MIME document.

Parameters

  strm | A reference to the output stream on which the Error object is to be rendered.

Definition at line 171 of file Error.cc.

## set_error_code()

void libdap::Error::set_error_code | ( | ErrorCode | ec = undefined_error | ) |

inherited

Set the ErrorCode. If the current error message has not been set, use ec to set the error message. The resulting error message string is the same as the ErrorCode name. If ec is not within the range of values for an OPeNDAP ErrorCode, the error message is left unchanged.

Parameters

  ec | The new ErrorCode value.

Definition at line 200 of file Error.cc.

## set_error_message()

void libdap::Error::set_error_message | ( | std::string | msg = "" | ) |

inherited

Set the error message.

Definition at line 219 of file Error.cc.

## set_file()

void libdap::Error::set_file | ( | std::string | f | ) |

inline inherited

Definition at line 147 of file Error.h.

## set_line()

void libdap::Error::set_line | ( | int | l | ) |

inline inherited

Definition at line 149 of file Error.h.

## what()

const char * libdap::Error::what | ( |  | ) | const

inline override noexcept inherited

The pointer is valid only for the lifetime of the Error instance. jhrg 9/22/20.

Definition at line 152 of file Error.h.

## Member Data Documentation

## _error_code

ErrorCode libdap::Error::_error_code

protected inherited

Definition at line 94 of file Error.h.

## _error_message

std::string libdap::Error::_error_message

protected inherited

Definition at line 95 of file Error.h.

## d_file

std::string libdap::Error::d_file

protected inherited

Definition at line 96 of file Error.h.

## d_line

int libdap::Error::d_line = 0

protected inherited

Definition at line 97 of file Error.h.

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

- SignalHandlerRegisteredErr.h