TSPLIB
|
#include <ValidateSAX2ContentHandler.hpp>
Public Member Functions | |
SAX2ContentHandler () | |
~SAX2ContentHandler () | |
bool | getFailed () const |
std::string | getName () const |
std::string | getSource () const |
std::string | getDescription () const |
std::streamsize | getDoublePrecision () const |
std::streamsize | getIgnoredDigits () const |
double | getDoubleZero () const |
std::vector< std::vector < double > > | getAdjacencyMatrix () |
void | setDocumentLocator (const Locator *const locator) |
void | resetDocument () |
void | startDocument () |
void | endDocument () |
void | startPrefixMapping (const XMLCh *const prefix, const XMLCh *const uri) |
void | endPrefixMapping (const XMLCh *const prefix) |
void | skippedEntity (const XMLCh *const name) |
void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attributes) |
void | endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) |
void | characters (const XMLCh *const chars, const XMLSize_t length) |
void | ignorableWhitespace (const XMLCh *const chars, const XMLSize_t length) |
void | processingInstruction (const XMLCh *const target, const XMLCh *const data) |
Private Member Functions | |
SAX2ContentHandler (const SAX2ContentHandler &sAX2ContentHandler) | |
SAX2ContentHandler & | operator= (const SAX2ContentHandler &sAX2ContentHandler) |
void | init () |
Private Attributes | |
bool | failed |
bool | isUndirected |
std::string | name |
std::string | source |
std::string | description |
std::streamsize | doublePrecision |
std::streamsize | ignoredDigits |
double | doubleZero |
bool | firstVertex |
std::vector< std::vector < double > >::size_type | numberOfParsedVertices |
std::set< std::vector< double > ::size_type > | edgesDefinedInTheFirstVertex |
std::vector< double > | costsOfEdgesDefinedInTheFirstVertex |
std::vector< std::vector < double > >::size_type | n |
std::vector< std::vector< bool > > | parsedEntries |
std::vector< std::vector < double > > | adjacencyMatrix |
std::string | buffer |
double | cost |
Definition at line 25 of file ValidateSAX2ContentHandler.hpp.
SAX2ContentHandler::SAX2ContentHandler | ( | const SAX2ContentHandler & | sAX2ContentHandler | ) | [private] |
Not implemented copy constructor for the class SAX2ContentHandler.
sAX2ContentHandler | Instance to be copied. |
Constructor for the class SAXContentHandler.
Definition at line 117 of file ValidateSAX2ContentHandler.cpp.
References init().
Destructor for the class SAXContentHandler.
Definition at line 121 of file ValidateSAX2ContentHandler.cpp.
void SAX2ContentHandler::characters | ( | const XMLCh *const | chars, |
const XMLSize_t | length | ||
) |
Called if character data occurs.
chars | Character data. |
length | Length of the Character data. |
Definition at line 390 of file ValidateSAX2ContentHandler.cpp.
References buffer, stringForm, and trim().
void SAX2ContentHandler::endDocument | ( | ) |
Called if the document ends.
Definition at line 131 of file ValidateSAX2ContentHandler.cpp.
References adjacencyMatrix, doubleZero, failed, isUndirected, n, and parsedEntries.
void SAX2ContentHandler::endElement | ( | const XMLCh *const | uri, |
const XMLCh *const | localname, | ||
const XMLCh *const | qname | ||
) |
Called if an element ends.
uri | URI of the associated namespace for this element. |
localname | Local part of the element name. |
qname | QName of this element. |
Definition at line 226 of file ValidateSAX2ContentHandler.cpp.
References adjacencyMatrix, buffer, cost, costsOfEdgesDefinedInTheFirstVertex, description, doublePrecision, doubleZero, edgesDefinedInTheFirstVertex, failed, firstVertex, ignoredDigits, n, name, numberOfParsedVertices, parsedEntries, source, trim(), unicodeForm, XML_DESCRIPTION, XML_DOUBLE_PRECISION, XML_EDGE, XML_GRAPH, XML_IGNORED_DIGITS, XML_NAME, XML_SOURCE, and XML_VERTEX.
void SAX2ContentHandler::endPrefixMapping | ( | const XMLCh *const | prefix | ) |
Receive notification of the end of an namespace prefix mapping.
prefix | Namespace prefix used. |
Definition at line 186 of file ValidateSAX2ContentHandler.cpp.
std::vector<std::vector<double> > SAX2ContentHandler::getAdjacencyMatrix | ( | ) | [inline] |
Returns the adjacency matrix of a weighted undirected complete graph. The elements in the matrix are the costs.
Definition at line 220 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
std::string SAX2ContentHandler::getDescription | ( | ) | const [inline] |
Returns the description.
Definition at line 182 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
std::streamsize SAX2ContentHandler::getDoublePrecision | ( | ) | const [inline] |
Returns the precision of doubles.
Definition at line 190 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
double SAX2ContentHandler::getDoubleZero | ( | ) | const [inline] |
Returns the maximum of an absolute value considered as zero.
Definition at line 210 of file ValidateSAX2ContentHandler.hpp.
bool SAX2ContentHandler::getFailed | ( | ) | const [inline] |
Returns true if the last validation failed
Definition at line 158 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
std::streamsize SAX2ContentHandler::getIgnoredDigits | ( | ) | const [inline] |
Returns the number of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).)
Definition at line 202 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
std::string SAX2ContentHandler::getName | ( | ) | const [inline] |
Returns the name.
Definition at line 166 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
std::string SAX2ContentHandler::getSource | ( | ) | const [inline] |
Returns the source.
Definition at line 174 of file ValidateSAX2ContentHandler.hpp.
Referenced by instanceIn().
void SAX2ContentHandler::ignorableWhitespace | ( | const XMLCh *const | chars, |
const XMLSize_t | length | ||
) |
Called if whitespaces occurs. The method does nothing.
chars | Whitespace data. |
length | Length of the Character data. |
Definition at line 414 of file ValidateSAX2ContentHandler.cpp.
void SAX2ContentHandler::init | ( | ) | [private] |
Initates the class variables.
Definition at line 97 of file ValidateSAX2ContentHandler.cpp.
Referenced by resetDocument(), SAX2ContentHandler(), and startDocument().
SAX2ContentHandler& SAX2ContentHandler::operator= | ( | const SAX2ContentHandler & | sAX2ContentHandler | ) | [private] |
Not implemented operator "=".
sAX2ContentHandler | Right side of the operator. |
void SAX2ContentHandler::processingInstruction | ( | const XMLCh *const | target, |
const XMLCh *const | data | ||
) |
Called if processing instructions occurs. The method does nothing.
target | Processing instruction target. |
data | Processing instruction data. |
Definition at line 417 of file ValidateSAX2ContentHandler.cpp.
void SAX2ContentHandler::resetDocument | ( | ) |
Reset the Document object on its reuse. The method does nothing.
Definition at line 420 of file ValidateSAX2ContentHandler.cpp.
References init().
void SAX2ContentHandler::setDocumentLocator | ( | const Locator *const | locator | ) |
Receive a Locator object for document events. The method does nothing.
locator | Object that can return the location of any SAX document event. |
Definition at line 124 of file ValidateSAX2ContentHandler.cpp.
void SAX2ContentHandler::skippedEntity | ( | const XMLCh *const | name | ) |
Receive notification of a skipped entity. The method does nothing.
name | Name of the skipped entity. |
Definition at line 189 of file ValidateSAX2ContentHandler.cpp.
void SAX2ContentHandler::startDocument | ( | ) |
Called if the document starts.
Definition at line 127 of file ValidateSAX2ContentHandler.cpp.
References init().
void SAX2ContentHandler::startElement | ( | const XMLCh *const | uri, |
const XMLCh *const | localname, | ||
const XMLCh *const | qname, | ||
const Attributes & | attributes | ||
) |
Called if an element starts.
uri | URI of the associated namespace for this element. |
localname | Local part of the element name |
qname | QName of this element. |
attributes | Attributes attached to the element, if any. |
Definition at line 192 of file ValidateSAX2ContentHandler.cpp.
References buffer, cost, costsOfEdgesDefinedInTheFirstVertex, failed, firstVertex, n, stringForm, trim(), unicodeForm, XML_EDGE, and XML_VERTEX.
void SAX2ContentHandler::startPrefixMapping | ( | const XMLCh *const | prefix, |
const XMLCh *const | uri | ||
) |
Receive notification of the start of an namespace prefix mapping. The method does nothing
prefix | namespace prefix used. |
uri | Namespace URI used. |
Definition at line 183 of file ValidateSAX2ContentHandler.cpp.
std::vector<std::vector<double> > SAX2ContentHandler::adjacencyMatrix [private] |
Adjacency matrix of a weighted undirected complete graph. The elements in the matrix are the costs. The elements in the matrix are the costs. The matrix can be either only a lower triangular matrix for undirected graphs or it can be a square matrix for the directed graph.
Definition at line 109 of file ValidateSAX2ContentHandler.hpp.
Referenced by endDocument(), and endElement().
std::string SAX2ContentHandler::buffer [private] |
Buffer to parse character data.
Definition at line 114 of file ValidateSAX2ContentHandler.hpp.
Referenced by characters(), endElement(), and startElement().
double SAX2ContentHandler::cost [private] |
Cost of the current edge.
Definition at line 119 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement(), and startElement().
std::vector<double> SAX2ContentHandler::costsOfEdgesDefinedInTheFirstVertex [private] |
Cost of edges incident with the first vertes.
Definition at line 90 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement(), and startElement().
std::string SAX2ContentHandler::description [private] |
Description of the instance.
Definition at line 54 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().
std::streamsize SAX2ContentHandler::doublePrecision [private] |
Precision of doubles.
Definition at line 59 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().
double SAX2ContentHandler::doubleZero [private] |
Maximum of an absolute value considered as zero.
Definition at line 70 of file ValidateSAX2ContentHandler.hpp.
Referenced by endDocument(), and endElement().
std::set<std::vector<double>::size_type> SAX2ContentHandler::edgesDefinedInTheFirstVertex [private] |
Edges defined in the first vertex
Definition at line 85 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().
bool SAX2ContentHandler::failed [private] |
True if the last internal validation fails.
Definition at line 30 of file ValidateSAX2ContentHandler.hpp.
Referenced by endDocument(), endElement(), and startElement().
bool SAX2ContentHandler::firstVertex [private] |
true during parsing the first vertex
Definition at line 75 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement(), and startElement().
std::streamsize SAX2ContentHandler::ignoredDigits [private] |
Number of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).)
Definition at line 65 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().
bool SAX2ContentHandler::isUndirected [private] |
Indicator indicating if the graph is undirected.
Definition at line 39 of file ValidateSAX2ContentHandler.hpp.
Referenced by endDocument().
std::vector<std::vector<double> >::size_type SAX2ContentHandler::n [private] |
Number of vertices in the graph of the instance.
Definition at line 95 of file ValidateSAX2ContentHandler.hpp.
Referenced by endDocument(), endElement(), and startElement().
std::string SAX2ContentHandler::name [private] |
Name of the instance.
Definition at line 44 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().
std::vector<std::vector<double> >::size_type SAX2ContentHandler::numberOfParsedVertices [private] |
Number of parsed vertices.
Definition at line 80 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().
std::vector<std::vector<bool> > SAX2ContentHandler::parsedEntries [private] |
Matrix indicating which vertices were parsed.
Definition at line 100 of file ValidateSAX2ContentHandler.hpp.
Referenced by endDocument(), and endElement().
std::string SAX2ContentHandler::source [private] |
Source of the instance.
Definition at line 49 of file ValidateSAX2ContentHandler.hpp.
Referenced by endElement().