imaging::XmlReader::try_read< data_t > Class Template Reference

Stream command to read an object if it is present at the current path and to keep it unchanged if not. More...

#include <XmlReader.hpp>

List of all members.

Public Member Functions

 try_read (data_t &object)

Friends

class XmlReader


Detailed Description

template<class data_t>
class imaging::XmlReader::try_read< data_t >

Stream command to read an object if it is present at the current path and to keep it unchanged if not.

Assume that the user wants to read an object from an XML input stream but she is not sure if it can actually be found in the stream. Assume further that in case the object can not be read the user just wants the object to be the same as before without any further error handling. Then she can use a try_read to accomplish this task in a compact way.

The alternate way to handle this situation would be to try to read the object and to explicitly handle XmlNoTagException exceptions.


Constructor & Destructor Documentation

template<class data_t>
imaging::XmlReader::try_read< data_t >::try_read ( data_t &  object  )  [inline]

Passing this command to an XML input stream reads object from the stream if it is present at the current stream path. If not, it keeps object unchanged.


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

Generated on Tue Feb 10 10:01:31 2009 for imaging2 by  doxygen 1.5.5