OpenASIP
2.0
|
#include <FUGuardEncoding.hh>
Public Member Functions | |
FUGuardEncoding (const std::string &fu, const std::string &port, bool inverted, unsigned int encoding, GuardField &parent) | |
FUGuardEncoding (const ObjectState *state, GuardField &parent) | |
virtual | ~FUGuardEncoding () |
std::string | functionUnit () const |
std::string | port () const |
virtual ObjectState * | saveState () const |
Public Member Functions inherited from GuardEncoding | |
virtual | ~GuardEncoding () |
GuardField * | parent () const |
bool | isGuardInverted () const |
unsigned int | encoding () const |
Static Public Attributes | |
static const std::string | OSNAME_FU_GUARD_ENCODING = "fu_guard_enc" |
ObjectState name for FU guard encoding. More... | |
static const std::string | OSKEY_FU_NAME = "fu_name" |
ObjectState attribute key for the name of the function unit. More... | |
static const std::string | OSKEY_PORT_NAME = "port_name" |
ObjectState attribute key for the name of the port. More... | |
Static Public Attributes inherited from GuardEncoding | |
static const std::string | OSNAME_GUARD_ENCODING = "guard_encoding" |
ObjectState name for guard encoding. More... | |
static const std::string | OSKEY_INVERTED = "inverted" |
ObjectState attribute key for invert flag. More... | |
static const std::string | OSKEY_ENCODING = "encoding" |
ObjectState attribute key for encoding. More... | |
Private Attributes | |
std::string | functionUnit_ |
Name of the function unit. More... | |
std::string | port_ |
Name of the port. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from GuardEncoding | |
GuardEncoding (bool inverted, unsigned int encoding) | |
GuardEncoding (const ObjectState *state) | |
void | setParent (GuardField *parent) |
The FUGuardEncoding class maps a guard expression with FU output port term to a control code.
Instances of this class are always registered to a guard field.
Definition at line 47 of file FUGuardEncoding.hh.
FUGuardEncoding::FUGuardEncoding | ( | const std::string & | fu, |
const std::string & | port, | ||
bool | inverted, | ||
unsigned int | encoding, | ||
GuardField & | parent | ||
) |
The constructor.
Creates a guard encoding and registers it into the given guard field. The guard expression is identified by the name of function unit and port, and the "invert" flag, all given as parameters.
fu | Name of the function unit. |
port | Name of the port. |
inverted | The "invert" flag. |
encoding | The control code of the guard expression. |
parent | The parent guard field. |
ObjectAlreadyExists | If the guard expression is already encoded in the parent field, or if the given control code is already assigned to another guard expression. |
Definition at line 62 of file FUGuardEncoding.cc.
References GuardField::addGuardEncoding(), GuardEncoding::parent(), and GuardEncoding::setParent().
FUGuardEncoding::FUGuardEncoding | ( | const ObjectState * | state, |
GuardField & | parent | ||
) |
The constructor.
Loads the state of the object from the given ObjectState instance.
state | The ObjectState instance. |
parent | The parent guard field. |
ObjectStateLoadingException | If an error occurs while loading the state. |
ObjectAlreadyExists | If the guard expression if already encoded in the parent field, or if the given control code is already assigned to another guard expression. |
Definition at line 84 of file FUGuardEncoding.cc.
References GuardField::addGuardEncoding(), Exception::errorMessage(), functionUnit_, ObjectState::name(), OSKEY_FU_NAME, OSKEY_PORT_NAME, OSNAME_FU_GUARD_ENCODING, GuardEncoding::parent(), port_, GuardEncoding::setParent(), and ObjectState::stringAttribute().
|
virtual |
The destructor.
Definition at line 107 of file FUGuardEncoding.cc.
References GuardEncoding::parent(), GuardField::removeGuardEncoding(), and GuardEncoding::setParent().
std::string FUGuardEncoding::functionUnit | ( | ) | const |
Returns the name of the function unit that contains the port of this guard expression.
Definition at line 121 of file FUGuardEncoding.cc.
References functionUnit_.
Referenced by GuardField::addGuardEncoding(), DefaultDecoderGenerator::findGuard(), GuardField::fuGuardEncoding(), GuardField::hasFUGuardEncoding(), printGuardFieldEncodings(), and saveState().
std::string FUGuardEncoding::port | ( | ) | const |
Returns the name of the FU port of this guard expression.
Definition at line 132 of file FUGuardEncoding.cc.
References port_.
Referenced by GuardField::addGuardEncoding(), DefaultDecoderGenerator::findGuard(), GuardField::fuGuardEncoding(), GuardField::hasFUGuardEncoding(), printGuardFieldEncodings(), and saveState().
|
virtual |
Saves the state of the object to an ObjectState instance.
Reimplemented from GuardEncoding.
Definition at line 143 of file FUGuardEncoding.cc.
References functionUnit(), OSKEY_FU_NAME, OSKEY_PORT_NAME, OSNAME_FU_GUARD_ENCODING, port(), GuardEncoding::saveState(), ObjectState::setAttribute(), and ObjectState::setName().
Referenced by GuardField::saveState().
|
private |
Name of the function unit.
Definition at line 69 of file FUGuardEncoding.hh.
Referenced by FUGuardEncoding(), and functionUnit().
|
static |
ObjectState attribute key for the name of the function unit.
Definition at line 63 of file FUGuardEncoding.hh.
Referenced by FUGuardEncoding(), BEMSerializer::guardFieldToFile(), BEMSerializer::guardFieldToOM(), and saveState().
|
static |
ObjectState attribute key for the name of the port.
Definition at line 65 of file FUGuardEncoding.hh.
Referenced by FUGuardEncoding(), BEMSerializer::guardFieldToFile(), BEMSerializer::guardFieldToOM(), and saveState().
|
static |
ObjectState name for FU guard encoding.
Definition at line 61 of file FUGuardEncoding.hh.
Referenced by FUGuardEncoding(), BEMSerializer::guardFieldToFile(), BEMSerializer::guardFieldToOM(), GuardField::loadState(), and saveState().
|
private |
Name of the port.
Definition at line 71 of file FUGuardEncoding.hh.
Referenced by FUGuardEncoding(), and port().