Regina Calculation Engine
Public Member Functions | List of all members
regina::detail::XMLSimplexReader< dim > Class Template Reference

Helper class that reads the XML element for a single top-dimensional simplex in a dim-dimensional triangulation. More...

#include <generic/detail/xmltrireader.h>

Inheritance diagram for regina::detail::XMLSimplexReader< dim >:
regina::NXMLElementReader

Public Member Functions

 XMLSimplexReader (Triangulation< dim > *tri, size_t whichSimplex)
 Creates a new simplex element reader. More...
 
virtual void startElement (const std::string &, const regina::xml::XMLPropertyDict &props, NXMLElementReader *)
 Signifies that parsing of this XML element is beginning. More...
 
virtual void initialChars (const std::string &chars)
 Signifies that the initial text belonging to this XML element has been read. More...
 
virtual NXMLElementReaderstartSubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps)
 Signifies that a subelement of this XML element is about to be parsed. More...
 
virtual void endSubElement (const std::string &subTagName, NXMLElementReader *subReader)
 Signifies that parsing has finished for a subelement of this XML element. More...
 
virtual void endElement ()
 Signifies that parsing of this XML element is finished. More...
 
virtual void usingParser (regina::xml::XMLParser *parser)
 Called for the top-level element in an XML file when parsing begins. More...
 
virtual void abort (NXMLElementReader *subReader)
 Signifies that XML parsing has been aborted. More...
 

Detailed Description

template<int dim>
class regina::detail::XMLSimplexReader< dim >

Helper class that reads the XML element for a single top-dimensional simplex in a dim-dimensional triangulation.

In other words, this reads the contents of a single <simplex> element for dimension dim ≥ 5, or a single <triangle>, <tet> or <pent> element for dimension dim = 2, 3 or 4.

It is assumed that the underlying triangulation and its simplices have already been created. The task of this reader is to flesh out the "contents" of a single simplex; that is, the description of the simplex and its gluings to adjacent simplices.

Python:
Not present.
Template Parameters
dimThe dimension of the triangulation being read.

Constructor & Destructor Documentation

§ XMLSimplexReader()

template<int dim>
regina::detail::XMLSimplexReader< dim >::XMLSimplexReader ( Triangulation< dim > *  tri,
size_t  whichSimplex 
)
inline

Creates a new simplex element reader.

Precondition
The given triangulation tri already contains at least (whichSimplex + 1) top-dimensional simplices.
Parameters
trithe triangulation containing the simplex being read.
whichSimplexthe index of the simplex being read within the triangulation tri.

Member Function Documentation

§ abort()

void regina::NXMLElementReader::abort ( NXMLElementReader subReader)
inlinevirtualinherited

Signifies that XML parsing has been aborted.

This element reader will be destroyed shortly after this routine is called.

The default implementation does nothing.

Parameters
subReaderthe corresponding child reader if a subelement is currently being parsed, or 0 otherwise. If this parameter is non-zero, it is guaranteed that abort() has already been called upon the child reader and that the child reader has not yet been destroyed.

Reimplemented in regina::NXMLPacketReader.

§ endElement()

void regina::NXMLElementReader::endElement ( )
inlinevirtualinherited

Signifies that parsing of this XML element is finished.

It is guaranteed that endSubElement() has not yet been called upon the parent reader (if one exists).

The default implementation does nothing.

§ endSubElement()

void regina::NXMLElementReader::endSubElement ( const std::string &  subTagName,
NXMLElementReader subReader 
)
inlinevirtualinherited

Signifies that parsing has finished for a subelement of this XML element.

The default implementation does nothing.

Parameters
subTagNamethe name of the subelement closing tag.
subReaderthe child reader that was used to parse the subelement (this is the reader that was returned by the corresponding startSubElement() call). It is guaranteed that endElement() has already been called upon this child reader and that the child reader has not yet been destroyed.

Reimplemented in regina::NXMLPacketReader, and regina::NXMLGroupPresentationReader.

§ initialChars()

template<int dim>
void regina::detail::XMLSimplexReader< dim >::initialChars ( const std::string &  chars)
virtual

Signifies that the initial text belonging to this XML element has been read.

The initial text is everything between the opening tag and the first subelement or closing tag.

The default implementation does nothing.

Parameters
charsthe initial text for this element.

Reimplemented from regina::NXMLElementReader.

§ startElement()

template<int dim>
void regina::detail::XMLSimplexReader< dim >::startElement ( const std::string &  tagName,
const regina::xml::XMLPropertyDict tagProps,
NXMLElementReader parentReader 
)
inlinevirtual

Signifies that parsing of this XML element is beginning.

The default implementation does nothing.

Parameters
tagNamethe name of the opening tag for this element.
tagPropsthe properties associated with the opening tag.
parentReaderthe reader currently parsing the parent XML element, or 0 if this is the top-level element. If this paraneter is non-zero, it is guaranteed that startSubElement() has already been called upon the parent reader.

Reimplemented from regina::NXMLElementReader.

§ startSubElement()

NXMLElementReader * regina::NXMLElementReader::startSubElement ( const std::string &  subTagName,
const regina::xml::XMLPropertyDict subTagProps 
)
inlinevirtualinherited

Signifies that a subelement of this XML element is about to be parsed.

The default implementation returns a new NXMLElementReader which can be used to ignore the subelement completely.

Parameters
subTagNamethe name of the subelement opening tag.
subTagPropsthe properties associated with the subelement opening tag.
Returns
a newly created element reader that will be used to parse the subelement. This class should not take care of the new reader's destruction; that will be done by the parser.

Reimplemented in regina::NXMLPacketReader, regina::detail::XMLSimplicesReader< dim >, regina::NXMLGroupPresentationReader, regina::NXMLNormalHypersurfaceReader, regina::NXMLNormalSurfaceReader, and regina::NXMLAngleStructureReader.

§ usingParser()

void regina::NXMLElementReader::usingParser ( regina::xml::XMLParser parser)
inlinevirtualinherited

Called for the top-level element in an XML file when parsing begins.

This allows direct access to the parser if needed (for instance, to change the character encoding).

The default implementation does nothing.

Parameters
parserthe current XML parser.

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

Copyright © 1999-2016, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).