blob: d4411ee7f094f1017a268bb8b0d449ae56381271 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vbench/core/string.h>
namespace vbench {
/**
* Simple wrapper specifying the host and port of a server. This will
* typically be a HTTP server.
**/
struct ServerSpec
{
string host;
int port;
ServerSpec() : host(), port(0) {}
ServerSpec(const string &h, int p) : host(h), port(p) {}
bool operator==(const ServerSpec &rhs) const {
return (port == rhs.port && host == rhs.host);
}
bool operator<(const ServerSpec &rhs) const {
if (port == rhs.port) {
return (host < rhs.host);
}
return (port < rhs.port);
}
};
} // namespace vbench
|