My Project 3.5.5
C++ Distributed Hash Table
Loading...
Searching...
No Matches
dht::Query Class Reference

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

#include <value.h>

Collaboration diagram for dht::Query:

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 922 of file value.h.

Constructor & Destructor Documentation

◆ Query() [1/2]

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

Definition at line 926 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 941 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 956 of file value.h.

◆ toString()

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

Definition at line 964 of file value.h.

◆ operator<<

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

Definition at line 970 of file value.h.

Member Data Documentation

◆ none

bool dht::Query::none {false}

Definition at line 976 of file value.h.

◆ QUERY_PARSE_ERROR

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

Definition at line 924 of file value.h.

◆ select

Select dht::Query::select {}

Definition at line 974 of file value.h.

◆ where

Where dht::Query::where {}

Definition at line 975 of file value.h.


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