code::XMLEncoder Class Reference

Inheritance diagram for code::XMLEncoder:

code::Algorithm List of all members.

Detailed Description

The XMLEncoder allows you to create a XML DOM node in memory from many of the classes in the system.

These include low-level classes like Location and Angle as well as high-level classes such as DataTable.

Typical usage is like this:

     Index::Record rec = XMLEncoder::writeData(myTable, outputDir, true);
     if ( lb.isOpen() )
       XMLLBIndex::writeRecord( lb, rec );
     

See also:
XMLDocument

Writer

Author:
Lakshman
Version:
Id
code_XMLEncoder.h,v 1.24 2009/06/02 20:17:37 lakshman Exp


Public Member Functions

 XMLEncoder (const std::string &dir_name, const std::string &subSpec=std::string(), bool gz_compress=true, bool use_subdirs=false)
virtual ~XMLEncoder ()
SmartPtr< XML::ElementcreateElement (SmartPtr< Track > obj)
SmartPtr< XML::ElementcreateElement (SmartPtr< TimeHeightTrendData > obj)
SmartPtr< XML::ElementcreateElement (const TimeHeightTrendData::Entry &obj)
SmartPtr< XML::ElementcreateElement (const Angle &angle)
SmartPtr< XML::ElementcreateElement (const DataCell &obj)
SmartPtr< XML::ElementcreateElement (const DataColumn &obj)
SmartPtr< XML::ElementcreateElement (const DataTable &obj)
SmartPtr< XML::ElementcreateElement (const Location &loc)
SmartPtr< XML::ElementcreateElement (const Radial &obj)
SmartPtr< XML::ElementcreateElement (const SingleContourData &sc)
SmartPtr< XML::ElementcreateElement (const ContourData &sc)
SmartPtr< XML::ElementcreateElement (const RadialSet &obj)
SmartPtr< XML::ElementcreateElement (const SpaceTimeRef &obj)
SmartPtr< XML::ElementcreateElement (const Time &obj)
SmartPtr< XML::ElementcreateElement (const Length &obj)
SmartPtr< XML::ElementcreateElement (const double &itemvalue)
SmartPtr< XML::ElementcreateElement (const int &itemvalue)
SmartPtr< XML::ElementcreateElement (const std::string &itemvalue)
virtual void process (DataTable &dt)
void setSubType (const std::string &subT)
virtual void process (AlgTrackStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (BasicIcon &)
 Process any BasicIcon.
virtual void process (BwerIconStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (CartesianGrid2D &)
 Plane with gridded data on it.
virtual void process (CartesianGrid3D &)
 Volume with gridded data on it.
virtual void process (DataType &)
 Process the abstract base class DataType itself.
virtual void process (ElevationVolume &)
 Process a whole elevation volume scan.
virtual void process (LatLonHeightGrid &)
 Process a whole volume scan in latlonheight.
virtual void process (IconSet &)
virtual void process (Table &)
virtual void process (HailTrendEvent &, SpaceTimeRef &)
virtual void process (LatLonGrid &)
 Process a LatLonGrid.
virtual void process (PolarGrid &)
 Process a PolarGrid.
virtual void process (DEM &)
 Process a Digital Elevation Map (DEM).
virtual void process (LtgoIconStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (MesoIconStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (MesoTrendEvent &, SpaceTimeRef &)
virtual void process (ContourData &)
virtual void process (SingleContourData &)
virtual void process (Radial &)
 Process a single radial.
virtual void process (RadialSet &)
 Process a RadialSet.
virtual void process (ScitTrendEvent &, SpaceTimeRef &)
virtual void process (TornTrendEvent &, SpaceTimeRef &)
virtual void process (FieldArrowStruct &)
 Deppreciated.
virtual void process (WindFieldStruct< LatLonGrid > &)
virtual void process (WindFieldStruct< CartesianGrid2D > &)
virtual void processVolume (Volume &)
 Process a generic volume (Deal with a volume on an abstract level.

Static Public Member Functions

static XML::Document createDocumentElement (const DataType &dt)
 A more convenient function -- writeData -- exists.
static std::string createXMLString (const DataType &dt)
 Write XML document to a string.
static Buffer createXMLBuffer (const DataType &dt)
 Creates a buffer out of the XML string (with a null at the end).
static Index::Record writeData (const DataType &dt, const std::string &outputDir, bool compressed, bool in_flat_structure=false)
 Writes out your data and returns an Index::Record suitable for notification.
static Index::Record writeData (const DataType &dt, const std::string &outputDir, const std::string &writerType, const std::string &sub_type, bool compressed, bool in_flat_structure)
 Finer control of the writeData method.


Constructor & Destructor Documentation

code::XMLEncoder::XMLEncoder ( const std::string &  dir_name,
const std::string &  subSpec = std::string(),
bool  gz_compress = true,
bool  use_subdirs = false 
)

virtual code::XMLEncoder::~XMLEncoder (  )  [inline, virtual]


Member Function Documentation

static XML::Document code::XMLEncoder::createDocumentElement ( const DataType dt  )  [static]

A more convenient function -- writeData -- exists.

This method provides you more control. Typical usage:

	   XML::Document doc( XMLEncoder::createDocumentElement(dt) );  
       SmartPtr<Writer> writer = Writer::getWriter( TypeName::GzippedFile );
       writer->writeXMLDocument( doc, outputDir, "mytable.out" );
       
Pass in the DataType that you want to encode.
See also:
writeData

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const std::string &  itemvalue  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const int &  itemvalue  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const double &  itemvalue  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const Length obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const Time obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const SpaceTimeRef obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const RadialSet obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const ContourData sc  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const SingleContourData sc  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const Radial obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const Location loc  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const DataTable obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const DataColumn obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const DataCell obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const Angle angle  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( const TimeHeightTrendData::Entry obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( SmartPtr< TimeHeightTrendData obj  ) 

SmartPtr<XML::Element> code::XMLEncoder::createElement ( SmartPtr< Track obj  ) 

static Buffer code::XMLEncoder::createXMLBuffer ( const DataType dt  )  [static]

Creates a buffer out of the XML string (with a null at the end).

the buffer has a size of zero on error.

static std::string code::XMLEncoder::createXMLString ( const DataType dt  )  [static]

Write XML document to a string.

You can take this string and write it to a LB or send it across a network, for example.

Returns:
empty string on error
See also:
createXMLBuffer

virtual void code::Algorithm::process ( WindFieldStruct< CartesianGrid2D > &   )  [virtual, inherited]

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( WindFieldStruct< LatLonGrid > &   )  [virtual, inherited]

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( FieldArrowStruct  )  [virtual, inherited]

Deppreciated.

virtual void code::Algorithm::process ( TornTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( ScitTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( RadialSet  )  [virtual, inherited]

Process a RadialSet.

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( Radial  )  [virtual, inherited]

Process a single radial.

virtual void code::Algorithm::process ( SingleContourData  )  [virtual, inherited]

virtual void code::Algorithm::process ( ContourData  )  [virtual, inherited]

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( MesoTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( MesoIconStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::Algorithm::process ( LtgoIconStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::Algorithm::process ( DEM  )  [virtual, inherited]

Process a Digital Elevation Map (DEM).

Default is to process as a regular LatLonGrid.

virtual void code::Algorithm::process ( PolarGrid  )  [virtual, inherited]

Process a PolarGrid.

The default implementation converts the PolarGrid into a RadialSet and sends the radial set along for processing.

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( LatLonGrid  )  [virtual, inherited]

Process a LatLonGrid.

Reimplemented in code::AwipsNetcdfEncoder, and code::NetcdfEncoder.

virtual void code::Algorithm::process ( HailTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( Table &   )  [virtual, inherited]

virtual void code::Algorithm::process ( IconSet &   )  [virtual, inherited]

virtual void code::Algorithm::process ( LatLonHeightGrid  )  [virtual, inherited]

Process a whole volume scan in latlonheight.

Reimplemented in code::NetcdfEncoder, and code::CrossSection.

virtual void code::Algorithm::process ( ElevationVolume  )  [virtual, inherited]

Process a whole elevation volume scan.

Reimplemented in code::CrossSection.

virtual void code::Algorithm::process ( DataType  )  [virtual, inherited]

Process the abstract base class DataType itself.

virtual void code::Algorithm::process ( CartesianGrid3D  )  [virtual, inherited]

Volume with gridded data on it.

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( CartesianGrid2D  )  [virtual, inherited]

Plane with gridded data on it.

Reimplemented in code::NetcdfEncoder.

virtual void code::Algorithm::process ( BwerIconStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::Algorithm::process ( BasicIcon  )  [virtual, inherited]

Process any BasicIcon.

All BasicIcons will default to this if the algorithm in question doesn't implement the particular DataType.

virtual void code::Algorithm::process ( AlgTrackStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::XMLEncoder::process ( DataTable dt  )  [virtual]

Reimplemented from code::Algorithm.

virtual void code::Algorithm::processVolume ( Volume  )  [virtual, inherited]

Process a generic volume (Deal with a volume on an abstract level.

Current volumes are ElevationVolume and LatLonHeightGrid

void code::XMLEncoder::setSubType ( const std::string &  subT  )  [inline]

static Index::Record code::XMLEncoder::writeData ( const DataType dt,
const std::string &  outputDir,
const std::string &  writerType,
const std::string &  sub_type,
bool  compressed,
bool  in_flat_structure 
) [static]

Finer control of the writeData method.

Writes out your data and returns an Index::Record suitable for notification.

Parameters:
dt The data type
writerType (TypeName::GzippedFile, TypeName::FlatFile, etc.)
outputDir 
subtype (optional) -- give something like "Vol" or "00.50"
Returns:
invalid record if writing fails.

static Index::Record code::XMLEncoder::writeData ( const DataType dt,
const std::string &  outputDir,
bool  compressed,
bool  in_flat_structure = false 
) [static]

Writes out your data and returns an Index::Record suitable for notification.

Returns:
invalid record if writing fails.


Generated on Fri May 4 13:40:11 2012 for WDSS-IIw2 by  doxygen 1.4.7