Skip to content

Commit

Permalink
BRAYNS-597 Bump dependencies. (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien4193 committed Dec 12, 2023
1 parent 61b6aea commit f3d4d4a
Show file tree
Hide file tree
Showing 28 changed files with 118 additions and 117 deletions.
2 changes: 1 addition & 1 deletion brayns/engine/core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class OsprayDeviceInitializer
[](void *data, OSPError error, const char *message)
{
(void)data;
brayns::Log::error("[OSPRAY] Error {}: {}", error, message);
brayns::Log::error("[OSPRAY] Error {}: {}", static_cast<int>(error), message);
throw std::runtime_error(message);
});

Expand Down
2 changes: 2 additions & 0 deletions brayns/engine/framebuffer/types/ProgressiveFrameHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "ProgressiveFrameHandler.h"

#include <utility>

namespace
{
class FrameSizeScaler
Expand Down
2 changes: 2 additions & 0 deletions brayns/engine/scene/ModelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "ModelManager.h"

#include <utility>

namespace
{
class InstanceFinder
Expand Down
2 changes: 2 additions & 0 deletions brayns/engine/systems/SimulationSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "SimulationSystem.h"

#include <utility>

#include <brayns/engine/components/SimulationInfo.h>

namespace
Expand Down
2 changes: 2 additions & 0 deletions brayns/json/JsonError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "JsonError.h"

#include <utility>

namespace brayns
{
JsonPathElement::JsonPathElement(size_t index):
Expand Down
8 changes: 0 additions & 8 deletions brayns/json/JsonType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,3 @@ JsonObject &JsonFactory::emplaceObject(JsonValue &json)
return *object;
}
} // namespace brayns

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::JsonType &type)
{
return stream << brayns::EnumInfo::getName(type);
}
} // namespace std
16 changes: 12 additions & 4 deletions brayns/json/JsonType.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <type_traits>
#include <unordered_map>

#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/fmt.h>

#include <Poco/JSON/Array.h>
#include <Poco/JSON/JSONException.h>
Expand Down Expand Up @@ -205,7 +205,15 @@ class JsonFactory
};
} // namespace brayns

namespace std
namespace fmt
{
std::ostream &operator<<(std::ostream &stream, const brayns::JsonType &type);
} // namespace std
template<>
struct formatter<brayns::JsonType> : fmt::formatter<std::string>
{
auto format(const brayns::JsonType &type, fmt::format_context &context) const
{
auto &name = brayns::EnumInfo::getName(type);
return fmt::formatter<std::string>::format(name, context);
}
};
} // namespace fmt
2 changes: 1 addition & 1 deletion brayns/json/adapters/ObjectAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

#pragma once

#include <algorithm>
#include <functional>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>

#include "PrimitiveAdapter.h"

Expand Down
2 changes: 1 addition & 1 deletion brayns/network/NetworkMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "NetworkMonitor.h"

#include <algorithm>
#include <utility>

namespace brayns
{
Expand Down
13 changes: 0 additions & 13 deletions brayns/network/client/ClientRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,3 @@ bool ClientRef::operator!=(const ClientRef &other) const
return _socket != other._socket;
}
} // namespace brayns

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::ClientRef &client)
{
return stream << client.getId();
}

size_t hash<brayns::ClientRef>::operator()(const brayns::ClientRef &client) const
{
return client.getId();
}
} // namespace std
21 changes: 17 additions & 4 deletions brayns/network/client/ClientRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <functional>
#include <memory>

#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/fmt.h>

#include <brayns/network/websocket/IWebSocket.h>

Expand Down Expand Up @@ -96,11 +96,24 @@ class ClientRef

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::ClientRef &client);

template<>
struct hash<brayns::ClientRef>
{
size_t operator()(const brayns::ClientRef &client) const;
size_t operator()(const brayns::ClientRef &client) const
{
return client.getId();
}
};
} // namespace std

namespace fmt
{
template<>
struct formatter<brayns::ClientRef> : fmt::formatter<size_t>
{
auto format(const brayns::ClientRef &client, fmt::format_context &context) const
{
return fmt::formatter<size_t>::format(client.getId(), context);
}
};
} // namespace fmt
15 changes: 0 additions & 15 deletions brayns/network/client/ClientRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,3 @@ std::string_view ClientRequest::getData() const
return _packet.getData();
}
} // namespace brayns

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::ClientRequest &request)
{
auto &client = request.getClient();
auto data = request.getData();
auto size = data.size();
auto binary = request.isBinary() ? "true" : "false";
stream << "{client = " << client;
stream << ", size = " << size;
stream << ", binary = " << binary << "}";
return stream;
}
} // namespace std
19 changes: 15 additions & 4 deletions brayns/network/client/ClientRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#pragma once

#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/fmt.h>

#include <brayns/network/websocket/InputPacket.h>

Expand Down Expand Up @@ -80,7 +80,18 @@ class ClientRequest
};
} // namespace brayns

