Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitk::XML2EventParser Class Reference

#include <mitkXML2EventParser.h>

Inheritance diagram for mitk::XML2EventParser:
Collaboration diagram for mitk::XML2EventParser:

Public Types

typedef std::vector< mitk::InteractionEvent::PointerEventContainerType
 

Public Member Functions

 XML2EventParser (const std::string &filename, const us::Module *module=nullptr)
 Construct an InteractionEventList object based on a XML configuration file. More...
 
 XML2EventParser (std::istream &inputStream)
 Construct an InteractionEventList object based on a XML configuration file. More...
 
EventContainerType GetInteractions ()
 
 ~XML2EventParser () override
 

Protected Member Functions

void StartElement (const char *elementName, const char **atts) override
 Derived from XMLReader. More...
 
void EndElement (const char *elementName) override
 Derived from XMLReader. More...
 
std::string ReadXMLStringAttribute (const std::string &name, const char **atts)
 
bool ReadXMLBooleanAttribute (const std::string &name, const char **atts)
 

Detailed Description

Definition at line 38 of file mitkXML2EventParser.h.

Member Typedef Documentation

◆ EventContainerType

Constructor & Destructor Documentation

◆ XML2EventParser() [1/2]

mitk::XML2EventParser::XML2EventParser ( const std::string &  filename,
const us::Module module = nullptr 
)

Construct an InteractionEventList object based on a XML configuration file.

Uses the specified resource file containing an XML event configuration to construct an EventConfig object. If the resource is invalid, the created EventConfig object will also be invalid.

Parameters
filenameThe resource name relative to the Interactions resource folder.
module

Definition at line 106 of file mitkXML2EventParser.cpp.

References ModuleContext::GetModule(), us::GetModuleContext(), us::Module::GetName(), us::Module::GetResource(), us::ModuleResource::IsValid(), and MITK_ERROR.

◆ XML2EventParser() [2/2]

mitk::XML2EventParser::XML2EventParser ( std::istream &  inputStream)

Construct an InteractionEventList object based on a XML configuration file.

Uses the specified istream refering to a file containing an XML event configuration to construct an EventConfig object. If the resource is invalid, the created EventConfig object will also be invalid.

Parameters
inputStreamstd::ifstream to XML configuration file

Definition at line 127 of file mitkXML2EventParser.cpp.

References MITK_ERROR.

◆ ~XML2EventParser()

mitk::XML2EventParser::~XML2EventParser ( )
inlineoverride

Definition at line 67 of file mitkXML2EventParser.h.

Member Function Documentation

◆ EndElement()

void mitk::XML2EventParser::EndElement ( const char *  elementName)
overrideprotected

◆ GetInteractions()

EventContainerType mitk::XML2EventParser::GetInteractions ( )
inline

Definition at line 66 of file mitkXML2EventParser.h.

◆ ReadXMLBooleanAttribute()

bool mitk::XML2EventParser::ReadXMLBooleanAttribute ( const std::string &  name,
const char **  atts 
)
protected

Definition at line 98 of file mitkXML2EventParser.cpp.

◆ ReadXMLStringAttribute()

std::string mitk::XML2EventParser::ReadXMLStringAttribute ( const std::string &  name,
const char **  atts 
)
protected

Definition at line 79 of file mitkXML2EventParser.cpp.

◆ StartElement()


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