Asylo
|
An intermediate template class that to help define an ErrorSpace subclass. More...
#include <error_space.h>
Protected Member Functions | |
ErrorSpaceImplementationHelper (const std::string &space_name, const std::string &default_error_string="Unrecognized Code") | |
Constructs an ErrorSpaceImplementationHelper and registers it as space_name . More... | |
void | AddTranslationMapEntry (int code, const std::string &error_string, GoogleError google_error_code) |
Adds an interpretation of an error code as both a string and GoogleError. More... | |
std::string | SpaceName () const override |
Gets a name that uniquely identifies the error space. More... | |
std::string | String (int code) const override |
Gets a string that describes the error code within the space. More... | |
GoogleError | GoogleErrorCode (int code) const override |
Converts code to an appropriate value in the GoogleError enum. More... | |
Additional Inherited Members | |
Public Member Functions inherited from asylo::error::ErrorSpace | |
ErrorSpace ()=default | |
ErrorSpace (const ErrorSpace &other)=delete | |
virtual | ~ErrorSpace ()=default |
ErrorSpace & | operator= (const ErrorSpace &other)=delete |
Static Public Member Functions inherited from asylo::error::ErrorSpace | |
static ErrorSpace const * | Find (const std::string &name) |
Finds and returns an ErrorSpace singleton pointer whose SpaceName() equals name . More... | |
An intermediate template class that to help define an ErrorSpace subclass.
ErrorSpaceImplementationHelper automatically creates and inserts a singleton instance of ErrorSpaceT
into the global error-space singleton map. It is customary to derive the class ErrorSpaceT
from ErrorSpaceImplementationHelper<ErrorSpaceT>
to ensure correct management of the map.
|
inlineexplicitprotected |
Constructs an ErrorSpaceImplementationHelper and registers it as space_name
.
space_name | The name that ErrorSpace::Find() will use to fetch the singleton instance of this ErrorSpace. |
default_error_string | The result for String() for an unrecognized error code. |
|
inlineprotected |
Adds an interpretation of an error code as both a string and GoogleError.
code | The error code to interpret. |
error_string | The interpretation String() will return for code . |
google_error_code | The most apt GoogleError to assign to code . |
|
inlineoverrideprotectedvirtual |
Converts code
to an appropriate value in the GoogleError enum.
code | The error code in this error space to convert to GoogleError. |
code
. Implements asylo::error::ErrorSpace.
|
inlineoverrideprotectedvirtual |
Gets a name that uniquely identifies the error space.
Implements asylo::error::ErrorSpace.
|
inlineoverrideprotectedvirtual |
Gets a string that describes the error code within the space.
code | The error code to interpret within the error space. |
Implements asylo::error::ErrorSpace.