namespace std
namespace fmt
{
std::ostream &operator<<(std::ostream &stream, const brayns::ClientRequest &request);
} // namespace std
template<>
struct formatter<brayns::ClientRequest> : fmt::formatter<std::string>
{
auto format(const brayns::ClientRequest &request, fmt::format_context &context) const
{
auto &client = request.getClient();
auto data = request.getData();
auto size = data.size();
auto binary = request.isBinary();
return format_to(context.out(), "{{client = {}, size = {}, binary = {}}}", client, size, binary);
}
};
} // namespace fmt
8 changes: 0 additions & 8 deletions brayns/network/jsonrpc/JsonRpcException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,3 @@ TaskCancelledException::TaskCancelledException():
{
}
} // namespace brayns

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::JsonRpcException &e)
{
return stream << "{code = " << e.getCode() << ", message = '" << e.what() << "'}";
}
} // namespace std
15 changes: 11 additions & 4 deletions brayns/network/jsonrpc/JsonRpcException.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <stdexcept>

#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/fmt.h>

#include <brayns/json/Json.h>

Expand Down Expand Up @@ -140,7 +140,14 @@ class TaskCancelledException : public JsonRpcException
};
} // namespace brayns

namespace std
namespace fmt
{
std::ostream &operator<<(std::ostream &stream, const brayns::JsonRpcException &e);
} // namespace std
template<>
struct formatter<brayns::JsonRpcException> : fmt::formatter<std::string>
{
auto format(const brayns::JsonRpcException &e, fmt::format_context &context) const
{
return format_to(context.out(), "{{code = {}, message = {}}}", e.getCode(), e.what());
}
};
} // namespace fmt
16 changes: 0 additions & 16 deletions brayns/network/jsonrpc/JsonRpcRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,3 @@ void JsonRpcRequest::progress(const std::string &operation, double amount) const
ClientSender::sendText(message, _client);
}
} // namespace brayns

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::JsonRpcRequest &request)
{
auto &client = request.getClient();
auto &id = request.getId();
auto &method = request.getMethod();
auto &binary = request.getBinary();
stream << "{client = " << client;
stream << ", id = " << id;
stream << ", method = " << method;
stream << ", binary = " << binary.size() << " bytes}";
return stream;
}
} // namespace std
20 changes: 16 additions & 4 deletions brayns/network/jsonrpc/JsonRpcRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <string_view>

#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/fmt.h>

#include <brayns/network/client/ClientRef.h>
#include <brayns/network/jsonrpc/JsonRpcException.h>
Expand Down Expand Up @@ -126,7 +126,19 @@ class JsonRpcRequest
};
} // namespace brayns

namespace std
namespace fmt
{
std::ostream &operator<<(std::ostream &stream, const brayns::JsonRpcRequest &request);
} // namespace std
template<>
struct formatter<brayns::JsonRpcRequest> : fmt::formatter<std::string>
{
auto format(const brayns::JsonRpcRequest &request, fmt::format_context &context) const
{
auto &client = request.getClient();
auto &id = request.getId();
auto &method = request.getMethod();
auto &binary = request.getBinary();
constexpr auto format = "{{client = {}, id = {}, method = {}, binary = {} bytes}}";
return format_to(context.out(), format, client, id, method, binary.size());
}
};
} // namespace fmt
13 changes: 0 additions & 13 deletions brayns/network/jsonrpc/RequestId.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,3 @@ void JsonAdapter<RequestId>::deserialize(const JsonValue &json, RequestId &value
}
}
} // namespace brayns

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::RequestId &id)
{
return stream << id.getDisplayText();
}

size_t hash<brayns::RequestId>::operator()(const brayns::RequestId &id) const
{
return id.getHashCode();
}
} // namespace std
21 changes: 17 additions & 4 deletions brayns/network/jsonrpc/RequestId.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <functional>
#include <typeindex>

#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/fmt.h>

#include <brayns/json/JsonAdapter.h>

Expand Down Expand Up @@ -75,11 +75,24 @@ struct JsonAdapter<RequestId>

namespace std
{
std::ostream &operator<<(std::ostream &stream, const brayns::RequestId &id);

template<>
struct hash<brayns::RequestId>
{
size_t operator()(const brayns::RequestId &id) const;
size_t operator()(const brayns::RequestId &id) const
{
return id.getHashCode();
}
};
} // namespace std

namespace fmt
{
template<>
struct formatter<brayns::RequestId> : fmt::formatter<std::string>
{
auto format(const brayns::RequestId &id, fmt::format_context &context) const
{
return fmt::formatter<std::string>::format(id.getDisplayText(), context);
}
};
} // namespace fmt
2 changes: 1 addition & 1 deletion brayns/utils/DynamicLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <algorithm>
#include <stdexcept>
#include <string>
#include <utility> // std::exchange
#include <utility>

#include <dlfcn.h>
#include <sys/times.h>
Expand Down
2 changes: 1 addition & 1 deletion brayns/utils/string/StringExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "StringExtractor.h"

#include <algorithm>
#include <utility> // std::exchange
#include <utility>

#include "StringInfo.h"
#include "StringTrimmer.h"
Expand Down

0 comments on commit f3d4d4a

Please sign in to comment.