ITK  4.2.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
itk::DOMNodeXMLReader Class Reference

#include <itkDOMNodeXMLReader.h>

+ Inheritance diagram for itk::DOMNodeXMLReader:
+ Collaboration diagram for itk::DOMNodeXMLReader:

List of all members.

Public Types

typedef SmartPointer< const SelfConstPointer
typedef OutputType::Pointer OutputPointer
typedef DOMNode OutputType
typedef SmartPointer< SelfPointer
typedef DOMNodeXMLReader Self
typedef Object Superclass
- Public Types inherited from itk::Object
- Public Types inherited from itk::LightObject

Public Member Functions

virtual void CharacterDataHandler (const char *text, int len)
virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual void EndElement (const char *name)
virtual const char * GetFileName () const
virtual const char * GetNameOfClass () const
virtual OutputTypeGetOutput ()
virtual const OutputTypeGetOutput ()
virtual void SetFileName (const char *_arg)
virtual void SetOutput (OutputType *_arg)
virtual void StartElement (const char *name, const char **atts)
void Update (std::istream &is)
virtual void Update ()
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
unsigned long AddObserver (const EventObject &event, Command *) const
virtual void DebugOff () const
virtual void DebugOn () const
CommandGetCommand (unsigned long tag)
bool GetDebug () const
MetaDataDictionaryGetMetaDataDictionary (void)
const MetaDataDictionaryGetMetaDataDictionary (void) const
virtual unsigned long GetMTime () const
virtual const TimeStampGetTimeStamp () const
bool HasObserver (const EventObject &event) const
void InvokeEvent (const EventObject &)
void InvokeEvent (const EventObject &) const
virtual void Modified () const
virtual void Register () const
void RemoveAllObservers ()
void RemoveObserver (unsigned long tag)
void SetDebug (bool debugFlag) const
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
virtual void SetReferenceCount (int)
virtual void UnRegister () const
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
virtual int GetReferenceCount () const
 itkCloneMacro (Self)
void Print (std::ostream &os, Indent indent=0) const

Static Public Member Functions

static Pointer New ()
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
static void GlobalWarningDisplayOff ()
static void GlobalWarningDisplayOn ()
static void SetGlobalWarningDisplay (bool flag)
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()

Protected Member Functions

 DOMNodeXMLReader ()
- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
virtual void PrintSelf (std::ostream &os, Indent indent) const
virtual void SetTimeStamp (const TimeStamp &time)
virtual ~Object ()
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 LightObject ()
virtual void PrintHeader (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const
virtual ~LightObject ()

Private Member Functions

 DOMNodeXMLReader (const Self &)
void operator= (const Self &)

Private Attributes

OutputTypem_Context
std::string m_FileName
OutputPointer m_Output

Detailed Description

Class to read a DOM object from an XML file or an input stream.

This class produces a DOM object, which can be subsequently used to create a corresponding user object.

We do not recommend to directly use this class for user object reading, because the user has to handle both DOM object generation from the input XML file and user object generation from the intermediate DOM object. Users should derive from the DOMReader, because it performs the former step automatically and lets the users concentrate on the latter step, thus implementation of such a reader is simplified.

Note: Though this class behaves similar to ProcessObject, it is not derived from ProcessObject. This is because the output of this class, i.e. a DOMNode object, is not a DataObject, thus this class cannot be connected to an ITK process pipeline.

The following code snippet demonstrates how to read a DOM object from an XML file:

itk::DOMNode::Pointer output_dom_object;
const char* input_xml_file_name = ...
itk::DOMNodeXMLReader::Pointer reader = itk::DOMNodeXMLReader::New();
reader->SetFileName( input_xml_file_name );
reader->Update();
output_dom_object = reader->GetOutput();
See also:
DOMReader
DOMNode

Definition at line 60 of file itkDOMNodeXMLReader.h.


Member Typedef Documentation

Reimplemented from itk::Object.

Definition at line 68 of file itkDOMNodeXMLReader.h.

Definition at line 77 of file itkDOMNodeXMLReader.h.

Definition at line 74 of file itkDOMNodeXMLReader.h.

Reimplemented from itk::Object.

Definition at line 67 of file itkDOMNodeXMLReader.h.

Standard class typedefs.

Reimplemented from itk::Object.

Definition at line 65 of file itkDOMNodeXMLReader.h.

Reimplemented from itk::Object.

Definition at line 66 of file itkDOMNodeXMLReader.h.


Constructor & Destructor Documentation

itk::DOMNodeXMLReader::DOMNodeXMLReader ( )
protected
itk::DOMNodeXMLReader::DOMNodeXMLReader ( const Self )
private

Member Function Documentation

virtual void itk::DOMNodeXMLReader::CharacterDataHandler ( const char *  text,
int  len 
)
virtual

Callback function – called from XML parser with the character data for an XML element.

virtual::itk::LightObject::Pointer itk::DOMNodeXMLReader::CreateAnother ( void  ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

virtual void itk::DOMNodeXMLReader::EndElement ( const char *  name)
virtual

Callback function – called from XML parser when ending tag encountered.

virtual const char* itk::DOMNodeXMLReader::GetFileName ( ) const
virtual

Get the input XML filename.

virtual const char* itk::DOMNodeXMLReader::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

virtual OutputType* itk::DOMNodeXMLReader::GetOutput ( )
virtual

Get the output DOM object for full access.

virtual const OutputType* itk::DOMNodeXMLReader::GetOutput ( )
virtual

Get the output DOM object for read-only access.

static Pointer itk::DOMNodeXMLReader::New ( )
static

Method for creation through the object factory.

Reimplemented from itk::Object.

Referenced by operator>>().

void itk::DOMNodeXMLReader::operator= ( const Self )
private

Mutex lock to protect modification to the reference count

Reimplemented from itk::Object.

virtual void itk::DOMNodeXMLReader::SetFileName ( const char *  _arg)
virtual

Set the input XML filename.

virtual void itk::DOMNodeXMLReader::SetOutput ( OutputType _arg)
virtual

The output DOM object will be created automatically, but the user can appoint a user DOM object as the output by calling this function.

virtual void itk::DOMNodeXMLReader::StartElement ( const char *  name,
const char **  atts 
)
virtual

Callback function – called from XML parser with start-of-element information.

void itk::DOMNodeXMLReader::Update ( std::istream &  is)

Function called by Update() or end-users to generate the output DOM object from an input stream such as file, string, etc.

virtual void itk::DOMNodeXMLReader::Update ( )
virtual

Function called by end-users to generate the output DOM object from the input XML file.


Member Data Documentation

OutputType* itk::DOMNodeXMLReader::m_Context
private

Variable to keep the current context during XML parsing.

Definition at line 137 of file itkDOMNodeXMLReader.h.

std::string itk::DOMNodeXMLReader::m_FileName
private

Variable to hold the input XML file name.

Definition at line 131 of file itkDOMNodeXMLReader.h.

OutputPointer itk::DOMNodeXMLReader::m_Output
private

Variable to hold the output DOM object, created internally or supplied by the user.

Definition at line 134 of file itkDOMNodeXMLReader.h.


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