|
musrfit 1.10.0
|
XML SAX parser handler for TrimSP configuration files. More...
#include <PRgeHandler.h>


Public Member Functions | |
| PXmlRgeHandler () | |
| Default constructor. | |
| virtual | ~PXmlRgeHandler () |
| Destructor. | |
| virtual void | OnStartDocument () |
| Called at start of XML document parsing (SLOT) | |
| virtual void | OnEndDocument () |
| Called at end of XML document parsing, performs validation (SLOT) | |
| virtual void | OnStartElement (const char *str, const TList *attributes) |
| Called when XML start tag is encountered (SLOT) | |
| virtual void | OnEndElement (const char *str) |
| Called when XML end tag is encountered (SLOT) | |
| virtual void | OnCharacters (const char *str) |
| Called for element content between tags (SLOT) | |
| virtual void | OnComment (const char *str) |
| Called for XML comments (SLOT) | |
| virtual void | OnWarning (const char *str) |
| Called when parser emits a warning (SLOT) | |
| virtual void | OnError (const char *str) |
| Called when parser encounters an error (SLOT) | |
| virtual void | OnFatalError (const char *str) |
| Called when parser encounters a fatal error (SLOT) | |
| virtual void | OnCdataBlock (const char *str, Int_t len) |
| Called for CDATA blocks (SLOT) | |
| virtual bool | IsValid () |
| Returns validity status of parsed configuration. | |
| virtual std::string | GetTrimSpDataPath () |
| Returns the TrimSP data directory path. | |
| virtual std::string | GetTrimSpFlnPre () |
| Returns the RGE filename prefix. | |
| virtual const PIntVector | GetTrimSpDataVectorList () const |
| Returns the list of implantation energies. | |
Private Types | |
| enum | EKeyWords { eEmpty , eDataPath , eFlnPre , eEnergy } |
| Enum for tracking which XML element is currently being parsed. More... | |
Private Attributes | |
| EKeyWords | fKey |
| Current parsing context/state. | |
| bool | isTrimSp {false} |
| True when inside <trim_sp> element. | |
| bool | fIsValid {true} |
| Validity flag (false if parsing errors occur) | |
| std::string | fTrimSpDataPath {""} |
| Directory path to RGE files. | |
| std::string | fTrimSpFlnPre {""} |
| RGE filename prefix (e.g., "LCCO_E" for LCCO_E1000.rge) | |
| PIntVector | fTrimSpDataEnergyList |
| List of implantation energies in eV. | |
XML SAX parser handler for TrimSP configuration files.
PXmlRgeHandler parses XML configuration files to extract TrimSP (Transport of Ions in Matter) data file locations and parameters. The XML file specifies:
This handler implements ROOT's TSAXParser callbacks for event-driven XML parsing.
Definition at line 97 of file PRgeHandler.h.
|
private |
Enum for tracking which XML element is currently being parsed.
| Enumerator | |
|---|---|
| eEmpty | |
| eDataPath | |
| eFlnPre | |
| eEnergy | |
Definition at line 178 of file PRgeHandler.h.
|
inline |
Default constructor.
Definition at line 101 of file PRgeHandler.h.
|
inlinevirtual |
Destructor.
Definition at line 103 of file PRgeHandler.h.
|
inlinevirtual |
Returns the TrimSP data directory path.
Definition at line 162 of file PRgeHandler.h.
References fTrimSpDataPath.
|
inlinevirtual |
Returns the list of implantation energies.
Definition at line 174 of file PRgeHandler.h.
References fTrimSpDataEnergyList.
|
inlinevirtual |
Returns the RGE filename prefix.
Definition at line 168 of file PRgeHandler.h.
References fTrimSpFlnPre.
|
inlinevirtual |
Returns validity status of parsed configuration.
Definition at line 156 of file PRgeHandler.h.
References fIsValid.
|
virtual |
Called for CDATA blocks (SLOT)
SAX callback invoked for CDATA blocks.
| str | CDATA content |
| len | Length of CDATA |
Currently not used - CDATA blocks are ignored.
| str | CDATA content |
| len | Length of CDATA content |
Definition at line 352 of file PRgeHandler.cpp.
|
virtual |
Called for element content between tags (SLOT)
SAX callback invoked for text content between XML tags.
| str | Character data |
Processes the content based on the current parsing state (fKey):
Performs validation and error handling for energy values, ensuring they are valid integers within range.
| str | Text content from XML element |
Definition at line 236 of file PRgeHandler.cpp.
References eDataPath, eEnergy, eFlnPre, fIsValid, fKey, fTrimSpDataEnergyList, fTrimSpDataPath, fTrimSpFlnPre, and OnError().
|
virtual |
Called for XML comments (SLOT)
SAX callback invoked for XML comments.
| str | Comment text |
Currently not used - comments are ignored.
| str | Comment text |
Definition at line 287 of file PRgeHandler.cpp.
|
virtual |
Called at end of XML document parsing, performs validation (SLOT)
SAX callback invoked at the end of XML document parsing.
Performs final validation to ensure all required fields were parsed:
Sets fIsValid to false and calls OnError() if any validation fails.
Definition at line 72 of file PRgeHandler.cpp.
References fIsValid, fTrimSpDataEnergyList, fTrimSpDataPath, fTrimSpFlnPre, and OnError().
|
virtual |
Called when XML end tag is encountered (SLOT)
SAX callback invoked when an XML end tag is encountered.
| str | Element name |
Resets the parsing state when leaving the <trim_sp> section and clears the current element key for all end tags.
| str | XML element name |
Definition at line 211 of file PRgeHandler.cpp.
|
virtual |
Called when parser encounters an error (SLOT)
SAX callback invoked when the parser encounters an error.
| str | Error message |
Prints error message to stderr. Called both by the parser and by this handler's own validation code.
| str | Error message |
Definition at line 319 of file PRgeHandler.cpp.
Referenced by OnCharacters(), OnEndDocument(), and OnStartElement().
|
virtual |
Called when parser encounters a fatal error (SLOT)
SAX callback invoked when the parser encounters a fatal error.
| str | Fatal error message |
Prints fatal error message to stderr. Fatal errors typically stop parsing.
| str | Fatal error message |
Definition at line 335 of file PRgeHandler.cpp.
|
virtual |
Called at start of XML document parsing (SLOT)
|
virtual |
Called when XML start tag is encountered (SLOT)
SAX callback invoked when an XML start tag is encountered.
| str | Element name |
| attributes | Element attributes (used for energy_vect) |
Processes recognized elements within the <trim_sp> section:
For <energy_vect>, parses the attributes and generates the energy list. Performs extensive validation on attribute values and ranges.
| str | XML element name |
| attributes | Element attributes (only used for energy_vect) |
Definition at line 113 of file PRgeHandler.cpp.
References eDataPath, eEnergy, eFlnPre, fIsValid, fKey, fTrimSpDataEnergyList, isTrimSp, and OnError().
|
virtual |
Called when parser emits a warning (SLOT)
SAX callback invoked when the parser emits a warning.
| str | Warning message |
Prints warning message to stderr.
| str | Warning message from parser |
Definition at line 302 of file PRgeHandler.cpp.
|
private |
Validity flag (false if parsing errors occur)
Definition at line 182 of file PRgeHandler.h.
Referenced by IsValid(), OnCharacters(), OnEndDocument(), and OnStartElement().
|
private |
Current parsing context/state.
Definition at line 179 of file PRgeHandler.h.
Referenced by ClassImpQ(), OnCharacters(), OnEndElement(), and OnStartElement().
|
private |
List of implantation energies in eV.
Definition at line 186 of file PRgeHandler.h.
Referenced by GetTrimSpDataVectorList(), OnCharacters(), OnEndDocument(), and OnStartElement().
|
private |
Directory path to RGE files.
Definition at line 184 of file PRgeHandler.h.
Referenced by GetTrimSpDataPath(), OnCharacters(), and OnEndDocument().
|
private |
RGE filename prefix (e.g., "LCCO_E" for LCCO_E1000.rge)
Definition at line 185 of file PRgeHandler.h.
Referenced by GetTrimSpFlnPre(), OnCharacters(), and OnEndDocument().
|
private |
True when inside <trim_sp> element.
Definition at line 181 of file PRgeHandler.h.
Referenced by OnEndElement(), and OnStartElement().