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

#include <MachineValidatorResults.hh>

Collaboration diagram for MachineValidatorResults:
Collaboration graph

Public Types

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

Public Member Functions

 MachineValidatorResults ()
 
virtual ~MachineValidatorResults ()
 
int errorCount () const
 
Error error (int index) const
 
void addError (MachineValidator::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 MachineValidator.

Definition at line 45 of file MachineValidatorResults.hh.

Member Typedef Documentation

◆ Error

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

Definition at line 48 of file MachineValidatorResults.hh.

◆ ErrorTable

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

Typedef for vector of errors.

Definition at line 62 of file MachineValidatorResults.hh.

Constructor & Destructor Documentation

◆ MachineValidatorResults()

MachineValidatorResults::MachineValidatorResults ( )

The constructor.

Definition at line 39 of file MachineValidatorResults.cc.

39  {
40 }

◆ ~MachineValidatorResults()

MachineValidatorResults::~MachineValidatorResults ( )
virtual

The destructor.

Definition at line 46 of file MachineValidatorResults.cc.

46  {
47 }

Member Function Documentation

◆ addError()

void MachineValidatorResults::addError ( MachineValidator::ErrorCode  code,
const std::string &  errorMsg 
)

◆ error()

MachineValidatorResults::Error MachineValidatorResults::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 MachineValidatorResults.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(), HDB::HDBManager::addFUArchitecture(), LLVMBackend::compile(), ProgrammabilityValidator::ProgrammabilityValidator(), and ProGe::ProcessorGenerator::validateMachine().

Here is the call graph for this function:

◆ errorCount()

int MachineValidatorResults::errorCount ( ) const

Returns the number of errors.

Returns
The number of errors.

Definition at line 56 of file MachineValidatorResults.cc.

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

References errors_.

Referenced by HDB::HDBManager::addFUArchitecture(), LLVMBackend::compile(), error(), ProgrammabilityValidator::ProgrammabilityValidator(), and ProGe::ProcessorGenerator::validateMachine().

Member Data Documentation

◆ errors_

ErrorTable MachineValidatorResults::errors_
private

Contains the errors.

Definition at line 65 of file MachineValidatorResults.hh.

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


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