OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MachineCheck Class Referenceabstract

#include <MachineCheck.hh>

Inheritance diagram for MachineCheck:
Inheritance graph
Collaboration diagram for MachineCheck:
Collaboration graph

Public Member Functions

virtual std::string shortDescription () const
 
virtual std::string description () const
 
virtual bool check (const TTAMachine::Machine &mach, MachineCheckResults &results) const =0
 
virtual bool canFix (const TTAMachine::Machine &mach) const
 
virtual std::string fix (TTAMachine::Machine &mach) const
 
virtual ~MachineCheck ()
 

Protected Member Functions

 MachineCheck (const std::string &shortDesc_)
 

Private Attributes

const std::string & shortDesc_
 Short description of the check. More...
 

Detailed Description

Base class for checks to perform on a machine.

Definition at line 50 of file MachineCheck.hh.

Constructor & Destructor Documentation

◆ ~MachineCheck()

MachineCheck::~MachineCheck ( )
virtual

The Destructor.

Definition at line 48 of file MachineCheck.cc.

48  {
49 }

◆ MachineCheck()

MachineCheck::MachineCheck ( const std::string &  shortDesc)
protected

The Constructor.

Parameters
shortDescThe short description of the check.

Definition at line 41 of file MachineCheck.cc.

41  :
42  shortDesc_(shortDesc) {
43 }

Member Function Documentation

◆ canFix()

bool MachineCheck::canFix ( const TTAMachine::Machine mach) const
virtual

Returns true if the checker can automatically fix the machine to pass the check.

Returns
Base class implementation returns always false.

Reimplemented in MinimalOpSetCheck, and FullyConnectedCheck.

Definition at line 79 of file MachineCheck.cc.

79  {
80  return false;
81 }

◆ check()

virtual bool MachineCheck::check ( const TTAMachine::Machine mach,
MachineCheckResults results 
) const
pure virtual

◆ description()

std::string MachineCheck::description ( ) const
virtual

Returns description of the checker.

Base class implementation returns the checker short description as the long description.

Definition at line 68 of file MachineCheck.cc.

68  {
69  return shortDescription();
70 }

References shortDescription().

Here is the call graph for this function:

◆ fix()

std::string MachineCheck::fix ( TTAMachine::Machine mach) const
virtual

Automatically fixes the machine to pass the test.

The base class implementation always throws InvalidObject.

Returns
Short description of the modifications to the machine.
Exceptions
InvalidDataIf the machine can't be fixed automatically.

Reimplemented in MinimalOpSetCheck, and FullyConnectedCheck.

Definition at line 92 of file MachineCheck.cc.

92  {
93  throw InvalidData(__FILE__, __LINE__, __func__);
94 }

References __func__.

◆ shortDescription()

std::string MachineCheck::shortDescription ( ) const
virtual

Returns short description of the checker.

Definition at line 56 of file MachineCheck.cc.

56  {
57  return shortDesc_;
58 }

References shortDesc_.

Referenced by description().

Member Data Documentation

◆ shortDesc_

const std::string& MachineCheck::shortDesc_
private

Short description of the check.

Definition at line 69 of file MachineCheck.hh.

Referenced by shortDescription().


The documentation for this class was generated from the following files:
MachineCheck::shortDescription
virtual std::string shortDescription() const
Definition: MachineCheck.cc:56
InvalidData
Definition: Exception.hh:149
MachineCheck::shortDesc_
const std::string & shortDesc_
Short description of the check.
Definition: MachineCheck.hh:69
__func__
#define __func__
Definition: Application.hh:67