#include <streampreprocessor.h>
Public Member Functions | |
virtual | ~StreamPreProcessor () |
void | processOpeningTag (const char *tag) |
Process the passed opening tag. | |
void | processBachelorTag (const char *tag) |
Process the passed bachelor tag. | |
void | processClosingTag () |
Process closing tag message. | |
void | processPCData (const char *data) |
Process PCDATA content. | |
void | readNext () |
Projects another token into the buffer. | |
void | readAll () |
Projects the whole input stream into the buffer. | |
Static Public Member Functions | |
static void | initInstance (Buffer *_buffer, ProjectionDFA *_pdfa) |
Initializes the one and only stream preprocessor instance (singleton). | |
static StreamPreProcessor * | getInstance () |
Returns the one and only instance of the stream preprocessor. | |
Private Member Functions | |
StreamPreProcessor (Buffer *_buffer, ProjectionDFA *_pdfa) | |
Constructor. | |
Private Attributes | |
TagMap * | tagmap |
Map for translating tags to their integer ids and vice versa. | |
TAG | tag |
The last recently processed opening tag. | |
StreamTracker | st |
The StreamTracker object used to keep track of the input stream. | |
Static Private Attributes | |
static StreamPreProcessor * | instance = NULL |
Instance of StreamPreProcessor. |
The stream preprocessor controls static stream projection, which bases on an analysis of the paths used in the input query. It provides the getNext()-function, which allows the query evaluator to project new data into the buffer on demand. This is realized by passing data to the StreamTracker, which itself communicates directly with the buffer.
Definition at line 78 of file streampreprocessor.h.
StreamPreProcessor::~StreamPreProcessor | ( | ) | [virtual] |
StreamPreProcessor::StreamPreProcessor | ( | Buffer * | _buffer, | |
ProjectionDFA * | _pdfa | |||
) | [private] |
Constructor.
Constructor - creating object for a Buffer and a ProjectionDFA.
[in] | _buffer | A pointer to the buffer where data is stored in. |
[in] | _pdfa | The projection DFA that is used for stream preprojection. |
Definition at line 47 of file streampreprocessor.cpp.
References getInstance(), InputStream::getParserStream(), and yyxmlin.
Referenced by initInstance().
static StreamPreProcessor * StreamPreProcessor::getInstance | ( | ) | [static] |
Returns the one and only instance of the stream preprocessor.
Returns the one and only instance of the stream preprocessor. The method should be called after having initialized the instance using method initInstance().
StreamPreprocessor* | The global stream preprocessor object. |
Definition at line 43 of file streampreprocessor.cpp.
References instance.
Referenced by Executor::preprocessStream(), saxBeginElement(), saxBeginEndElement(), saxCharacters(), saxEndElement(), StreamPreProcessor(), and Executor::~Executor().
static void StreamPreProcessor::initInstance | ( | Buffer * | _buffer, | |
ProjectionDFA * | _pdfa | |||
) | [static] |
Initializes the one and only stream preprocessor instance (singleton).
Initializes the stream preprocessor. The initialized instance can then be accessed using method getInstance().
[in] | _buffer | A pointer to the buffer where data is stored in. |
[in] | _pdfa | The projection DFA that is used for stream preprojection. |
void |
Definition at line 39 of file streampreprocessor.cpp.
References instance, and StreamPreProcessor().
Referenced by Executor::initStreamParser().
void StreamPreProcessor::processBachelorTag | ( | const char * | tag | ) | [inline] |
Process the passed bachelor tag.
The bachelor tag parameter is, depending on the state of projection dfa, either appended to the buffer or discarded. If appended, roles are also added to the buffer.
[in] | tag | The name of the bachelor tag that read in the input stream. |
void |
Definition at line 125 of file streampreprocessor.h.
Referenced by saxBeginEndElement().
void StreamPreProcessor::processClosingTag | ( | ) | [inline] |
Process closing tag message.
If the corresponding opening that has not been projected away, the active buffer opening tag is marked as closed.
void |
Definition at line 150 of file streampreprocessor.h.
References StreamTracker::processClosingTag(), and st.
Referenced by saxEndElement().
void StreamPreProcessor::processOpeningTag | ( | const char * | tag | ) | [inline] |
Process the passed opening tag.
The opening tag parameter is, depending on the state of projection dfa, either appended to the buffer or discarded. If appended, roles are also added to the buffer.
[in] | tag | The name of the tag that has been encountered in the input stream. |
void |
Definition at line 115 of file streampreprocessor.h.
References StreamTracker::processOpeningTag(), and st.
Referenced by saxBeginElement().
void StreamPreProcessor::processPCData | ( | const char * | data | ) | [inline] |
Process PCDATA content.
The PCDATA content is, depending on the state of projection dfa, either appended to the buffer or discarded.
[in] | data | The PCDATA content that has been encountered in the input stream |
void |
Definition at line 162 of file streampreprocessor.h.
References StreamTracker::processPCData(), and st.
Referenced by saxCharacters().
void StreamPreProcessor::readAll | ( | ) |
Projects the whole input stream into the buffer.
This method is not used in typical runs, but required if only input stream projection is carried out. Be aware that, when using this method, the whole document will be loaded into the buffer and the benefit of the signOff mechanism will be totally lost. The purpose of this method is for debugging.
void |
Definition at line 68 of file streampreprocessor.cpp.
References StreamTracker::processClosingTag(), saxparse(), st, and TAGID_ROOT.
Referenced by Executor::preprocessStream().
void StreamPreProcessor::readNext | ( | ) |
Projects another token into the buffer.
This is done by querying the next token from the SAX parser. As a response, typically one of the three methods processOpeningTag(), processPCData(), or closeTag() will be called.
void |
Definition at line 58 of file streampreprocessor.cpp.
References StreamTracker::processClosingTag(), saxparse(), st, and TAGID_ROOT.
Referenced by BufferIterator::getNext(), and BufferIterator::isSatisfyingPath().
static StreamPreProcessor * StreamPreProcessor::instance = NULL [static, private] |
Instance of StreamPreProcessor.
Instance of StreamPreProcessor to avoid duplicate existence of this object.
Definition at line 191 of file streampreprocessor.h.
Referenced by getInstance(), and initInstance().
StreamTracker StreamPreProcessor::st [private] |
The StreamTracker object used to keep track of the input stream.
The StreamTracker object used to keep track of the input stream. Basically, the StreamPreprocessor passes the input stream to this object, which communicates directly with the buffer.
Definition at line 219 of file streampreprocessor.h.
Referenced by processClosingTag(), processOpeningTag(), processPCData(), readAll(), and readNext().
TAG StreamPreProcessor::tag [private] |
The last recently processed opening tag.
The last recently processed opening tag, mainly required to perform document validation.
Definition at line 211 of file streampreprocessor.h.
TagMap * StreamPreProcessor::tagmap [private] |
Map for translating tags to their integer ids and vice versa.
See class TagMap for more information.
Definition at line 204 of file streampreprocessor.h.