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

#include <EntryKeyData.hh>

Inheritance diagram for EntryKeyDataFunctionUnit:
Inheritance graph
Collaboration diagram for EntryKeyDataFunctionUnit:
Collaboration graph

Public Member Functions

 EntryKeyDataFunctionUnit ()
 
 EntryKeyDataFunctionUnit (const TTAMachine::FunctionUnit *fieldData)
 
virtual ~EntryKeyDataFunctionUnit ()
 
EntryKeyDatacopy () const
 
bool isEqual (const EntryKeyData *fieldData) const
 
bool isGreater (const EntryKeyData *fieldData) const
 
bool isSmaller (const EntryKeyData *fieldData) const
 
double coefficient (const EntryKeyData *data1, const EntryKeyData *data2) const
 
std::string toString () const
 
- Public Member Functions inherited from EntryKeyData
 EntryKeyData ()
 
virtual ~EntryKeyData ()
 

Private Member Functions

 EntryKeyDataFunctionUnit (const EntryKeyDataFunctionUnit &)
 Copying not allowed. More...
 
EntryKeyDataFunctionUnitoperator= (const EntryKeyDataFunctionUnit &)
 Assignment not allowed. More...
 

Private Attributes

const TTAMachine::FunctionUnitdata_
 FunctionUnit* data. More...
 

Detailed Description

Implementation for FunctionUnit type of data.

Definition at line 193 of file EntryKeyData.hh.

Constructor & Destructor Documentation

◆ EntryKeyDataFunctionUnit() [1/3]

EntryKeyDataFunctionUnit::EntryKeyDataFunctionUnit ( )

Default constructor.

Definition at line 602 of file EntryKeyData.cc.

602  : data_() {
603 }

Referenced by copy().

◆ EntryKeyDataFunctionUnit() [2/3]

EntryKeyDataFunctionUnit::EntryKeyDataFunctionUnit ( const TTAMachine::FunctionUnit fieldData)

Constructor.

Parameters
fieldDataA set of parameters.

Definition at line 610 of file EntryKeyData.cc.

611  : data_(fieldData) {
612 }

◆ ~EntryKeyDataFunctionUnit()

EntryKeyDataFunctionUnit::~EntryKeyDataFunctionUnit ( )
virtual

Destructor.

Definition at line 617 of file EntryKeyData.cc.

617  {
618 }

◆ EntryKeyDataFunctionUnit() [3/3]

EntryKeyDataFunctionUnit::EntryKeyDataFunctionUnit ( const EntryKeyDataFunctionUnit )
private

Copying not allowed.

Member Function Documentation

◆ coefficient()

double EntryKeyDataFunctionUnit::coefficient ( const EntryKeyData data1,
const EntryKeyData data2 
) const
virtual

Cannot be called for EntryKeyDataFunctionUnit.

FunctionUnits cannot be compared with greater of smaller and no coefficient can be counted.

Parameters
data1Nothing.
data2Nothing.
Returns
Nothing
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 696 of file EntryKeyData.cc.

697  {
698  throw WrongSubclass(__FILE__, __LINE__,
699  "EntryKeyDataFunctionUnit::coefficient");
700  return 0.0; // stupid return statement to keep compiler quiet
701 }

◆ copy()

EntryKeyData * EntryKeyDataFunctionUnit::copy ( ) const
virtual

Copies the set of parameters.

Client is responsible of deallocating the memory reserved for the returned object.

Returns
A copy of the parameter set.

Implements EntryKeyData.

Definition at line 629 of file EntryKeyData.cc.

629  {
630  return new EntryKeyDataFunctionUnit(data_);
631 }

References data_, and EntryKeyDataFunctionUnit().

Here is the call graph for this function:

◆ isEqual()

bool EntryKeyDataFunctionUnit::isEqual ( const EntryKeyData fieldData) const
virtual

Checks if two FunctionUnits are equal

Cannot compare to other data types.

Parameters
fieldDataFunctionUnit pointer.
Returns
True if two FunctionUnits are equal.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 643 of file EntryKeyData.cc.

643  {
644  EntryKeyDataFunctionUnit* data = dynamic_cast<EntryKeyDataFunctionUnit*>(
645  const_cast<EntryKeyData*>(fieldData));
646  if (data == NULL) {
647  throw WrongSubclass(__FILE__, __LINE__,
648  "EntryKeyDataFunctionUnit::isEqual");
649  }
650 
651  return data_->isArchitectureEqual(data->data_, false);
652 }

References data_, and TTAMachine::FunctionUnit::isArchitectureEqual().

Here is the call graph for this function:

◆ isGreater()

bool EntryKeyDataFunctionUnit::isGreater ( const EntryKeyData fieldData) const
virtual

Checks if another EntryKeyDataFunctionUnit is greater.

Cannot compare to other data types. Cannot say which is greater in case of FunctionUnits and false is returned always.

Parameters
fieldDataFunctionUnit*.
Returns
Always false.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 665 of file EntryKeyData.cc.

665  {
666  return false;
667 }

◆ isSmaller()

bool EntryKeyDataFunctionUnit::isSmaller ( const EntryKeyData fieldData) const
virtual

Checks if another EntryKeyDataFunctionUnit is smaller.

Cannot compare to other data types. Cannot say which is smaller in case of FunctionUnits and true is returned always.

Parameters
fieldDataFunctionUnit*.
Returns
Always true.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 680 of file EntryKeyData.cc.

680  {
681  return true;
682 }

◆ operator=()

EntryKeyDataFunctionUnit& EntryKeyDataFunctionUnit::operator= ( const EntryKeyDataFunctionUnit )
private

Assignment not allowed.

◆ toString()

std::string EntryKeyDataFunctionUnit::toString ( ) const
virtual

Converts the FunctionUnit name and operations into a string.

Returns
FunctionUnit name and operations as a string.

Implements EntryKeyData.

Definition at line 709 of file EntryKeyData.cc.

709  {
710 
711  string result = "";
712  result += data_->name();
713  result += ":";
714  for (int i = 0; i < data_->operationCount(); i++) {
715  result += data_->operation(i)->name();
716  if ((i + 1) < data_->operationCount()) {
717  result += "_";
718  }
719  }
720  return result;
721 }

References data_, TTAMachine::HWOperation::name(), TTAMachine::Component::name(), TTAMachine::FunctionUnit::operation(), and TTAMachine::FunctionUnit::operationCount().

Here is the call graph for this function:

Member Data Documentation

◆ data_

const TTAMachine::FunctionUnit* EntryKeyDataFunctionUnit::data_
private

FunctionUnit* data.

Definition at line 209 of file EntryKeyData.hh.

Referenced by copy(), isEqual(), and toString().


The documentation for this class was generated from the following files:
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
EntryKeyDataFunctionUnit::data_
const TTAMachine::FunctionUnit * data_
FunctionUnit* data.
Definition: EntryKeyData.hh:209
EntryKeyData
Definition: EntryKeyData.hh:53
EntryKeyDataFunctionUnit::EntryKeyDataFunctionUnit
EntryKeyDataFunctionUnit()
Definition: EntryKeyData.cc:602
TTAMachine::HWOperation::name
const std::string & name() const
Definition: HWOperation.cc:141
WrongSubclass
Definition: Exception.hh:336
TTAMachine::FunctionUnit::operationCount
virtual int operationCount() const
Definition: FunctionUnit.cc:419
EntryKeyDataFunctionUnit
Definition: EntryKeyData.hh:193
TTAMachine::FunctionUnit::operation
virtual HWOperation * operation(const std::string &name) const
Definition: FunctionUnit.cc:363
TTAMachine::FunctionUnit::isArchitectureEqual
virtual bool isArchitectureEqual(const FunctionUnit *fu, const bool checkPortWidths=true) const
Definition: FunctionUnit.cc:747