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

#include <OSEdOptionsSerializer.hh>

Inheritance diagram for OSEdOptionsSerializer:
Inheritance graph
Collaboration diagram for OSEdOptionsSerializer:
Collaboration graph

Public Member Functions

 OSEdOptionsSerializer ()
 
virtual ~OSEdOptionsSerializer ()
 
virtual void writeState (const ObjectState *state)
 
virtual ObjectStatereadState ()
 
void setSourceFile (const std::string &fileName)
 
void setDestinationFile (const std::string &fileName)
 
void setSchemaFile (const std::string &fileName)
 
void setUseSchema (bool useSchema)
 
- Public Member Functions inherited from TCETools::Serializer
virtual ~Serializer ()
 

Private Member Functions

 OSEdOptionsSerializer (const OSEdOptionsSerializer &)
 Copying not allowed.
 
OSEdOptionsSerializeroperator= (const OSEdOptionsSerializer &)
 Assignment not allowed.
 

Private Attributes

XMLSerializer serializer_
 Instance of XMLSerializer.
 

Detailed Description

Constructs the ObjectState tree that represents the options of OSEd.

Definition at line 44 of file OSEdOptionsSerializer.hh.

Constructor & Destructor Documentation

◆ OSEdOptionsSerializer() [1/2]

OSEdOptionsSerializer::OSEdOptionsSerializer ( )

Constructor.

Definition at line 40 of file OSEdOptionsSerializer.cc.

◆ ~OSEdOptionsSerializer()

OSEdOptionsSerializer::~OSEdOptionsSerializer ( )
virtual

Destructor.

Definition at line 46 of file OSEdOptionsSerializer.cc.

46 {
47}

◆ OSEdOptionsSerializer() [2/2]

OSEdOptionsSerializer::OSEdOptionsSerializer ( const OSEdOptionsSerializer )
private

Copying not allowed.

Member Function Documentation

◆ operator=()

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

Assignment not allowed.

◆ readState()

ObjectState * OSEdOptionsSerializer::readState ( )
virtual

Reads the options file and returns the corresponding ObjectState tree.

Returns
The read ObjectState tree.

Implements TCETools::Serializer.

Definition at line 71 of file OSEdOptionsSerializer.cc.

71 {
72 ObjectState* root = NULL;
73 try {
74 root = serializer_.readState();
75 } catch (const Exception& e) {
76 string method = "OSEdOptionsSerializer::readState()";
77 string msg = "Problems reading the state: " + e.errorMessage();
78 throw SerializerException(__FILE__, __LINE__, method, msg);
79 }
80 return root;
81}
std::string errorMessage() const
Definition Exception.cc:123
XMLSerializer serializer_
Instance of XMLSerializer.
virtual ObjectState * readState()

References Exception::errorMessage(), XMLSerializer::readState(), and serializer_.

Referenced by OSEd::OnInit().

Here is the call graph for this function:

◆ setDestinationFile()

void OSEdOptionsSerializer::setDestinationFile ( const std::string &  fileName)

Sets the destination file.

Parameters
fileNameThe name of the file.

Definition at line 99 of file OSEdOptionsSerializer.cc.

99 {
101}
void setDestinationFile(const std::string &fileName)

References serializer_, and XMLSerializer::setDestinationFile().

Referenced by OSEd::createDefaultOptions(), and OSEdOptionsDialog::onSave().

Here is the call graph for this function:

◆ setSchemaFile()

void OSEdOptionsSerializer::setSchemaFile ( const std::string &  fileName)

Sets the schema file.

Parameters
fileNameThe name of the file.

Definition at line 109 of file OSEdOptionsSerializer.cc.

109 {
110 serializer_.setSchemaFile(fileName);
111}
void setSchemaFile(const std::string &fileName)

References serializer_, and XMLSerializer::setSchemaFile().

Here is the call graph for this function:

◆ setSourceFile()

void OSEdOptionsSerializer::setSourceFile ( const std::string &  fileName)

Sets the source file.

Parameters
fileNameThe name of the file.

Definition at line 89 of file OSEdOptionsSerializer.cc.

89 {
90 serializer_.setSourceFile(fileName);
91}
void setSourceFile(const std::string &fileName)

References serializer_, and XMLSerializer::setSourceFile().

Referenced by OSEd::OnInit().

Here is the call graph for this function:

◆ setUseSchema()

void OSEdOptionsSerializer::setUseSchema ( bool  useSchema)

Modifies the usage of schema file (yes/no).

Parameters
useSchemaTrue or false, depending on if schema should be used or not.

Definition at line 119 of file OSEdOptionsSerializer.cc.

119 {
120 serializer_.setUseSchema(useSchema);
121}
void setUseSchema(bool useSchema)

References serializer_, and XMLSerializer::setUseSchema().

Here is the call graph for this function:

◆ writeState()

void OSEdOptionsSerializer::writeState ( const ObjectState state)
virtual

Writes the object state tree to XML file.

Parameters
stateState to be written.

Implements TCETools::Serializer.

Definition at line 55 of file OSEdOptionsSerializer.cc.

55 {
56 try {
58 } catch (const Exception& e) {
59 string method = "OSEdOptionsSerializer::writeState()";
60 string msg = "Problems writing the state: " + e.errorMessage();
61 throw SerializerException(__FILE__, __LINE__, method, msg);
62 }
63}
virtual void writeState(const ObjectState *rootState)

References Exception::errorMessage(), serializer_, and XMLSerializer::writeState().

Referenced by OSEd::createDefaultOptions(), and OSEdOptionsDialog::onSave().

Here is the call graph for this function:

Member Data Documentation

◆ serializer_

XMLSerializer OSEdOptionsSerializer::serializer_
private

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