102 string method =
"OperationSerializer::writeState()";
103 string msg =
"Problems writing the state: " + e.
errorMessage();
125 string method =
"OperationSerializer::readState()";
126 string msg =
"Problems reading the state: " + e.
errorMessage();
132 return operationState;
150 for (
int i = 0; i < state->
childCount(); i++) {
216 for (
int i = 0; i < state->
childCount(); i++) {
273 for (
int j = 0; j < canSwap->
childCount(); j++) {
297 string msg =
"Error while constructing ObjectState tree: " +
320 for (
int i = 0; i < state->
childCount(); i++) {
339 for (
int i = 0; i < state->
childCount(); i++) {
491 string msg =
"Error while constructing ObjectState tree" +
512 for (
int childIndex = 0; childIndex < source->
childCount();
const string SCHEMA_FILE_NAME
const string OPSER_OSAL
XML tag for the module.
const string LIBRARY_NAME
Name of the library.
const string SCHEMA_FILE_NAME
Schema file name.
const double VERSION_NUMBER
The version number.
const string OPSER_VERSION
XML tag for version.
static std::string schemaDirPath(const std::string &prog)
std::string errorMessage() const
void setCause(const Exception &cause)
static const std::string DIRECTORY_SEPARATOR
static bool fileExists(const std::string fileName)
bool hasAttribute(const std::string &name) const
void setAttribute(const std::string &name, const std::string &value)
void setValue(const std::string &value)
ObjectState * child(int index) const
void addChild(ObjectState *child)
std::string stringAttribute(const std::string &name) const
bool boolAttribute(const std::string &name) const
int intAttribute(const std::string &name) const
std::string stringValue() const
static const std::string OPRND_IN
Object state name for input operand.
static const std::string OPRND_CAN_SWAP
Object state name for can swap.
static const std::string OPRND_ELEM_WIDTH
Object state name for element width.
static const std::string OPRND_MEM_UNITS
Object state name for memory unit count.
static const std::string OPRND_TYPE
Object state name for operand type.
static const std::string OPRND_MEM_ADDRESS
Object state name for memory address.
static const std::string OPRND_ELEM_COUNT
Object state name for element count.
static const std::string OPRND_MEM_DATA
Object state name for memory data.
static const std::string OPRND_ID
Object state name for operand id.
ObjectState * toOperation(const ObjectState *state)
ObjectState * convertToOperationFormat(const ObjectState *state)
ObjectState * toXMLFormat(const ObjectState *state)
void setSourceFile(const std::string &filename)
XMLSerializer serializer_
Constructs the ObjectState tree from the XML file.
virtual void writeState(const ObjectState *state)
void setDestinationFile(const std::string &filename)
virtual ObjectState * readState()
void setUseSchema(bool useSchema)
virtual ~OperationSerializer()
ObjectState * convertToXMLFormat(const ObjectState *state)
void setSchemaFile(const std::string &filename)
void setOperandProperties(ObjectState *operand, ObjectState *source)
static const char * OPRN_CONTROL_FLOW
Object state name for control flow property.
static const char * OPRN_ISBRANCH
Object state name for branch property.
static const char * OPRN_DESCRIPTION
Object state name for description.
static const char * OPRN_IN
Object state name for input operand.
static const char * OPRN_CLOCKED
Object state name for clockedness.
static const char * OPRN_TRAP
Object state name for trap.
static const char * OPRN_OPERATION
Object state name for operation.
static const char * OPRN_ISCALL
Object state name for call property.
static const char * OPRN_SIDE_EFFECTS
Object state name for side effects.
static const char * OPRN_READS_MEMORY
Object state name for reads memory.
static const char * OPRN_OUT
Object state name for output operand.
static const char * OPRN_OUTPUTS
Object state name for outputs.
static const char * OPRN_NAME
Object state name for name.
static const char * OPRN_INPUTS
Object state name for inputs.
static const char * OPRN_WRITES_MEMORY
Object state name for writes memory.
void setUseSchema(bool useSchema)
void setSchemaFile(const std::string &fileName)
void setSourceFile(const std::string &fileName)
virtual void writeState(const ObjectState *rootState)
void setDestinationFile(const std::string &fileName)
virtual ObjectState * readState()