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

Stream command to read an object if it is present at the current path and to retrieve an default value if not. More...

#include <XmlReader.hpp>

List of all members.

Public Member Functions

 default_value (data_t &object, const data_t &default_object)

Friends

class XmlReader


Detailed Description

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

Stream command to read an object if it is present at the current path and to retrieve an default value 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 to set it to a default value. Then she can use a default_value 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::default_value< data_t >::default_value ( data_t &  object,
const data_t &  default_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 sets object to default_object.


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