Skip to content

QuantumGate::Local::QueryPeers

Karel Donk edited this page Dec 10, 2019 · 5 revisions

Returns a collection of peers on the instance based on custom criteria.

Signature

  1. Result<Vector<PeerLUID>>
        QueryPeers(const PeerQueryParameters& params) const noexcept;
  2. Result<> QueryPeers(const PeerQueryParameters& params,
        Vector<PeerLUID>& pluids) const noexcept;

Parameters

Name Description
params A QuantumGate::PeerQueryParameters object with query details. See QuantumGate::PeerQueryParameters for more details.
pluids A QuantumGate::Vector collection of QuantumGate::PeerLUIDs to hold the peers from the query.

Return values

The first overload returns a QuantumGate::Result object containing, upon successful completion, a QuantumGate::Vector collection of QuantumGate::PeerLUIDs of the peers that match the query parameters.

When the second overload is used, the peers that match the query parameters are returned in the pluids parameter upon successful completion. Any data existing in the pluids parameter is cleared before the query is executed. However, the memory buffer of the collection is preserved, which can result in better performance compared to the other overload because potentially no (re)allocation may be required.

In all cases the QuantumGate::Result object will equal one of the following QuantumGate::ResultCodes:

Value Description
QuantumGate::ResultCode::Succeeded The operation succeeded.
QuantumGate::ResultCode::Failed The operation failed.
QuantumGate::ResultCode::NotRunning The operation failed because the instance isn't running.
Clone this wiki locally