XMLDataModelWriter Class Reference

Concrete implementation of IDataModelWriter that is used to write the data model to an XML file. More...

Inherits IDataModelWriter, IDataDimensionWriter, and IDataRecordWriter.

Inheritance diagram for XMLDataModelWriter:

Inheritance graph
[legend]
Collaboration diagram for XMLDataModelWriter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XMLDataModelWriter (IDataModel::Pointer dataModel, const std::string &fileName)
 Constructor.
virtual ~XMLDataModelWriter ()
int32 writeModelToFile (int32 NOT_USED=0)
 Writes the data model to an xml file.
int32 writeDataModelTemplate (int32 indentDepth)
 Writes template section of data model.
int32 writeDataDimensions (int32 indentDepth)
 Writes the Data Dimensions.
int32 writeDataRecords (int32 indentDepth)
 Writes the Data Records.
int32 writeRequiredMetaData (int32 indentDepth)
 Writes the RequiredMeta Data.
int32 writeUserMetaData (int32 indentDepth)
 Writes the User Meta Data.
int32 _writeMXAInfo (int32 depth)
 Writes the File Type and File version tags.
void _writeDataRoot (int32 indentDepth)
 Writes the data root to the XML file.
int32 writeDataDimension (IDataDimension *dim)
 Writes an IDataDimension to the underlying data storage.
int32 writeDataRecord (IDataRecord *record)
 Writes a IDataRecord to the underlying storage mechanism.
int32 writeSupportFiles (int32 indentDepth)
 Writes the support files to the hdf5 data file.

Protected Member Functions

void _openTag (const std::string &tagName, int32 depth, bool group, std::map< std::string, std::string > &attributes)
void _openTag (const std::string &tagName, int32 depth, bool group=true)
void _closeGroupTag (const std::string &tagName, int32 depth)

Static Protected Member Functions

static std::string _toUpper (const std::string value)
static void _replaceAll (std::string &, std::string, std::string)
static std::string escapedText (const std::string &value)
static std::string escapedAttribute (const std::string &value)

Private Member Functions

 XMLDataModelWriter (const XMLDataModelWriter &)
void operator= (const XMLDataModelWriter &)

Private Attributes

IDataModel::Pointer _dataModel
const std::string _fileName
int32 _dataRecordIndentation
boost::shared_ptr< std::ofstream > _ofstreamPtr

Detailed Description

Concrete implementation of IDataModelWriter that is used to write the data model to an XML file.

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


Constructor & Destructor Documentation

XMLDataModelWriter::XMLDataModelWriter ( IDataModel::Pointer  dataModel,
const std::string &  fileName 
)

Constructor.

Parameters:
dataModel The DataModel Object to write
fileName The name of the file to write the data model

XMLDataModelWriter::~XMLDataModelWriter (  )  [virtual]

XMLDataModelWriter::XMLDataModelWriter ( const XMLDataModelWriter  )  [private]


Member Function Documentation

int32 XMLDataModelWriter::writeModelToFile ( int32  NOT_USED = 0  )  [virtual]

Writes the data model to an xml file.

Parameters:
NOT_USED This parameter is not used/needed for xml writing
Returns:
Error Code: Negative is Error Condition

Implements IDataModelWriter.

int32 XMLDataModelWriter::writeDataModelTemplate ( int32  indentDepth  )  [virtual]

Writes template section of data model.

Parameters:
indentDepth The number of spaced to indent this section of XML
Returns:
Error Code: Negative is Error Condition

Implements IDataModelWriter.

int32 XMLDataModelWriter::writeDataDimensions ( int32  indentDepth  )  [virtual]

Writes the Data Dimensions.

Parameters:
indentDepth The number of spaced to indent this section of XML
Returns:
Error Code: Negative is Error Condition

Implements IDataModelWriter.

int32 XMLDataModelWriter::writeDataRecords ( int32  indentDepth  )  [virtual]

Writes the Data Records.

Parameters:
indentDepth The number of spaced to indent this section of XML
Returns:
Error Code: Negative is Error Condition

Implements IDataModelWriter.

int32 XMLDataModelWriter::writeRequiredMetaData ( int32  indentDepth  )  [virtual]

Writes the RequiredMeta Data.

Parameters:
indentDepth The number of spaced to indent this section of XML
Returns:
Error Code: Negative is Error Condition

Implements IDataModelWriter.

int32 XMLDataModelWriter::writeUserMetaData ( int32  indentDepth  )  [virtual]

Writes the User Meta Data.

Parameters:
indentDepth The number of spaced to indent this section of XML
Returns:
Error Code: Negative is Error Condition

Implements IDataModelWriter.

int32 XMLDataModelWriter::_writeMXAInfo ( int32  depth  ) 

Writes the File Type and File version tags.

Parameters:
depth The number of spaces to indent this section of XML
Returns:
Error Code: negative is error condition

void XMLDataModelWriter::_writeDataRoot ( int32  indentDepth  ) 

Writes the data root to the XML file.

Parameters:
indentDepth The number of spaced to indent this section of XML

int32 XMLDataModelWriter::writeDataDimension ( IDataDimension dim  )  [virtual]

Writes an IDataDimension to the underlying data storage.

Parameters:
dim Non-NULL IDataDimension object
Returns:
Error condition

Implements IDataDimensionWriter.

int32 XMLDataModelWriter::writeDataRecord ( IDataRecord record  )  [virtual]

Writes a IDataRecord to the underlying storage mechanism.

Parameters:
record The Data Record to Write
Returns:
Error Code: Negate is error condition

Implements IDataRecordWriter.

int32 XMLDataModelWriter::writeSupportFiles ( int32  indentDepth  )  [virtual]

Writes the support files to the hdf5 data file.

Parameters:
indentDepth The number of spaces to indent the xml code
Returns:
error code

Implements IDataModelWriter.

std::string XMLDataModelWriter::_toUpper ( const std::string  value  )  [static, protected]

void XMLDataModelWriter::_replaceAll ( std::string &  ,
std::string  ,
std::string   
) [static, protected]

std::string XMLDataModelWriter::escapedText ( const std::string &  value  )  [static, protected]

std::string XMLDataModelWriter::escapedAttribute ( const std::string &  value  )  [static, protected]

void XMLDataModelWriter::_openTag ( const std::string &  tagName,
int32  depth,
bool  group,
std::map< std::string, std::string > &  attributes 
) [protected]

void XMLDataModelWriter::_openTag ( const std::string &  tagName,
int32  depth,
bool  group = true 
) [protected]

void XMLDataModelWriter::_closeGroupTag ( const std::string &  tagName,
int32  depth 
) [protected]

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


Member Data Documentation

IDataModel::Pointer XMLDataModelWriter::_dataModel [private]

const std::string XMLDataModelWriter::_fileName [private]

int32 XMLDataModelWriter::_dataRecordIndentation [private]

boost::shared_ptr<std::ofstream> XMLDataModelWriter::_ofstreamPtr [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