blob: 187e939c0d3ea466ba37fc7a4206963b77a19669 [file]
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef IOTDB_ENDPOINT_H
#define IOTDB_ENDPOINT_H
#include <cstdint>
#include <functional>
#include <string>
struct Endpoint {
std::string host;
int32_t port = 0;
};
struct EndpointHash {
size_t operator()(const Endpoint& endpoint) const {
return std::hash<std::string>()(endpoint.host) ^ std::hash<int>()(endpoint.port);
}
};
struct EndpointEqual {
bool operator()(const Endpoint& lhs, const Endpoint& rhs) const {
return lhs.host == rhs.host && lhs.port == rhs.port;
}
};
#endif