My Project: dht::Query Class Reference

My Project 3.7.7 C++ Distributed Hash Table

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
dht::Query Class Reference

Describes a query destined to another peer. More...

`#include <value.h>`

Collaboration diagram for dht::Query:
[legend]

## Public Member Functions
| Query (Select s={}, Where w={}, bool none=false)
| Query (std::string_view q_str)
bool | isSatisfiedBy (const Query &q) const
template<typename Packer>
void | msgpack_pack (Packer &pk) const
void | msgpack_unpack (const msgpack::object &o)
std::string | toString () const

## Public Attributes
Select | select {}
Where | where {}
bool | none {false}

## Static Public Attributes
static const std::string | QUERY_PARSE_ERROR

## Friends
std::ostream & | operator<< (std::ostream &s, const dht::Query &q)

## Detailed Description

Describes a query destined to another peer.

This class describes the list of filters on field values and the field itselves to include in the peer response to a GET operation. See FieldValue.

Definition at line 987 of file value.h.

## Constructor & Destructor Documentation

## ◆ Query() [1/2]

dht::Query::Query | ( | Select | s = {},
|  | Where | w = {},
|  | bool | none = false )
| inline

Definition at line 991 of file value.h.

## ◆ Query() [2/2]

dht::Query::Query | ( | std::string_view | q_str | ) |
| inline

Initializes a query based on a SQL-ish formatted string. The abstract form of such a string is the following:

[SELECT $field$ [WHERE $field$=$value$]]

where

- $field$ = *|id|value_type|owner_pk|user_type
- $value$ = $string$|$integer$
- $string$: a simple string WITHOUT SPACES.
- $integer$: a simple integer.

Definition at line 1009 of file value.h.

## Member Function Documentation

## ◆ isSatisfiedBy()

bool dht::Query::isSatisfiedBy | ( | const Query & | q | ) | const

Tell if the query is satisfied by another query.

## ◆ msgpack_pack()

template<typename Packer>

void dht::Query::msgpack_pack | ( | Packer & | pk | ) | const
| inline

Definition at line 1025 of file value.h.

## ◆ toString()

std::string dht::Query::toString | ( |  | ) | const
| inline

Definition at line 1036 of file value.h.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | s,
|  | const dht::Query & | q )
| friend

Definition at line 1043 of file value.h.

## Member Data Documentation

## ◆ none

bool dht::Query::none {false}

Definition at line 1050 of file value.h.

## ◆ QUERY_PARSE_ERROR

const std::string dht::Query::QUERY_PARSE_ERROR
| static

Definition at line 989 of file value.h.

## ◆ select

Select dht::Query::select {}

Definition at line 1048 of file value.h.

## ◆ where

Where dht::Query::where {}

Definition at line 1049 of file value.h.

The documentation for this class was generated from the following file:

- /home/noptrix/ba/blackarch/packages/opendht-c/src/opendht/include/opendht/value.h