HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdValidationError Class Reference

#include <error.h>

Public Member Functions

USDVALIDATION_API UsdValidationError ()
 A default constructed UsdValidationError signifies no error. More...
 
USDVALIDATION_API UsdValidationError (const TfToken &name, const UsdValidationErrorType &errorType, const UsdValidationErrorSites &errorSites, const std::string &errorMsg)
 
bool operator== (const UsdValidationError &other) const
 
bool operator!= (const UsdValidationError &other) const
 
const TfTokenGetName () const &
 Returns the name token of the UsdValidationError. More...
 
TfToken GetName ()&&
 Returns the name token of the UsdValidationError by-value. More...
 
UsdValidationErrorType GetType () const
 
const UsdValidationErrorSitesGetSites () const &
 
UsdValidationErrorSites GetSites ()&&
 
const UsdValidationValidatorGetValidator () const
 
const std::string & GetMessage () const
 Returns the message associated with this UsdValidationError. More...
 
USDVALIDATION_API TfToken GetIdentifier () const
 
USDVALIDATION_API std::string GetErrorAsString () const
 Returns UsdValidationErrorType and ErrorMessage concatenated as a string. More...
 
bool HasNoError () const
 

Friends

class UsdValidationValidator
 

Detailed Description

UsdValidationError is an entity returned by a validation task, which is associated with a UsdValidationValidator.

A UsdValidationError instance contains important information, like:

  • Name - A name the validator writer provided for the error. This is then used to construct an identifier for the error.
  • UsdValidationErrorType - severity of an error,
  • UsdValidationErrorSites - on what sites validationError was reported by a validation task,
  • Message - Message providing more information associated with the error. Such a message is provided by the validator writer, when providing implementation for the validation task function.

UsdValidationError instances will be stored in the UsdValidationContext responsible for executing a set of UsdValidationValidators.

Definition at line 224 of file error.h.

Constructor & Destructor Documentation

USDVALIDATION_API UsdValidationError::UsdValidationError ( )

A default constructed UsdValidationError signifies no error.

USDVALIDATION_API UsdValidationError::UsdValidationError ( const TfToken name,
const UsdValidationErrorType errorType,
const UsdValidationErrorSites errorSites,
const std::string &  errorMsg 
)

Instantiate a ValidationError by providing its name, errorType, errorSites and an errorMsg.

Member Function Documentation

USDVALIDATION_API std::string UsdValidationError::GetErrorAsString ( ) const

Returns UsdValidationErrorType and ErrorMessage concatenated as a string.

USDVALIDATION_API TfToken UsdValidationError::GetIdentifier ( ) const

An identifier for the error constructed from the validator name this error was generated from and its name.

Since a validator may result in multiple distinct errors, the identifier helps in distinguishing and categorizing the errors. The identifier returned will be in the following form: For a plugin validator: "plugName":"validatorName"."ErrorName" For a non-plugin validator: "validatorName"."ErrorName"

For an error that was generated without a name, the identifier will be same as the validator name which generated the error.

For an error which is created directly and not via UsdValidationValidator::Validate() call, we throw a coding error, as its an improper use of the API.

const std::string& UsdValidationError::GetMessage ( ) const
inline

Returns the message associated with this UsdValidationError.

Definition at line 296 of file error.h.

const TfToken& UsdValidationError::GetName ( ) const
inline

Returns the name token of the UsdValidationError.

Definition at line 253 of file error.h.

TfToken UsdValidationError::GetName ( )
inline

Returns the name token of the UsdValidationError by-value.

Definition at line 259 of file error.h.

const UsdValidationErrorSites& UsdValidationError::GetSites ( ) const
inline

Returns the UsdValidationErrorSite associated with this UsdValidationError

Definition at line 273 of file error.h.

UsdValidationErrorSites UsdValidationError::GetSites ( )
inline

Returns the UsdValidationErrorSite associated with this UsdValidationError by-value

Definition at line 280 of file error.h.

UsdValidationErrorType UsdValidationError::GetType ( ) const
inline

Returns the UsdValidationErrorType associated with this UsdValidationError

Definition at line 266 of file error.h.

const UsdValidationValidator* UsdValidationError::GetValidator ( ) const
inline

Returns the UsdValidationValidator that reported this error.

This will return nullptr if there is no UsdValidationValidator associated with this error. This will never be nullptr for validation errors returned from calls to UsdValidationValidator::Validate.

Definition at line 290 of file error.h.

bool UsdValidationError::HasNoError ( ) const
inline

Returns true if UsdValidationErrorType is UsdValidationErrorType::None, false otherwise

Definition at line 325 of file error.h.

bool UsdValidationError::operator!= ( const UsdValidationError other) const
inline

Definition at line 247 of file error.h.

bool UsdValidationError::operator== ( const UsdValidationError other) const
inline

Definition at line 239 of file error.h.

Friends And Related Function Documentation

Definition at line 334 of file error.h.


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