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

#include <MachineCheckResults.hh>

Collaboration diagram for MachineCheckResults:
Collaboration graph

Public Types

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

Public Member Functions

 MachineCheckResults ()
 
virtual ~MachineCheckResults ()
 
int errorCount () const
 
Error error (int index) const
 
void addError (const MachineCheck &check, 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

Container for MachineCheck error messages.

Definition at line 46 of file MachineCheckResults.hh.

Member Typedef Documentation

◆ Error

typedef std::pair<const MachineCheck*, std::string> MachineCheckResults::Error

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

Definition at line 49 of file MachineCheckResults.hh.

◆ ErrorTable

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

Typedef for vector of errors.

Definition at line 63 of file MachineCheckResults.hh.

Constructor & Destructor Documentation

◆ MachineCheckResults()

MachineCheckResults::MachineCheckResults ( )

The constructor.

Definition at line 39 of file MachineCheckResults.cc.

39  {
40 }

◆ ~MachineCheckResults()

MachineCheckResults::~MachineCheckResults ( )
virtual

The destructor.

Definition at line 46 of file MachineCheckResults.cc.

46  {
47 }

Member Function Documentation

◆ addError()

void MachineCheckResults::addError ( const MachineCheck check,
const std::string &  errorMsg 
)

Adds an error to the results.

Parameters
codeThe error code.
errorMsgThe error message.

Definition at line 85 of file MachineCheckResults.cc.

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

References error(), and errors_.

Referenced by OperationBindingCheck::check(), RFPortCheck::check(), AddressSpaceCheck::check(), FullyConnectedCheck::check(), MinimalOpSetCheck::check(), RegisterQuantityCheck::checkPredRegs(), and RegisterQuantityCheck::missingIntRegs().

Here is the call graph for this function:

◆ error()

MachineCheckResults::Error MachineCheckResults::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 MachineCheckResults.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(), and MachineStateBuilder::buildMachineState().

Here is the call graph for this function:

◆ errorCount()

int MachineCheckResults::errorCount ( ) const

Returns the number of errors.

Returns
The number of errors.

Definition at line 56 of file MachineCheckResults.cc.

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

References errors_.

Referenced by RegisterQuantityCheck::checkWithIgnore(), and error().

Member Data Documentation

◆ errors_

ErrorTable MachineCheckResults::errors_
private

Contains the errors.

Definition at line 66 of file MachineCheckResults.hh.

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


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