Pattern where a value::Matrix contains the row, column and table keys. More...
#include <keyvalue/pattern/Pattern.h>
Public Member Functions | |
bool | parse (frontend::Queue &queue) |
Parses the beginning of a frontend::Queue. | |
std::pair< string, value::Value > | pop () |
Gets and removes the next stored key-value pair. | |
bool | isEmpty () const |
Checks if the list of recognized key-value pairs is empty. | |
Private Attributes | |
size_t | next_ |
string | keys_ [3] |
value::Value | values_ [3] |
Pattern where a value::Matrix contains the row, column and table keys.
The value::Matrix M=M(i, j) is a m x n matrix with m > 2 and n > 2. It defines three key-value pairs (row, column and table) which can be given in two different formats.
For both formats, key table is in M(0, 0) and its value is the matrix M(i, j) for i = 2, ..., m and j = 2, ..., n.
bool parse | ( | frontend::Queue & | queue | ) | [virtual] |
Parses the beginning of a frontend::Queue.
When a pattern is recognized, the value::Value objects which make it are removed from frontend::Queue and all corresponding key-value pairs are stored inside the this class
for later queries.
queue | : frontend::Queue to be parsed. |
true
. Otherwise, it returns false
. Implements Pattern.
std::pair<string, value::Value> pop | ( | ) | [virtual] |
Gets and removes the next stored key-value pair.
The debug version checks if there is any key-value pair be popped (by calling isEmpty()) and throw an exception when the check fails. Release version has undefined behavior when the list is empty.
LogicError | : (Debug build only) When the list is empty. |
Implements Pattern.
bool isEmpty | ( | ) | const [virtual] |
Checks if the list of recognized key-value pairs is empty.
true
. Otherwise, it returns false
. Implements Pattern.