XMLIODelegate Class Reference

Concrete implementation of the IFileIODelegate interface. This class supports reading/writing of the data model and data to and from XML files. More...

Inherits IFileIODelegate.

Inheritance diagram for XMLIODelegate:

Inheritance graph
[legend]
Collaboration diagram for XMLIODelegate:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XMLIODelegate ()
virtual ~XMLIODelegate ()
int32 writeModelToFile (const std::string &fileName, IDataModel::Pointer model, bool closeWhenFinished, bool deleteExisting)
 Writes the Model to a data file.
int32 readModelFromFile (const std::string &fileName, IDataModel::Pointer model, bool closeWhenFinished, bool openReadOnly)
 Deserializes a Datamodel from a file on disk.
bool supportedMXAFileVersion (float version)
 Checks if the file version of the data file is with in the bounds of the library to read/parse the data model.
bool isMXAFile (const std::string &fileName)
 Is the file describe by an absolute path an MXA based data file.
bool isMXAFile (int32 identifier)
 Is the file identified by the given identifier an MXA Base data file.
int32 openMXAFile (std::string filename, bool readOnly=false)
 Opens an existing MXA Data File. IE an HDF5 file with the proper data model encoded.
void closeMXAFile ()
 Closes the currently open file.
int32 getOpenFileId ()
 Returns the HDF file id of the currently open file.
std::string getOpenFileName ()
 Returns the currently open filename as an absolute path.

Private Member Functions

 XMLIODelegate (const XMLIODelegate &)
void operator= (const XMLIODelegate &)

Private Attributes

std::string _openFile
int32 _fileId

Detailed Description

Concrete implementation of the IFileIODelegate interface. This class supports reading/writing of the data model and data to and from XML files.

Author:
Mike Jackson
Date:
June 2007
Version:
Revision
1.2


Constructor & Destructor Documentation

XMLIODelegate::XMLIODelegate (  ) 

XMLIODelegate::~XMLIODelegate (  )  [virtual]

XMLIODelegate::XMLIODelegate ( const XMLIODelegate  )  [private]


Member Function Documentation

MXATypes::MXAError XMLIODelegate::writeModelToFile ( const std::string &  fileName,
IDataModel::Pointer  model,
bool  closeWhenFinished,
bool  deleteExisting 
) [virtual]

Writes the Model to a data file.

Parameters:
fileName The name of the file (and path if needed) to write the model to
model The Model to serialize
closeWhenFinished 
deleteExisting 
Returns:
MXAError - Zero or Positive values are success. Negative values are errors

Implements IFileIODelegate.

MXATypes::MXAError XMLIODelegate::readModelFromFile ( const std::string &  fileName,
IDataModel::Pointer  model,
bool  closeWhenFinished,
bool  openReadOnly 
) [virtual]

Deserializes a Datamodel from a file on disk.

Parameters:
fileName The name of the file (including path) to deserialize from
model The model to read the information into
closeWhenFinished 
openReadOnly 
Returns:
A pointer to a new'ed MXADataModel Object. It is up to the Programmer to release the Object. If an Error occurs during the reading, then a NULL pointer is returned.

Implements IFileIODelegate.

bool XMLIODelegate::supportedMXAFileVersion ( float  version  )  [virtual]

Checks if the file version of the data file is with in the bounds of the library to read/parse the data model.

Parameters:
version The version to check.

Implements IFileIODelegate.

bool XMLIODelegate::isMXAFile ( const std::string &  fileName  )  [virtual]

Is the file describe by an absolute path an MXA based data file.

Parameters:
fileName The data file to check
Returns:
True if the file is MXA based

Implements IFileIODelegate.

bool XMLIODelegate::isMXAFile ( int32  identifier  ) 

Is the file identified by the given identifier an MXA Base data file.

int32 XMLIODelegate::openMXAFile ( std::string  filename,
bool  readOnly = false 
) [virtual]

Opens an existing MXA Data File. IE an HDF5 file with the proper data model encoded.

Parameters:
filename The absolute path of the file to open
readOnly True if you want the file opened as read only. False if you need to write something to the file
Returns:
HDF5 file id

Implements IFileIODelegate.

void XMLIODelegate::closeMXAFile (  )  [virtual]

Closes the currently open file.

Implements IFileIODelegate.

int32 XMLIODelegate::getOpenFileId (  )  [virtual]

Returns the HDF file id of the currently open file.

Implements IFileIODelegate.

std::string XMLIODelegate::getOpenFileName (  )  [virtual]

Returns the currently open filename as an absolute path.

Implements IFileIODelegate.

void XMLIODelegate::operator= ( const XMLIODelegate  )  [private]


Member Data Documentation

std::string XMLIODelegate::_openFile [private]

int32 XMLIODelegate::_fileId [private]


The documentation for this class was generated from the following files:
Generated on Tue Nov 17 18:43:16 2009 for MXADataModel by  doxygen 1.5.2