My Project 1.7.4
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 863 of file value.h.

Constructor & Destructor Documentation

◆ Query() [1/2]

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

Definition at line 867 of file value.h.

◆ Query() [2/2]

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

◆ toString()

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

Definition at line 905 of file value.h.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 911 of file value.h.

Member Data Documentation

◆ none

bool dht::Query::none {false}

Definition at line 917 of file value.h.

◆ QUERY_PARSE_ERROR

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

Definition at line 865 of file value.h.

◆ select

Select dht::Query::select {}

Definition at line 915 of file value.h.

◆ where

Where dht::Query::where {}

Definition at line 916 of file value.h.


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