ITK
4.6.0
Insight Segmentation and Registration Toolkit
|
#include <itkDOMNodeXMLWriter.h>
Class to write a DOM object to an XML file or an output stream.
This class takes a user DOM object and write it to a destination such as file, string, console, etc. Before using this class, the DOM object should have been generated from a user object.
We do not recommend to directly use this class for user object writing, because the user has to handle both DOM object generation from the user object and XML output from the intermediate DOM object. Users should derive from the DOMWriter, because it performs the latter step automatically and lets the users concentrate on the former step, thus implementation of such a writer is simplified.
Note: Though this class behaves similar to ProcessObject, it is not derived from ProcessObject. This is because the input 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 write a DOM object to an XML file:
itk::DOMNode::Pointer input_dom_object = ... const char* output_xml_file_name = ... itk::DOMNodeXMLWriter::Pointer writer = itk::DOMNodeXMLWriter::New(); writer->SetInput( input_dom_object ); writer->SetFileName( output_xml_file_name ); writer->Update();
Definition at line 60 of file itkDOMNodeXMLWriter.h.
Public Types | |
typedef InputType::ConstPointer | ConstInputPointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef DOMNode | InputType |
typedef SmartPointer< Self > | Pointer |
typedef DOMNodeXMLWriter | Self |
typedef Object | Superclass |
Public Types inherited from itk::Object | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef Object | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetFileName () const |
virtual const char * | GetNameOfClass () const |
virtual void | SetFileName (const char *_arg) |
void | Update (std::ostream &os, std::string indent="") |
virtual void | Update () |
virtual void | SetInput (const InputType *_arg) |
virtual const InputType * | GetInput () const |
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 |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary (void) |
const MetaDataDictionary & | GetMetaDataDictionary (void) const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
virtual void | Register () const ITK_OVERRIDE |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
virtual void | SetReferenceCount (int) ITK_OVERRIDE |
virtual void | UnRegister () const ITK_OVERRIDE |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () 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 Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
DOMNodeXMLWriter () | |
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 ITK_OVERRIDE |
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 | |
DOMNodeXMLWriter (const Self &) | |
void | operator= (const Self &) |
Private Attributes | |
std::string | m_FileName |
std::string | m_IndentStep |
ConstInputPointer | m_Input |
Additional Inherited Members | |
Protected Types inherited from itk::LightObject | |
typedef int | InternalReferenceCountType |
Protected Attributes inherited from itk::LightObject | |
InternalReferenceCountType | m_ReferenceCount |
SimpleFastMutexLock | m_ReferenceCountLock |
Definition at line 77 of file itkDOMNodeXMLWriter.h.
typedef SmartPointer< const Self > itk::DOMNodeXMLWriter::ConstPointer |
Definition at line 68 of file itkDOMNodeXMLWriter.h.
Definition at line 74 of file itkDOMNodeXMLWriter.h.
typedef SmartPointer< Self > itk::DOMNodeXMLWriter::Pointer |
Definition at line 67 of file itkDOMNodeXMLWriter.h.
Standard class typedefs.
Definition at line 65 of file itkDOMNodeXMLWriter.h.
Definition at line 66 of file itkDOMNodeXMLWriter.h.
|
protected |
|
private |
|
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 |
Get the output XML filename.
|
virtual |
Get/Set the input DOM object to be written.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Object.
|
static |
Method for creation through the object factory.
Referenced by operator<<().
|
private |
|
virtual |
Set the output XML filename.
|
virtual |
Get/Set the input DOM object to be written.
void itk::DOMNodeXMLWriter::Update | ( | std::ostream & | os, |
std::string | indent = "" |
||
) |
|
virtual |
Function called by end-users to write the input DOM object to the output XML file.
|
private |
Variable to hold the output XML file name.
Definition at line 109 of file itkDOMNodeXMLWriter.h.
|
private |
Variable to hold the indentation (i.e. number of white spaces) for a child node w.r.t. its parent.
Definition at line 115 of file itkDOMNodeXMLWriter.h.
|
private |
Variable to hold the input DOM object.
Definition at line 112 of file itkDOMNodeXMLWriter.h.