#include <xmladaptivemodel.h>
Inheritance diagram for XmlAdaptiveModel:
Public Methods | |
XmlAdaptiveModel (void) | |
A constructor. More... | |
virtual | ~XmlAdaptiveModel (void) |
A destructor. More... | |
virtual bool | manageEvent (XmlModelEvent *event) |
Manage XML events. More... | |
virtual void | setGrammar (GrammarBase *gr) |
Set a grammar for the model. More... | |
virtual void | setSAXEmitter (SAXEmitter *emitter, void *data=0) |
Set SAX emitter for decoding. More... | |
virtual void | receiveData (XmlChar *data, size_t size) |
Receive data from another object. More... | |
Protected Attributes | |
GrammarBase * | grammar |
The pointer to the grammar used for compression. | |
bool | inCDATA |
Indication of CDATA section. | |
bool | inCharacters |
Indication of the characters section. | |
bool | inComment |
Indication of the comment section. | |
char | inPI |
Indication of the processing instruction section. More... | |
bool | inProlog |
indication whether we are in the XML prolog. | |
bool | inNACK |
Indication whether the model has to perform some NACK operation. | |
bool | inDoctype |
Indication of DOCTYPE section. | |
bool | inAttr |
Indication whether the model is processing the attributes of some element. | |
bool | inAttrValue |
Indication if the value of some attribute is being read. | |
bool | firstAttrRead |
Indication whether the first attribute of the element has been read. | |
bool | nackEndedInCharacters |
Indication when NACK caused a step to a character node. | |
int | attrPos |
The position when reading the attributes. More... | |
AdaptiveStructuralSymbols::Symbol | state |
State of the model. More... | |
ElementIds * | elementIds |
Hashtable of element ids. | |
AdaptiveElementTable * | elements |
Hashtable of element contexts. | |
AttributeNamesTable * | attributeNames |
Hashtable of attribute names. | |
ElementNamesList * | elementNamesList |
List of element names. | |
unsigned long | elementCounter |
Counter for unique element numbering. | |
AttributeIds * | attributeIds |
Hashtable of attribute ids. | |
AttributeNamesList * | attributeNamesList |
List of attribute names. | |
unsigned long | attributeCounter |
Counter for unique attribute numbering. | |
Stack< unsigned long > * | elementStack |
Stack of element ids. More... | |
Stack< ElementModelerInfo > | elementModelerStack |
A stack of modelers of the elements. | |
List< ElementModeler > | elementModelerList |
The list of modelers of the elements. | |
size_t | clueEdge |
The value of the clue edge. | |
bool | readingNackData |
Indication whether the model is reading the NACK data. | |
XmlChar * | buffer |
Buffer for read data. More... | |
size_t | bufferLength |
Length of the data in the buffer. | |
size_t | fibBits |
Number of read bits of Fibonacci code. More... | |
unsigned long | fibCode |
Read Fibonacci code. More... | |
bool | fibLastWasOne |
Helper variable for decoding the Fibonacci codes. | |
DataQueue * | dataQueue |
A queue of decoded data items (such as attribute names and values, etc.). | |
SAXEmitter * | saxEmitter |
Pointer to the SAX emitter. More... | |
void * | userData |
User data for SAX emitter. More... |
This class implements an adaptive model used for encoding and decoding of XML data. When compressing, the model tries to build an oriented graph describing the elements of the document, and to predict the document's structure on the basis of this graphs.
Definition at line 166 of file xmladaptivemodel.h.
|
|
A destructor. The resources occupied by the model are freed. In verbose mode, the information about the entropy of the document is displayed. Definition at line 318 of file xmladaptivemodel.cpp. References attributeIds, attributeNames, attributeNamesList, ElementModeler::computeAverageEntropy, Collection< XmlChar >::count, dataQueue, DELETE, elementModelerList, elementNamesList, elements, elementStack, List< ElementModeler >::first, ElementModeler::getAverageEntropy, ExaltOptions::getOption, ElementModeler::getRefCount, List< ElementModeler >::next, OUTPUTEENDLINE, OUTPUTENL, ElementModeler::print, ExaltOptions::PrintModels, ExaltOptions::Verbose, and ExaltOptions::Yes. |
|
|
Receive data from another object. This method implements the decoding procedure. It receives data from the underlying grammar and reconstructs the XML data.
Implements XmlModelBase. Definition at line 1396 of file xmladaptivemodel.cpp. References List< ElementModeler >::append, List< XmlChar >::append, attributeCounter, attributeNames, attributeNamesList, attrPos, buffer, bufferLength, ElementModelerInfo::building, CHANGE_STATE, CHECK_POINTER, Queue< DataQueueItem >::clear, clueEdge, Collection< DataQueueItem >::count, Collection< ElementModelerInfo >::count, ElementModeler::currentNodeType, DataQueueItem::data, dataQueue, DBG, Fibonacci::decode, DELETE, Queue< DataQueueItem >::dequeue, elementCounter, elementModelerList, elementModelerStack, elementNamesList, elements, elementStack, Queue< DataQueueItem >::enqueue, FATAL, fibBits, fibCode, fibLastWasOne, HashTable< unsigned long, XmlChar, List, 3079 >::find, HashTable< unsigned long, AdaptiveElementContext, List, 3079 >::find, FINISH_START_ELEMENT_WITH_NO_ATTRIBUTES, firstAttrRead, ElementModeler::followEdge, ElementModeler::getCurrentNode, ElementModeler::getElementName, ElementModeler::hasAttributes, inAttr, inAttrValue, inCDATA, inCharacters, inComment, ElementModeler::increaseRefCount, inDoctype, inNACK, inPI, inProlog, HashTable< unsigned long, AdaptiveElementContext, List, 3079 >::insert, HashTable< unsigned long, XmlChar, List, 3079 >::insert, Collection< DataQueueItem >::isEmpty, Collection< ElementModelerInfo >::isEmpty, AdaptiveElementContext::modeler, ElementModel::Node::modeler, ElementModelerInfo::modeler, ElementModeler::moveForward, ElementModeler::moveToDesiredNode, nackEndedInCharacters, AdaptiveElementContext::name, NEW, Stack< unsigned long >::pop, Stack< ElementModelerInfo >::pop, ElementModeler::popCurrentNode, Stack< unsigned long >::push, Stack< ElementModelerInfo >::push, readingNackData, RESET_BUFFER, RESET_STATE, ElementModeler::resetCurrentNode, SAFE_CALL_EMITTER, saxEmitter, ElementModeler::setAttributes, state, Stack< ElementModelerInfo >::top, ElementModel::Node::type, DataQueueItem::type, userData, XML_MODEL_BUFFER_DEFAULT_SIZE, XmlChar, xmlchar_strcpy, and xmlchar_strlen. |
|
Set a grammar for the model.
Sets a grammar that is used for the compression of the data.
Implements XmlModelBase. Definition at line 185 of file xmladaptivemodel.h. References grammar. |
|
Set SAX emitter for decoding. Sets the SAX emitter and (optionaly) the user data.
Implements XmlModelBase. Definition at line 385 of file xmladaptivemodel.cpp. References saxEmitter, and userData. |
|
The position when reading the attributes.
Value 0 indicates that we are starting to read the attributes, and value 1 means that we read all the attributes. Definition at line 242 of file xmladaptivemodel.h. Referenced by receiveData, and XmlAdaptiveModel. |
|
Buffer for read data.
Used during decoding. Definition at line 305 of file xmladaptivemodel.h. Referenced by receiveData, and XmlAdaptiveModel. |
|
Stack of element ids.
Stores the "level" in the document. Definition at line 284 of file xmladaptivemodel.h. Referenced by manageEvent, receiveData, XmlAdaptiveModel, and ~XmlAdaptiveModel. |
|
Number of read bits of Fibonacci code.
Used during decoding. Definition at line 317 of file xmladaptivemodel.h. Referenced by receiveData, and XmlAdaptiveModel. |
|
Read Fibonacci code.
Used during decoding. Definition at line 324 of file xmladaptivemodel.h. Referenced by receiveData, and XmlAdaptiveModel. |
|
Indication of the processing instruction section.
The value 2 indicates that a target is being read, and value 1 indicates that a value is being read. Definition at line 214 of file xmladaptivemodel.h. Referenced by receiveData. |
|
Pointer to the SAX emitter.
Used during decoding. Definition at line 337 of file xmladaptivemodel.h. Referenced by receiveData, setSAXEmitter, and XmlAdaptiveModel. |
|
State of the model.
Used during decoding. State is represented by AdaptiveStructuralSymbols. Definition at line 249 of file xmladaptivemodel.h. Referenced by receiveData, and XmlAdaptiveModel. |
|
User data for SAX emitter.
Used during decoding. Definition at line 344 of file xmladaptivemodel.h. Referenced by receiveData, setSAXEmitter, and XmlAdaptiveModel. |