OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MachineCheckSuite Class Reference

#include <MachineCheckSuite.hh>

Inheritance diagram for MachineCheckSuite:
Inheritance graph
Collaboration diagram for MachineCheckSuite:
Collaboration graph

Public Member Functions

virtual ~MachineCheckSuite ()
 
int checkCount () const
 
const MachineCheckcheck (int index)
 
bool run (const TTAMachine::Machine &machine, MachineCheckResults &results)
 

Protected Member Functions

 MachineCheckSuite ()
 
void addCheck (MachineCheck *check)
 

Private Attributes

std::vector< MachineCheck * > checks_
 Checks contained in the suite. More...
 

Detailed Description

Container for a group machine checks that are meant to be run as a test suite.

Definition at line 51 of file MachineCheckSuite.hh.

Constructor & Destructor Documentation

◆ ~MachineCheckSuite()

MachineCheckSuite::~MachineCheckSuite ( )
virtual

The Destructor.

Definition at line 47 of file MachineCheckSuite.cc.

References checks_, and SequenceTools::deleteAllItems().

Here is the call graph for this function:

◆ MachineCheckSuite()

MachineCheckSuite::MachineCheckSuite ( )
protected

The Cosntructor.

Definition at line 41 of file MachineCheckSuite.cc.

41  {
42 }

Member Function Documentation

◆ addCheck()

void MachineCheckSuite::addCheck ( MachineCheck check)
protected

Adds a check to the suite.

Parameters
checkCheck to add (suite takes ownership of the check object).

Definition at line 97 of file MachineCheckSuite.cc.

97  {
98  checks_.push_back(check);
99 }

References check(), and checks_.

Referenced by BasicMachineCheckSuite::BasicMachineCheckSuite().

Here is the call graph for this function:

◆ check()

const MachineCheck & MachineCheckSuite::check ( int  index)

Definition at line 62 of file MachineCheckSuite.cc.

62  {
63  if (index < 0 || index > checkCount()) {
64  throw OutOfRange(__FILE__, __LINE__, __func__);
65  }
66 
67  return *checks_[index];
68 }

References __func__, checkCount(), and checks_.

Referenced by addCheck(), and run().

Here is the call graph for this function:

◆ checkCount()

int MachineCheckSuite::checkCount ( ) const

Returns number of checks in the suite.

Returns
Suite check count.

Definition at line 57 of file MachineCheckSuite.cc.

57  {
58  return checks_.size();
59 }

References checks_.

Referenced by check(), and run().

◆ run()

bool MachineCheckSuite::run ( const TTAMachine::Machine machine,
MachineCheckResults results 
)

Runs all checks in the check suite.

Parameters
machineMachine to check.
resultsResult container where error messages are added.
Returns
True, if all checks passed, false otherwise.

Definition at line 78 of file MachineCheckSuite.cc.

80  {
81 
82  bool pass = true;
83  for (int i = 0; i < checkCount(); i++) {
84  if (!checks_[i]->check(machine, results)) {
85  pass = false;
86  }
87  }
88  return pass;
89 }

References check(), checkCount(), checks_, and machine.

Here is the call graph for this function:

Member Data Documentation

◆ checks_

std::vector<MachineCheck*> MachineCheckSuite::checks_
private

Checks contained in the suite.

Definition at line 68 of file MachineCheckSuite.hh.

Referenced by addCheck(), check(), checkCount(), run(), and ~MachineCheckSuite().


The documentation for this class was generated from the following files:
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
OutOfRange
Definition: Exception.hh:320
MachineCheckSuite::checks_
std::vector< MachineCheck * > checks_
Checks contained in the suite.
Definition: MachineCheckSuite.hh:68
MachineCheckSuite::check
const MachineCheck & check(int index)
Definition: MachineCheckSuite.cc:62
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
__func__
#define __func__
Definition: Application.hh:67
MachineCheckSuite::checkCount
int checkCount() const
Definition: MachineCheckSuite.cc:57