C++ Distributed Hash Table
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:
Collaboration graph
[legend]

Public Member Functions

 Query (Select s={}, Where w={}, bool none=false)
 
 Query (std::string 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

OPENDHT_PUBLIC friend 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 873 of file value.h.

Constructor & Destructor Documentation

◆ Query()

dht::Query::Query ( std::string  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 892 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.


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