Protocol class
which defines the Queue interface.
More...
#include <keyvalue/frontend/Queue.h>
Public Member Functions | |
virtual string | getName () const =0 |
virtual bool | isEmpty () const =0 |
Checks if this Queue is empty. | |
virtual value::Value | pop ()=0 |
Gets the next element and mark it for latter removal. | |
virtual void | remove ()=0 |
Removes popped elements definitely from the Queue. | |
virtual void | putBack ()=0 |
Puts popped elements back on the Queue. |
Protocol class
which defines the Queue interface.
Each front-end (spreadsheet add-in, XML parser, ...) has to implement a Queue which is responsible for converting from its own types to value::Value objects which become elements of the Queue.
Elements can be popped (throw pop()) one by one. When one element is popped, it is marked for later removal. Marked elements can be put back on the Queue (throw putBack()) or they can be definitely removed from it (throw remove()).
virtual bool isEmpty | ( | ) | const [pure virtual] |
virtual value::Value pop | ( | ) | [pure virtual] |
Gets the next element and mark it for latter removal.
The debug version should check if there is any element to be popped (by calling isEmpty()) and throw an exception when the check fails. The release version has undefined behavior when this Queue is empty.
LogicError | : (Debug build only) When there is no element to be popped. |
virtual void remove | ( | ) | [pure virtual] |
Removes popped elements definitely from the Queue.
The implementation should be such that it is safe to call this method even when there is no element to be removed.
virtual void putBack | ( | ) | [pure virtual] |
Puts popped elements back on the Queue.
The implementation should be such that it is safe to call this method even when there is no element to be put back.