OpenASIP  2.0
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
ProgrammabilityValidatorResults Class Reference

#include <ProgrammabilityValidatorResults.hh>

Collaboration diagram for ProgrammabilityValidatorResults:
Collaboration graph

Public Types

typedef std::pair< ProgrammabilityValidator::ErrorCode, std::string > Error
 Typedef for an error (error code + error message). More...
 

Public Member Functions

 ProgrammabilityValidatorResults ()
 
virtual ~ProgrammabilityValidatorResults ()
 
int errorCount () const
 
Error error (int index) const
 
void addError (ProgrammabilityValidator::ErrorCode code, const std::string &errorMsg)
 

Private Types

typedef std::vector< ErrorErrorTable
 Typedef for vector of errors. More...
 

Private Attributes

ErrorTable errors_
 Contains the errors. More...
 

Detailed Description

This class bundles up the results of ProgrammabilityValidator.

Definition at line 46 of file ProgrammabilityValidatorResults.hh.

Member Typedef Documentation

◆ Error

Typedef for an error (error code + error message).

Definition at line 50 of file ProgrammabilityValidatorResults.hh.

◆ ErrorTable

typedef std::vector<Error> ProgrammabilityValidatorResults::ErrorTable
private

Typedef for vector of errors.

Definition at line 64 of file ProgrammabilityValidatorResults.hh.

Constructor & Destructor Documentation

◆ ProgrammabilityValidatorResults()

ProgrammabilityValidatorResults::ProgrammabilityValidatorResults ( )

The constructor.

Definition at line 39 of file ProgrammabilityValidatorResults.cc.

39  {
40 }

◆ ~ProgrammabilityValidatorResults()

ProgrammabilityValidatorResults::~ProgrammabilityValidatorResults ( )
virtual

The destructor.

Definition at line 46 of file ProgrammabilityValidatorResults.cc.

46  {
47 }

Member Function Documentation

◆ addError()

void ProgrammabilityValidatorResults::addError ( ProgrammabilityValidator::ErrorCode  code,
const std::string &  errorMsg 
)

Adds an error to the results.

Parameters
codeThe error code.
errorMsgThe error message.

Definition at line 85 of file ProgrammabilityValidatorResults.cc.

87  {
88 
89  Error error(code, errorMsg);
90  errors_.push_back(error);
91 }

References error(), and errors_.

Referenced by ProgrammabilityValidator::checkBooleanRegister(), ProgrammabilityValidator::checkPrimitiveSet(), ProgrammabilityValidator::profile(), and ProgrammabilityValidator::validate().

Here is the call graph for this function:

◆ error()

ProgrammabilityValidatorResults::Error ProgrammabilityValidatorResults::error ( int  index) const

Returns an error by the given index.

Parameters
indexThe index.
Returns
The error.
Exceptions
OutOfRangeIf the given index is negative or not smaller than the number of errors.

Definition at line 70 of file ProgrammabilityValidatorResults.cc.

70  {
71  if (index < 0 || index >= errorCount()) {
72  throw OutOfRange(__FILE__, __LINE__, __func__);
73  }
74 
75  return errors_[index];
76 }

References __func__, errorCount(), and errors_.

Referenced by addError(), main(), and ValidateMachineDialog::onValidate().

Here is the call graph for this function:

◆ errorCount()

int ProgrammabilityValidatorResults::errorCount ( ) const

Returns the number of errors.

Returns
The number of errors.

Definition at line 56 of file ProgrammabilityValidatorResults.cc.

56  {
57  return errors_.size();
58 }

References errors_.

Referenced by error(), main(), and ValidateMachineDialog::onValidate().

Member Data Documentation

◆ errors_

ErrorTable ProgrammabilityValidatorResults::errors_
private

Contains the errors.

Definition at line 67 of file ProgrammabilityValidatorResults.hh.

Referenced by addError(), error(), and errorCount().


The documentation for this class was generated from the following files:
OutOfRange
Definition: Exception.hh:320
ProgrammabilityValidatorResults::error
Error error(int index) const
Definition: ProgrammabilityValidatorResults.cc:70
__func__
#define __func__
Definition: Application.hh:67
ProgrammabilityValidatorResults::errors_
ErrorTable errors_
Contains the errors.
Definition: ProgrammabilityValidatorResults.hh:67
ProgrammabilityValidatorResults::errorCount
int errorCount() const
Definition: ProgrammabilityValidatorResults.cc:56
ProgrammabilityValidatorResults::Error
std::pair< ProgrammabilityValidator::ErrorCode, std::string > Error
Typedef for an error (error code + error message).
Definition: ProgrammabilityValidatorResults.hh:50