#include <PlugInCallback.h>
Inheritance diagram for nvutil::PlugInCallback:
Public Types | |
enum | PIC_ERROR { PICE_UNEXPECTED_EOF, PICE_UNEXPECTED_TOKEN, PICE_UNKNOWN_TOKEN, PICE_FILE_ACCESS_FAILED, PICE_FILE_MAPPING_FAILED, PICE_INCOMPATIBLE_FILE, PICE_INVALID_FILE } |
Enumeration of PlugInCallback errors. More... | |
enum | PIC_WARNING { PICW_FILE_EMPTY, PICW_FILE_NOT_FOUND, PICW_FILES_NOT_FOUND, PICW_EMPTY_TOKEN, PICW_INCOMPATIBLE_VALUES, PICW_INVALID_VALUE, PICW_UNDEFINED_TOKEN, PICW_UNSUPPORTED_TOKEN } |
Enumeration of PlugInCallback warnings. More... | |
enum | PIC_TYPE_ID { PICT_INT, PICT_FLOAT } |
Enumeration of value types used in warnings/errors. More... | |
Public Member Functions | |
PlugInCallback () | |
Constructor. | |
void | setThrowExceptionOnError (bool set) |
Set whether an exception should be thrown on error. | |
virtual void | onError (PIC_ERROR eid, const void *info) const |
General callback on error. | |
virtual bool | onWarning (PIC_WARNING wid, const void *info) const |
General callback on warning. | |
virtual void | onUnexpectedEndOfFile (size_t position) const |
Specialized callback on error: PICE_UNEXPECTED_EOF. | |
virtual void | onUnexpectedToken (size_t position, const std::string &expected, const std::string &encountered) const |
Specialized callback on error: PICE_UNEXPECTED_TOKEN. | |
virtual void | onUnknownToken (size_t position, const std::string &context, const std::string &token) const |
Specialized callback on error: PICE_UNKNOWN_TOKEN. | |
virtual bool | onEmptyToken (size_t position, const std::string &context, const std::string &token) const |
Specialized callback on warning: PICW_EMPTY_TOKEN. | |
virtual bool | onFileEmpty (const std::string &file) const |
Specialized callback on warning: PICW_FILE_EMPTY. | |
virtual bool | onFileNotFound (const std::string &file) const |
Specialized callback on warning: PICW_FILE_NOT_FOUND. | |
virtual bool | onFilesNotFound (const std::vector< std::string > &files) const |
Specialized callback on warning: PICW_FILES_NOT_FOUND. | |
virtual bool | onUndefinedToken (size_t position, const std::string &context, const std::string &token) const |
Specialized callback on warning: PICW_UNDEFINED_TOKEN. | |
virtual bool | onIncompatibleValues (size_t position, const std::string &context, const std::string &value0Name, int value0, const std::string &value1Name, int value1) const |
Specialized callback on warning: PICW_INCOMPATIBLE_VALUES. | |
virtual bool | onIncompatibleValues (size_t position, const std::string &context, const std::string &value0Name, float value0, const std::string &value1Name, float value1) const |
Specialized callback on warning: PICW_INCOMPATIBLE_VALUES. | |
virtual bool | onInvalidValue (size_t position, const std::string &context, const std::string &valueName, int value) const |
Specialized callback on warning: PICW_INVALID_VALUE. | |
virtual bool | onInvalidValue (size_t position, const std::string &context, const std::string &valueName, float value) const |
Specialized callback on warning: PICW_INVALID_VALUE. | |
virtual bool | onUnsupportedToken (size_t position, const std::string &context, const std::string &token) const |
Specialized callback on warning: PICW_UNSUPPORTED_TOKEN. | |
virtual void | onFileAccessFailed (const std::string &file, unsigned int systemSpecificErrorCode) const |
Error callback on PICE_FILE_ACCESS_FAILED error. | |
virtual void | onFileMappingFailed (unsigned int systemSpecificErrorCode) const |
Error callback on PICE_FILE_MAPPING_FAILED error. | |
virtual void | onImcompatibleFile (const std::string &file, const std::string &context, unsigned int expectedVersion, unsigned int detectedVersion) const |
Error callback on PICE_INCOMPATIBLE_FILE error. | |
virtual void | onInvalidFile (const std::string &file, const std::string &context) const |
Error callback on PICE_INVALID_FILE error. | |
Protected Member Functions | |
virtual | ~PlugInCallback () |
Protected destructor to prevent explicit creation on stack. | |
Classes | |
struct | EmptyTokenInfo |
Information structure used for warning PICW_EMPTY_TOKEN. More... | |
struct | FileAccessFailedInfo |
Information structure used for error PICE_FILE_ACCESS_ERROR. More... | |
struct | FileMappingFailedInfo |
Information structure used for error PICE_FILE_MAPPING_ERROR. More... | |
struct | IncompatibleFileInfo |
Information structure used for error PICE_INCOMPATIBLE_FILE. More... | |
struct | IncompatibleValueInfo |
Information structure used for warning PICW_INCOMPATIBLE_VALUES. More... | |
struct | InvalidFileInfo |
Information structure used for error PICE_INVALID_FILE. More... | |
struct | InvalidValueInfo |
Information structure used for warning PICW_INVALID_VALUE. More... | |
struct | UndefinedTokenInfo |
Information structure used for warning PICW_UNDEFINED_TOKEN. More... | |
struct | UnexpectedTokenInfo |
Information structure used for error PICE_UNEXPECTED_TOKEN. More... | |
struct | UnknownTokenInfo |
Information structure used for error PICE_UNKNOWN_TOKEN. More... | |
struct | UnsupportedTokenInfo |
Information structure used for warning PICW_UNSUPPORTED_TOKEN. More... |
A PlugInCallback object can be used to report warnings and errors that happen while using a PlugIn. It is applied to a PlugIn via PlugIn::setCallback(). A PlugInCallback object consists of a set of virtual functions that can be overloaded by an application specific PlugInCallback object. It has two generic callbacks onError and onWarning, that can be called with any error/warning code. And it has two families of specific error and warning functions that are called on specific error/warning conditions.
|
Enumeration of PlugInCallback errors.
|
|
Enumeration of PlugInCallback warnings.
|
|
Enumeration of value types used in warnings/errors.
|
|
Constructor.
|
|
Protected destructor to prevent explicit creation on stack.
|
|
Set whether an exception should be thrown on error.
|
|
General callback on error. This general error callback is called with every error that isn't completely handled in a specialized error callback. If throwExceptionOnError is set (default), onError throws an PIC_ERROR exception. The specific error callbacks fall back to this function. This callback can be overloaded to support new error conditions.
|
|
General callback on warning. This general warning callback is called with every warning that isn't completely handled in a specialized warning callback. In this base implemetation, onWarning just returns true, meaning the PlugIn operation can be continued without danger. The specific warning callbacks fall back to this function. This callback can be overloaded to support new warning conditions.
|
|
Specialized callback on error: PICE_UNEXPECTED_EOF. This error callback is called, when the end of a file was reached unexpectedly. In this base implementation, the general callback onError is called. Overload this callback to implement special handling on unexpected end of file errors.
|
|
Specialized callback on error: PICE_UNEXPECTED_TOKEN. This error callback is called, when an unexpected token is encountered. In this base implementation, a struct UnexpectedTokenInfo is constructed out of the arguments, and the general callback onError is called. Overlaod this callback to implement special handling on unexpected token errors.
|
|
Specialized callback on error: PICE_UNKNOWN_TOKEN. This error callback is called, when an unknown token is encountered. In this base implementation, a struct UnknownTokenInfo is constructed out of the arguments, and the general callback onError is called. Overload this callback to implement special handling on unknown token errors.
|
|
Specialized callback on warning: PICW_EMPTY_TOKEN. This warning callback is called, when a token proved to be empty. In this base implementation, a struct EmptyTokenInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on empty token warnings.
|
|
Specialized callback on warning: PICW_FILE_EMPTY. This warning callback is called, when a file proved to be empty. In this base implementation, the general callback onWarning is called. Overload this callback to implement special handling on empty file warnings.
|
|
Specialized callback on warning: PICW_FILE_NOT_FOUND. This warning callback is called, when a file wasn't found. In this base implementation, the general callback onWarning is called. Overload this callback to implement special handling on file not found warnings.
|
|
Specialized callback on warning: PICW_FILES_NOT_FOUND. This warning callback is called, when none of a number of files was found. In this base implementation, the general callback onWarning is called. Overload this callback to implement special handling on file not found warnings.
|
|
Specialized callback on warning: PICW_UNDEFINED_TOKEN. This warning callback is called, a named token is used that wasn't defined before. In this base implementation, a struct UndefinedTokenInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on undefined token warnings.
|
|
Specialized callback on warning: PICW_INCOMPATIBLE_VALUES. This warning callback is called, when two incompatible values of type int are found in the file. In this base implementation, a struct IncompatibleValueInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on incompatible values warnings.
|
|
Specialized callback on warning: PICW_INCOMPATIBLE_VALUES. This warning callback is called, when two incompatible values of type float are found in the file. In this base implementation, a struct IncompatibleValueInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on incompatible values warnings.
|
|
Specialized callback on warning: PICW_INVALID_VALUE. This warning callback is called, when an invalid value of type int is found in the file. In this base implementatino, a struct InvalidValueInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on incompatible values warnings.
|
|
Specialized callback on warning: PICW_INVALID_VALUE. This warning callback is called, when an invalid value of type float is found in the file. In this base implementatino, a struct InvalidValueInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on incompatible values warnings.
|
|
Specialized callback on warning: PICW_UNSUPPORTED_TOKEN. This warning callback is called, when an unsupported token is found in the file. In this base implementatino, a struct UnsupportedTokenInfo is constructed out of the arguments, and the general callback onWarning is called. Overload this callback to implement special handling on unsupported token warnings.
|
|
Error callback on PICE_FILE_ACCESS_FAILED error.
This callback should be invoked from within a plug-in if a file access error occured. The default implementation simply calls onError.
|
|
Error callback on PICE_FILE_MAPPING_FAILED error.
This callback should be invoked from within a plug-in if a file mapping error occured. The default implementation simply calls onError.
|
|
Error callback on PICE_INCOMPATIBLE_FILE error.
This callback should be invoked from within a plug-in if a file is detected to be incompatible. The default implementation simply calls onError.
|
|
Error callback on PICE_INVALID_FILE error.
This callback should be invoked from within a plug-in if a file is detected to be invalid. The default implementation simply calls onError.
|