OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
ProDeOptionsSerializer Class Reference

#include <ProDeOptionsSerializer.hh>

Inheritance diagram for ProDeOptionsSerializer:
Inheritance graph
Collaboration diagram for ProDeOptionsSerializer:
Collaboration graph

Public Member Functions

 ProDeOptionsSerializer ()
 
virtual ~ProDeOptionsSerializer ()
 
- Public Member Functions inherited from GUIOptionsSerializer
 GUIOptionsSerializer (std::string configurationName)
 
virtual ~GUIOptionsSerializer ()
 
void writeState (const ObjectState *optionsState)
 
ObjectStatereadState ()
 
void writeOptions (const GUIOptions &options)
 
GUIOptionsreadOptions ()
 
- Public Member Functions inherited from XMLSerializer
 XMLSerializer ()
 
virtual ~XMLSerializer ()
 
void setSourceFile (const std::string &fileName)
 
void setSourceString (const std::string &source)
 
void setDestinationFile (const std::string &fileName)
 
void setDestinationString (std::string &destination)
 
void setSchemaFile (const std::string &fileName)
 
void setUseSchema (bool useSchema)
 
void setXMLNamespace (std::string nsUri)
 
- Public Member Functions inherited from TCETools::Serializer
virtual ~Serializer ()
 

Private Member Functions

ObjectStateconvertToConfigFileFormat (const ObjectState *options) const
 
ObjectStateconvertToOptionsObjectFormat (const ObjectState *root) const
 
 ProDeOptionsSerializer (const ProDeOptionsSerializer &)
 Copying not allowed.
 
ProDeOptionsSerializeroperator= (const ProDeOptionsSerializer &)
 Assignment not allowed.
 

Additional Inherited Members

- Protected Member Functions inherited from XMLSerializer
std::string sourceFile () const
 

Detailed Description

Reads/writes ProDe options from/to an XML file.

Definition at line 43 of file ProDeOptionsSerializer.hh.

Constructor & Destructor Documentation

◆ ProDeOptionsSerializer() [1/2]

ProDeOptionsSerializer::ProDeOptionsSerializer ( )

Constructor.

Definition at line 53 of file ProDeOptionsSerializer.cc.

53 :
55}
static const std::string CONFIGURATION_NAME
ObjectState name for ProDeOptions.

◆ ~ProDeOptionsSerializer()

ProDeOptionsSerializer::~ProDeOptionsSerializer ( )
virtual

Destructor.

Definition at line 61 of file ProDeOptionsSerializer.cc.

61 {
62}

◆ ProDeOptionsSerializer() [2/2]

ProDeOptionsSerializer::ProDeOptionsSerializer ( const ProDeOptionsSerializer )
private

Copying not allowed.

Member Function Documentation

◆ convertToConfigFileFormat()

ObjectState * ProDeOptionsSerializer::convertToConfigFileFormat ( const ObjectState options) const
privatevirtual

Converts the given ObjectState tree created by ProDeOptions::saveState to the format of configuration file.

Parameters
optionsObjectState tree to be converted.
Returns
The newly created ObjectState tree which matches with configuration file format.

Reimplemented from GUIOptionsSerializer.

Definition at line 74 of file ProDeOptionsSerializer.cc.

75 {
76
77 ObjectState* root =
79
80 // add undo stack size
81 ObjectState* undoStack = new ObjectState(UNDO);
82 root->addChild(undoStack);
83 undoStack->setAttribute(
84 UNDO_SIZE, options->stringAttribute(
86
87 return root;
88}
static MachInfoCmdLineOptions options
Definition MachInfo.cc:46
const string UNDO
Name of the element declaring the size of the undo stack.
const string UNDO_SIZE
Name of the attribute of the undo element.
virtual ObjectState * convertToConfigFileFormat(const ObjectState *options) const
void setAttribute(const std::string &name, const std::string &value)
void addChild(ObjectState *child)
static const std::string OSKEY_UNDO_STACK_SIZE
ObjectState attribute key for the size of the undo stack.

References ObjectState::addChild(), GUIOptionsSerializer::convertToConfigFileFormat(), options, ProDeOptions::OSKEY_UNDO_STACK_SIZE, ObjectState::setAttribute(), UNDO, and UNDO_SIZE.

Here is the call graph for this function:

◆ convertToOptionsObjectFormat()

ObjectState * ProDeOptionsSerializer::convertToOptionsObjectFormat ( const ObjectState root) const
privatevirtual

Creates a new ObjectState tree which can be given to ProDeOptions constructor. The tree is created according to the given tree which matches with the syntax of the options file.

Parameters
rootRoot node of the ObjectState tree to be converted.

Reimplemented from GUIOptionsSerializer.

Definition at line 99 of file ProDeOptionsSerializer.cc.

100 {
101
104
105 // set undo stack size
106 if (root->hasChild(UNDO)) {
107 ObjectState* undo = root->childByName(UNDO);
108 options->setAttribute(
111 } else {
112 options->setAttribute(
114 }
115
116 return options;
117}
const int DEFAULT_UNDO_SIZE
Default undo stack size.
virtual ObjectState * convertToOptionsObjectFormat(const ObjectState *root) const
ObjectState * childByName(const std::string &name) const
bool hasChild(const std::string &name) const
std::string stringAttribute(const std::string &name) const

References ObjectState::childByName(), GUIOptionsSerializer::convertToOptionsObjectFormat(), DEFAULT_UNDO_SIZE, ObjectState::hasChild(), options, ProDeOptions::OSKEY_UNDO_STACK_SIZE, ObjectState::stringAttribute(), UNDO, and UNDO_SIZE.

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.


The documentation for this class was generated from the following files: