Go to the documentation of this file.
37 #include <boost/format.hpp>
76 Serializable(), index_(0), isInput_(isInput), type_(SINT_WORD),
77 elementCount_(1), isAddress_(
false), addressUnits_(0),
78 isMemoryData_(
false) {
88 Serializable(), index_(index), isInput_(isInput), type_(type),
89 elementCount_(1), isAddress_(
false), addressUnits_(0),
90 isMemoryData_(
false) {
100 Serializable(), index_(op.index()), isInput_(op.isInput()),
101 type_(op.type()), elementWidth_(op.elementWidth()),
102 elementCount_(op.elementCount()), isAddress_(op.isAddress()),
103 addressUnits_(op.addressUnits_), isMemoryData_(op.isMemoryData()),
227 switch (this->
type()) {
250 return type +
" char";
253 return type +
" short";
256 return type +
" long";
258 return type +
" int";
386 string method =
"Operand::loadState()";
411 string msg =
"Invalid operand type: \"" +
typeString +
"\"";
412 throw Exception(__FILE__, __LINE__, method, msg);
435 string msg =
"Erronous number of children";
436 throw Exception(__FILE__, __LINE__, method, msg);
439 for (
int j = 0; j < state->
childCount(); j++) {
442 for (
int i = 0; i < child->
childCount(); i++) {
449 string msg =
"Unknown attribute: " + child->
name();
450 throw Exception(__FILE__, __LINE__, method, msg);
455 string message =
"Conversion failed: " + n.
errorMessage();
457 __FILE__, __LINE__, method, message);
460 string message =
"Attribute not found: " + k.
errorMessage();
462 __FILE__, __LINE__, method, message);
467 "Error while loading operation operand settings. "
470 __FILE__, __LINE__,
__func__, message);
476 "Error while loading operation operand settings. "
477 "An error in the operation format?";
479 __FILE__, __LINE__,
__func__, message);
536 if (
swap_.size() > 0) {
538 set<int>::const_iterator it =
swap_.begin();
539 while (it !=
swap_.end()) {
542 canSwap->addChild(canSwapChild);
int elementCount_
Number of total elements.
static const std::string OPRND_ELEM_COUNT
Object state name for element count.
bool hasAttribute(const std::string &name) const
static const std::string OPRND_MEM_DATA
Object state name for memory data.
virtual void setElementCount(int elementCount)
static const std::string SINT_WORD_STRING
std::string stringAttribute(const std::string &name) const
virtual bool isOutput() const
static const std::string SLONG_WORD_STRING
static const std::string OPRND_MEM_ADDRESS
Object state name for memory address.
virtual bool isAddress() const
int addressUnits_
size of the data this operation addresses. 0 if unknown.
static const std::string OPRND_MEM_UNITS
Object state name for memory unit count.
virtual ObjectState * saveState() const
virtual int elementCount() const
int elementWidth_
Width of an element.
bool isAddress_
Flag indicating whether Operand is address or not.
virtual bool isMemoryData() const
virtual bool isInput() const
virtual int width() const
virtual void setType(OperandType type)
static const std::string OPRND_CAN_SWAP
Object state name for can swap.
void setCause(const Exception &cause)
virtual void setElementWidth(int elementWidth)
virtual int elementWidth() const
static const std::string OPRND_OUT
Object state name for output operand.
virtual bool isOutput() const
static const std::string RAW_DATA_STRING
static const std::string HALF_FLOAT_WORD_STRING
static const std::string FLOAT_WORD_STRING
virtual bool isVector() const
virtual bool canSwap(const Operand &op) const
static const std::string OPRND_ID
Object state name for operand id.
#define abortWithError(message)
virtual bool canSwap(const Operand &op) const
bool isInput_
Direction of operand.
static const std::string DOUBLE_WORD_STRING
virtual const std::string & typeString() const
virtual const std::set< int > & swap() const
static const std::string UINT_WORD_STRING
virtual int index() const
std::string errorMessageStack(bool messagesOnly=false) const
ObjectState * child(int index) const
void addChild(ObjectState *child)
std::set< int > swap_
Indexes of Operands which can be swapped with this Operand.
static const std::string OPRND_IN
Object state name for input operand.
std::string errorMessage() const
static const std::string UNKNOWN_TYPE_STRING
static const std::string OPRND_TYPE
Object state name for operand type.
static const std::string OPRND_ELEM_WIDTH
Object state name for element width.
static NullOperand * instance_
Unique instance.
virtual OperandType type() const
find Finds info of the inner loops in the false
bool boolAttribute(const std::string &name) const
virtual TCEString CTypeString() const
virtual bool isMemoryData() const
OperandType type_
Type of the Operand.
virtual int memoryUnits() const
static const std::string BOOL_STRING
int intAttribute(const std::string &name) const
virtual int index() const
virtual bool isAddress() const
static int toInt(const T &source)
bool isMemoryData_
Flag indicating whether Operand is memory data or not.
virtual bool isInput() const
std::set< int > swap_
Needed for one method, always empty.
static const std::string ULONG_WORD_STRING
static int defaultElementWidth(OperandType type)
int index_
Index of the Operand.
void setAttribute(const std::string &name, const std::string &value)
virtual void loadState(const ObjectState *state)
virtual const std::set< int > & swap() const