IFileIODelegate Class Reference

This is the interface that delegates need to implement in order to serialize/deserialize the model from a data file. More...

Inherited by XMLIODelegate.

Inheritance diagram for IFileIODelegate:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MXA_SHARED_POINTERS (IFileIODelegate)
 MXA_TYPE_MACRO (IFileIODelegate)
virtual ~IFileIODelegate ()
virtual int32 writeModelToFile (const std::string &fileName, IDataModel::Pointer model, bool closeWhenFinished, bool deleteExisting)=0
 Writes the Model to a data file. If the file does NOT exist, a new file will be created. If the data file does exist and does NOT have a model in the file, then the model will be written. If the data file DOES exist and DOES have an existing model then the model information from the passed in model will overwrite the model in the file.
virtual int32 readModelFromFile (const std::string &fileName, IDataModel::Pointer model, bool closeWhenFinished, bool openReadOnly)=0
 Deserializes a Datamodel from a file on disk.
virtual bool supportedMXAFileVersion (float version)=0
 Checks if the file version of the data file is with in the bounds of the library to read/parse the data model.
virtual bool isMXAFile (const std::string &fileName)=0
 Is the file describe by an absolute path an MXA based data file.
virtual int32 openMXAFile (std::string filename, bool readOnly=false)=0
 Opens an existing MXA Data File. IE an HDF5 file with the proper data model encoded.
virtual void closeMXAFile ()=0
 Closes the currently open file.
virtual int32 getOpenFileId ()=0
 Returns the HDF file id of the currently open file.
virtual std::string getOpenFileName ()=0
 Returns the currently open filename as an absolute path.

Protected Member Functions

 IFileIODelegate ()

Private Member Functions

 IFileIODelegate (const IFileIODelegate &)
void operator= (const IFileIODelegate &)

Detailed Description

This is the interface that delegates need to implement in order to serialize/deserialize the model from a data file.

Author:
Mike Jackson
Date:
March 2007
Version:
Revision
1.2
IMXADataModelCode.h


Constructor & Destructor Documentation

virtual IFileIODelegate::~IFileIODelegate (  )  [inline, virtual]

IFileIODelegate::IFileIODelegate (  )  [inline, protected]

IFileIODelegate::IFileIODelegate ( const IFileIODelegate  )  [private]


Member Function Documentation

IFileIODelegate::MXA_SHARED_POINTERS ( IFileIODelegate   ) 

IFileIODelegate::MXA_TYPE_MACRO ( IFileIODelegate   ) 

virtual int32 IFileIODelegate::writeModelToFile ( const std::string &  fileName,
IDataModel::Pointer  model,
bool  closeWhenFinished,
bool  deleteExisting 
) [pure virtual]

Writes the Model to a data file. If the file does NOT exist, a new file will be created. If the data file does exist and does NOT have a model in the file, then the model will be written. If the data file DOES exist and DOES have an existing model then the model information from the passed in model will overwrite the model in the file.

Parameters:
fileName The name of the file (and path if needed) to write the model to
model The Model to serialize
closeWhenFinished Close the file when this operation is complete
deleteExisting Delete existing file of the same name and create a new file
Returns:
MXAError - Zero or Positive values are success. Negative values are errors

Implemented in XMLIODelegate.

virtual int32 IFileIODelegate::readModelFromFile ( const std::string &  fileName,
IDataModel::Pointer  model,
bool  closeWhenFinished,
bool  openReadOnly 
) [pure 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 Close the file when this operation is complete
openReadOnly Opens the file in a read only mode. Nothing can be written to the file
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.

Implemented in XMLIODelegate.

virtual bool IFileIODelegate::supportedMXAFileVersion ( float  version  )  [pure 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.

Implemented in XMLIODelegate.

virtual bool IFileIODelegate::isMXAFile ( const std::string &  fileName  )  [pure 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

Implemented in XMLIODelegate.

virtual int32 IFileIODelegate::openMXAFile ( std::string  filename,
bool  readOnly = false 
) [pure 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

Implemented in XMLIODelegate.

virtual void IFileIODelegate::closeMXAFile (  )  [pure virtual]

Closes the currently open file.

Implemented in XMLIODelegate.

virtual int32 IFileIODelegate::getOpenFileId (  )  [pure virtual]

Returns the HDF file id of the currently open file.

Implemented in XMLIODelegate.

virtual std::string IFileIODelegate::getOpenFileName (  )  [pure virtual]

Returns the currently open filename as an absolute path.

Implemented in XMLIODelegate.

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


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