My Project: dht::indexation::Pht Class Reference

My Project 3.7.7 C++ Distributed Hash Table

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
dht::indexation::Pht Class Reference

## Public Types
using | Key = std::map<std::string, Blob>
using | KeySpec = std::map<std::string, size_t>
using | LookupCallback = std::function<void(std::vector<std::shared_ptr<Value>>& values, const Prefix& p)>
typedef void(* | LookupCallbackRaw) (std::vector< std::shared_ptr< Value > > *values, Prefix *p, void *user_data)
using | LookupCallbackSimple = std::function<void(std::vector<std::shared_ptr<Value>>& values)>
typedef void(* | LookupCallbackSimpleRaw) (std::vector< std::shared_ptr< Value > > *values, void *user_data)

## Public Member Functions
| Pht (std::string name, KeySpec k_spec, std::shared_ptr< DhtRunner > dht)
void | lookup (Key k, LookupCallback cb={}, DoneCallbackSimple done_cb={}, bool exact_match=true)
void | lookup (Key k, LookupCallbackSimple cb={}, DoneCallbackSimple done_cb={}, bool exact_match=true)
void | insert (Key k, Value v, DoneCallbackSimple done_cb={})

## Static Public Member Functions
static LookupCallback | bindLookupCb (LookupCallbackRaw raw_cb, void *user_data)
static LookupCallbackSimple | bindLookupCbSimple (LookupCallbackSimpleRaw raw_cb, void *user_data)

## Static Public Attributes
static constexpr const size_t | MAX_NODE_ENTRY_COUNT {16}

## Detailed Description

Definition at line 274 of file pht.h.

## Member Typedef Documentation

## ◆ Key

using dht::indexation::Pht::Key = std::map<std::string, Blob>

Definition at line 288 of file pht.h.

## ◆ KeySpec

using dht::indexation::Pht::KeySpec = std::map<std::string, size_t>

Definition at line 292 of file pht.h.

## ◆ LookupCallback

using dht::indexation::Pht::LookupCallback = std::function<void(std::vector<std::shared_ptr<Value>>& values, const Prefix& p)>

Definition at line 293 of file pht.h.

## ◆ LookupCallbackRaw

typedef void(* dht::indexation::Pht::LookupCallbackRaw) (std::vector< std::shared_ptr< Value > > *values, Prefix *p, void *user_data)

Definition at line 295 of file pht.h.

## ◆ LookupCallbackSimple

using dht::indexation::Pht::LookupCallbackSimple = std::function<void(std::vector<std::shared_ptr<Value>>& values)>

Definition at line 304 of file pht.h.

## ◆ LookupCallbackSimpleRaw

typedef void(* dht::indexation::Pht::LookupCallbackSimpleRaw) (std::vector< std::shared_ptr< Value > > *values, void *user_data)

Definition at line 305 of file pht.h.

## Constructor & Destructor Documentation

## ◆ Pht()

dht::indexation::Pht::Pht | ( | std::string | name,
|  | KeySpec | k_spec,
|  | std::shared_ptr< DhtRunner > | dht )
| inline

Definition at line 315 of file pht.h.

## ◆ ~Pht()

virtual dht::indexation::Pht::~Pht | ( |  | ) |
| inlinevirtual

Definition at line 322 of file pht.h.

## Member Function Documentation

## ◆ bindLookupCb()

LookupCallback dht::indexation::Pht::bindLookupCb | ( | LookupCallbackRaw | raw_cb,
|  | void * | user_data )
| inlinestatic

Definition at line 296 of file pht.h.

## ◆ bindLookupCbSimple()

LookupCallbackSimple dht::indexation::Pht::bindLookupCbSimple | ( | LookupCallbackSimpleRaw | raw_cb,
|  | void * | user_data )
| inlinestatic

Definition at line 306 of file pht.h.

## ◆ insert()

void dht::indexation::Pht::insert | ( | Key | k,
|  | Value | v,
|  | DoneCallbackSimple | done_cb = {} )
| inline

Wrapper function which call the private one.

Parameters

  k | : Key to insert [i.e map of string, blob]
  v | : Value to insert
  done_cb | : Callbakc which going to be call when all the insert is done

Definition at line 344 of file pht.h.

## ◆ lookup() [1/2]

void dht::indexation::Pht::lookup | ( | Key | k,
|  | LookupCallback | cb = {},
|  | DoneCallbackSimple | done_cb = {},
|  | bool | exact_match = true )

Lookup a key for a value.

## ◆ lookup() [2/2]

void dht::indexation::Pht::lookup | ( | Key | k,
|  | LookupCallbackSimple | cb = {},
|  | DoneCallbackSimple | done_cb = {},
|  | bool | exact_match = true )
| inline

Definition at line 328 of file pht.h.

## Member Data Documentation

## ◆ MAX_NODE_ENTRY_COUNT

const size_t dht::indexation::Pht::MAX_NODE_ENTRY_COUNT {16}
| staticconstexpr

Definition at line 285 of file pht.h.

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

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