Regina Calculation Engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
regina::XMLTriangulationReader< 2 > Class Template Reference

An XML packet reader that reads a single 2-dimensional triangulation. More...

#include <triangulation/xmltrireader2.h>

Inheritance diagram for regina::XMLTriangulationReader< 2 >:
regina::detail::XMLTriangulationReaderBase< 2 > regina::XMLPacketReader regina::XMLElementReader

Public Member Functions

 XMLTriangulationReader (XMLTreeResolver &resolver)
 Creates a new triangulation reader. More...
 
XMLElementReaderstartPropertySubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps)
 Returns an XML element reader for the given optional property of a dim-dimensional triangulation. More...
 
virtual Packetpacket () override
 Returns the newly allocated packet that has been read by this element reader. More...
 
virtual XMLElementReaderstartContentSubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps) override
 Used instead of startSubElement() for XML subelements that are not child packets or packet tags. More...
 
virtual void endContentSubElement (const std::string &subTagName, XMLElementReader *subReader) override
 Used instead of endSubElement() for XML subelements that are not child packets or packet tags. More...
 
virtual XMLElementReaderstartSubElement (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, XMLElementReader *subReader)
 Signifies that parsing has finished for a subelement of this XML element. More...
 
virtual void abort (XMLElementReader *subReader)
 Signifies that XML parsing has been aborted. More...
 
virtual void startElement (const std::string &tagName, const regina::xml::XMLPropertyDict &tagProps, XMLElementReader *parentReader)
 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 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...
 

Protected Member Functions

XMLElementReaderpropertyReader (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps)
 Returns a reader for the generic triangulation property with the given subtag name. More...
 

Protected Attributes

Triangulation< dim > * tri_
 The triangulation currently being read. More...
 
XMLTreeResolverresolver_
 The master resolver that will be used to fix dangling packet references after the entire XML file has been read. More...
 

Detailed Description

template<>
class regina::XMLTriangulationReader< 2 >

An XML packet reader that reads a single 2-dimensional triangulation.

This is a specialisation of the generic XMLTriangulationReader class template; see the XMLTriangulationReader documentation for an overview of how this class works.

This 2-dimensional specialisation contains no extra functionality, though this may change in future releases of Regina.

Constructor & Destructor Documentation

◆ XMLTriangulationReader()

Creates a new triangulation reader.

Parameters
resolverthe master resolver that will be used to fix dangling packet references after the entire XML file has been read.

Member Function Documentation

◆ abort()

virtual void regina::XMLPacketReader::abort ( XMLElementReader subReader)
virtualinherited

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 from regina::XMLElementReader.

◆ endContentSubElement()

void regina::detail::XMLTriangulationReaderBase< dim >::endContentSubElement ( const std::string &  subTagName,
XMLElementReader subReader 
)
inlineoverridevirtualinherited

Used instead of endSubElement() for XML subelements that are not child packets or packet tags.

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 startContentSubElement() 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 from regina::XMLPacketReader.

◆ endElement()

void regina::XMLElementReader::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()

virtual void regina::XMLPacketReader::endSubElement ( const std::string &  subTagName,
XMLElementReader subReader 
)
virtualinherited

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 from regina::XMLElementReader.

◆ initialChars()

void regina::XMLElementReader::initialChars ( const std::string &  chars)
inlinevirtualinherited

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 in regina::XMLCharsReader, regina::detail::XMLSimplexReader< dim >, regina::XMLNormalHypersurfaceReader, regina::XMLNormalSurfaceReader, regina::XMLAngleStructureReader, and regina::XMLAbelianGroupReader.

◆ packet()

Packet * regina::detail::XMLTriangulationReaderBase< dim >::packet ( )
inlineoverridevirtualinherited

Returns the newly allocated packet that has been read by this element reader.

Deallocation of this new packet is not the responsibility of this class. Once this routine gives a non-zero return value, it should continue to give the same non-zero return value from this point onwards.

If this routine is ever to give a non-zero return value, it must be giving that non-zero return value by the time the first child packet or packet tag is encountered; otherwise child packets will not be inserted into the packet tree and/or packet tags will not be added.

The newly allocated packet should not be given a packet label. This will be done by XMLPacketReader::endSubElement().

The newly allocated packet may or may not be inserted in the packet tree structure; this does not matter (although if it is inserted it must be inserted in the correct place).

The newly allocated packet should not be given any associated packet tags. This will be done by XMLPacketReader::startSubElement().

The default implementation returns 0.

Returns
the packet that has been read, or 0 if packet reading is incomplete, the packet should be ignored or an error occurred.

Reimplemented from regina::XMLPacketReader.

◆ propertyReader()

XMLElementReader * regina::detail::XMLTriangulationReaderBase< dim >::propertyReader ( const std::string &  subTagName,
const regina::xml::XMLPropertyDict subTagProps 
)
inlineprotectedinherited

Returns a reader for the generic triangulation property with the given subtag name.

If subTagName refers to a property that is managed by the generic base class TriangulationBase<dim>, then this routine returns an appropriate element reader. Otherwise this routine returns null.

Parameters
subTagNamethe name of the XML subelement opening tag.
subTagPropsthe properties associated with the subelement opening tag.
Returns
a newly created element reader if the corresponding triangulation property is managed by TriangulationBase<dim>, or null otherwise.

◆ startContentSubElement()

XMLElementReader * regina::detail::XMLTriangulationReaderBase< dim >::startContentSubElement ( const std::string &  subTagName,
const regina::xml::XMLPropertyDict subTagProps 
)
overridevirtualinherited

Used instead of startSubElement() for XML subelements that are not child packets or packet tags.

The default implementation returns a new XMLElementReader 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 from regina::XMLPacketReader.

◆ startElement()

void regina::XMLElementReader::startElement ( const std::string &  tagName,
const regina::xml::XMLPropertyDict tagProps,
XMLElementReader parentReader 
)
inlinevirtualinherited

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 in regina::detail::XMLSimplicesReader< dim >, regina::detail::XMLSimplexReader< dim >, regina::XMLGroupPresentationReader, regina::XMLNormalHypersurfaceReader, regina::XMLNormalSurfaceReader, regina::XMLAngleStructureReader, and regina::XMLAbelianGroupReader.

◆ startPropertySubElement()

XMLElementReader * regina::XMLTriangulationReader< 2 >::startPropertySubElement ( const std::string &  subTagName,
const regina::xml::XMLPropertyDict subTagProps 
)
inline

Returns an XML element reader for the given optional property of a dim-dimensional triangulation.

If subTagName names an XML element that describes an optional property of a triangulation (such as H1 or fundgroup for 3-manifold triangulations), then this function should return a corresponding element reader.

Otherwise this function should return a new XMLElementReader, which will cause the XML element to be ignored.

Parameters
subTagNamethe name of the XML 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.

◆ startSubElement()

virtual XMLElementReader* regina::XMLPacketReader::startSubElement ( const std::string &  subTagName,
const regina::xml::XMLPropertyDict subTagProps 
)
virtualinherited

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

The default implementation returns a new XMLElementReader 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 from regina::XMLElementReader.

◆ usingParser()

void regina::XMLElementReader::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.

Member Data Documentation

◆ resolver_

XMLTreeResolver& regina::XMLPacketReader::resolver_
protectedinherited

The master resolver that will be used to fix dangling packet references after the entire XML file has been read.

◆ tri_

Triangulation<dim>* regina::detail::XMLTriangulationReaderBase< dim >::tri_
protectedinherited

The triangulation currently being read.


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).