|
JASSv2
|
Details of a query term as parsed from the query. More...
#include <query_term.h>

Public Member Functions | |
| query_term () | |
| Constructor for an empty object. | |
| query_term (const query_term &original) | |
| Copy constructor. More... | |
| query_term (const slice &term, size_t query_frequency=1) | |
| Constructor. More... | |
| operator std::string () const | |
| Convert to a std::string. Useful for serialising. | |
| slice | token (void) const |
| Return the token as a slice. More... | |
| size_t | frequency () const |
| Return the frequency of this term in this query. More... | |
| bool | operator< (const query_term &with) const |
| Convert to a std::string. Useful for serialising. | |
Static Public Member Functions | |
| static void | unittest (void) |
| Unit test this class. | |
Private Attributes | |
| slice | term |
| The term. Note that the memory is kept elsewhere. | |
| size_t | query_frequency |
| Number of times the term occurs in the query. | |
Friends | |
| class | query_term_list |
| std::ostream & | operator<< (std::ostream &stream, const query_term &term) |
| Dump the contents of a query_term down an output stream. More... | |
Details of a query term as parsed from the query.
Objects of this type are generated by the query parsers and used to pass around details of a term used in a query
|
inline |
Copy constructor.
| original | [in] object to copy (note:n This is a shallow copy). |
|
inline |
Constructor.
| term | [in] Term that this object reprrsents. |
| query_frequency | [in] the number of times the term occurs in the query. |
Create a new query term object from a string and a frequency. Node that the term slice is copied and that the term is nod duplicated. That is, the memory containing the query term belongs to the caller and not to this object. This isn't a problem because ll memory associated with processing a query should be in a single allocator object.
|
inline |
Return the frequency of this term in this query.
|
inline |
Return the token as a slice.
|
friend |
Dump the contents of a query_term down an output stream.
| stream | [in] The stream to write to. |
| term | [in] The query_term to write. |
1.8.13