OpenMM
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends
XmlSerializer Class Reference

XmlSerializer is used for serializing objects as XML, and for reconstructing them again. More...

#include <XmlSerializer.h>

Static Public Member Functions

template<class T >
static void serialize (const T *object, const std::string &rootName, std::ostream &stream)
 Serialize an object as XML.
 
template<class T >
static T * deserialize (std::istream &stream)
 Reconstruct an object that has been serialized as XML.
 

Detailed Description

XmlSerializer is used for serializing objects as XML, and for reconstructing them again.

Member Function Documentation

static T* deserialize ( std::istream &  stream)
inlinestatic

Reconstruct an object that has been serialized as XML.

Parameters
streaman input stream to read the XML from
Returns
a pointer to the newly created object. The caller assumes ownership of the object.
static void serialize ( const T *  object,
const std::string &  rootName,
std::ostream &  stream 
)
inlinestatic

Serialize an object as XML.

Parameters
objectthe object to serialize
rootNamethe name to use for the root node of the XML document
streaman output stream to write the XML to

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