Kea 2.7.6
|
Set of issue callbacks for a loader. More...
#include <master_loader_callbacks.h>
Public Types | |
typedef std::function< void(const std::string &source_name, size_t source_line, const std::string &reason)> | IssueCallback |
Type of one callback to report problems. | |
Public Member Functions | |
MasterLoaderCallbacks (const IssueCallback &error, const IssueCallback &warning) | |
Constructor. | |
void | error (const std::string &source_name, size_t source_line, const std::string &reason) const |
Call callback for serious errors. | |
void | warning (const std::string &source_name, size_t source_line, const std::string &reason) const |
Call callback for potential problems. | |
Set of issue callbacks for a loader.
This holds a set of callbacks by which a loader (such as MasterLoader) can report loaded RRsets, errors and other unusual conditions.
All the callbacks must be set.
Definition at line 49 of file master_loader_callbacks.h.
std::function<void(const std::string& source_name, size_t source_line, const std::string& reason)> isc::dns::MasterLoaderCallbacks::IssueCallback |
Type of one callback to report problems.
This is the type of one callback used to report an unusual condition or error.
source_name | The name of the source where the problem happened. This is usually a file name. |
source_line | Position of the problem, counted in lines from the beginning of the source. |
reason | Human readable description of what happened. |
Definition at line 63 of file master_loader_callbacks.h.
|
inline |
Constructor.
Initializes the callbacks.
error | The error callback to use. |
warning | The warning callback to use. |
isc::InvalidParameter | if any of the callbacks is empty. |
Definition at line 72 of file master_loader_callbacks.h.
References isc_throw.
|
inline |
Call callback for serious errors.
This is called whenever there's a serious problem which makes the data being loaded unusable. Further processing may or may not happen after this (for example to detect further errors), but the data should not be used.
It calls whatever was passed to the error parameter to the constructor.
If the caller of the loader wants to abort, it is possible to throw from the callback, which aborts the load.
Definition at line 93 of file master_loader_callbacks.h.
|
inline |
Call callback for potential problems.
This is called whenever a minor problem is discovered. This might mean the data is completely OK, it just looks suspicious.
It calls whatever was passed to the warn parameter to the constructor.
The loading will continue after the callback. If the caller wants to abort (which is probably not a very good idea, since warnings may be false positives), it is possible to throw from inside the callback.
Definition at line 109 of file master_loader_callbacks.h.
Referenced by isc::dns::rdata::createRdata().