OpenASIP
2.0
|
#include <GPRGuardEncoding.hh>
Public Member Functions | |
GPRGuardEncoding (const std::string ®File, int index, bool inverted, unsigned int encoding, GuardField &parent) | |
GPRGuardEncoding (const ObjectState *state, GuardField &parent) | |
virtual | ~GPRGuardEncoding () |
std::string | registerFile () const |
int | registerIndex () 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_GPR_GUARD_ENCODING |
ObjectState name for GPR guard encoding. More... | |
static const std::string | OSKEY_RF_NAME = "rf_name" |
ObjectState attribute key for the name of the register file. More... | |
static const std::string | OSKEY_REGISTER_INDEX = "reg_index" |
ObjectState attribute key for register index. 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 | regFile_ |
Name of the register file. More... | |
int | index_ |
Register index. 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 GPRGuardEncoding class maps a guard expression with general purpose register term to a control code.
Instances of this class are always registered to a guard field.
Definition at line 47 of file GPRGuardEncoding.hh.
GPRGuardEncoding::GPRGuardEncoding | ( | const std::string & | regFile, |
int | index, | ||
bool | inverted, | ||
unsigned int | encoding, | ||
GuardField & | parent | ||
) |
The constructor.
Creates a guard encoding and Registers it into the given guard field automatically. The guard expression is identified by the name of register file, the index of the GPR and the "invert" flag, all given as parameters.
regFile | Name of the register file. |
index | The index the GPR. |
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 63 of file GPRGuardEncoding.cc.
References GuardField::addGuardEncoding(), GuardEncoding::parent(), and GuardEncoding::setParent().
GPRGuardEncoding::GPRGuardEncoding | ( | 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 is already encoded in the parent field, or if the given control code is already assigned to another guard expression. |
Definition at line 85 of file GPRGuardEncoding.cc.
References GuardField::addGuardEncoding(), Exception::errorMessage(), index_, ObjectState::intAttribute(), ObjectState::name(), OSKEY_REGISTER_INDEX, OSKEY_RF_NAME, OSNAME_GPR_GUARD_ENCODING, GuardEncoding::parent(), regFile_, GuardEncoding::setParent(), and ObjectState::stringAttribute().
|
virtual |
The destructor.
Definition at line 108 of file GPRGuardEncoding.cc.
References GuardEncoding::parent(), GuardField::removeGuardEncoding(), and GuardEncoding::setParent().
std::string GPRGuardEncoding::registerFile | ( | ) | const |
Returns the name of the register file that contains the GPR of this guard expression.
Definition at line 122 of file GPRGuardEncoding.cc.
References regFile_.
Referenced by GuardField::addGuardEncoding(), DefaultDecoderGenerator::findGuard(), GuardField::gprGuardEncoding(), GuardField::hasGPRGuardEncoding(), printGuardFieldEncodings(), and saveState().
int GPRGuardEncoding::registerIndex | ( | ) | const |
Returns the index of the GPR of this guard expression.
Definition at line 133 of file GPRGuardEncoding.cc.
References index_.
Referenced by GuardField::addGuardEncoding(), DefaultDecoderGenerator::findGuard(), GuardField::gprGuardEncoding(), GuardField::hasGPRGuardEncoding(), printGuardFieldEncodings(), and saveState().
|
virtual |
Saves the state of the object to an ObjectState instance.
Reimplemented from GuardEncoding.
Definition at line 144 of file GPRGuardEncoding.cc.
References OSKEY_REGISTER_INDEX, OSKEY_RF_NAME, OSNAME_GPR_GUARD_ENCODING, registerFile(), registerIndex(), GuardEncoding::saveState(), ObjectState::setAttribute(), and ObjectState::setName().
Referenced by GuardField::saveState().
|
private |
Register index.
Definition at line 71 of file GPRGuardEncoding.hh.
Referenced by GPRGuardEncoding(), and registerIndex().
|
static |
ObjectState attribute key for register index.
Definition at line 65 of file GPRGuardEncoding.hh.
Referenced by GPRGuardEncoding(), BEMSerializer::guardFieldToFile(), BEMSerializer::guardFieldToOM(), and saveState().
|
static |
ObjectState attribute key for the name of the register file.
Definition at line 63 of file GPRGuardEncoding.hh.
Referenced by GPRGuardEncoding(), BEMSerializer::guardFieldToFile(), BEMSerializer::guardFieldToOM(), and saveState().
|
static |
ObjectState name for GPR guard encoding.
Definition at line 61 of file GPRGuardEncoding.hh.
Referenced by GPRGuardEncoding(), BEMSerializer::guardFieldToFile(), BEMSerializer::guardFieldToOM(), GuardField::loadState(), and saveState().
|
private |
Name of the register file.
Definition at line 69 of file GPRGuardEncoding.hh.
Referenced by GPRGuardEncoding(), and registerFile().