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

#include <POMValidatorResults.hh>

Collaboration diagram for POMValidatorResults:
Collaboration graph

Public Types

typedef std::pair< POMValidator::ErrorCode, std::string > Error
 

Public Member Functions

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

Private Attributes

std::vector< Errorerrors_
 Vector storing the errors. More...
 

Detailed Description

Class for storing POMValidator results.

Definition at line 45 of file POMValidatorResults.hh.

Member Typedef Documentation

◆ Error

typedef std::pair<POMValidator::ErrorCode, std::string> POMValidatorResults::Error

Definition at line 47 of file POMValidatorResults.hh.

Constructor & Destructor Documentation

◆ POMValidatorResults()

POMValidatorResults::POMValidatorResults ( )

The constructor.

Definition at line 38 of file POMValidatorResults.cc.

38  {
39 }

◆ ~POMValidatorResults()

POMValidatorResults::~POMValidatorResults ( )
virtual

The destructor.

Definition at line 45 of file POMValidatorResults.cc.

45  {
46 }

Member Function Documentation

◆ addError()

void POMValidatorResults::addError ( POMValidator::ErrorCode  code,
const std::string &  errorMsg 
)

Adds an error to the results.

Parameters
codeThe error code.
errorMsgThe error message.

Definition at line 84 of file POMValidatorResults.cc.

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

References error(), and errors_.

Referenced by POMValidator::checkCompiledSimulatability(), POMValidator::checkConnectivity(), POMValidator::checkLongImmediates(), and POMValidator::checkSimulatability().

Here is the call graph for this function:

◆ error()

POMValidatorResults::Error POMValidatorResults::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 69 of file POMValidatorResults.cc.

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

References __func__, errorCount(), and errors_.

Referenced by addError(), and SimulatorFrontend::loadProgram().

Here is the call graph for this function:

◆ errorCount()

int POMValidatorResults::errorCount ( ) const

Returns the number of errors.

Returns
The number of errors.

Definition at line 55 of file POMValidatorResults.cc.

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

References errors_.

Referenced by error(), and SimulatorFrontend::loadProgram().

Member Data Documentation

◆ errors_

std::vector<Error> POMValidatorResults::errors_
private

Vector storing the errors.

Definition at line 59 of file POMValidatorResults.hh.

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


The documentation for this class was generated from the following files:
POMValidatorResults::Error
std::pair< POMValidator::ErrorCode, std::string > Error
Definition: POMValidatorResults.hh:47
POMValidatorResults::error
Error error(int index) const
Definition: POMValidatorResults.cc:69
OutOfRange
Definition: Exception.hh:320
__func__
#define __func__
Definition: Application.hh:67
POMValidatorResults::errorCount
int errorCount() const
Definition: POMValidatorResults.cc:55
POMValidatorResults::errors_
std::vector< Error > errors_
Vector storing the errors.
Definition: POMValidatorResults.hh:59