Skip to content

Commit

Permalink
Fix: improve protobuf concept (#39)
Browse files Browse the repository at this point in the history
# Description
Cleanup `ProtobufSerializable` concept.
  • Loading branch information
filippobrizzi authored Apr 2, 2024
1 parent ad57535 commit 77f82e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 1 addition & 3 deletions modules/serdes/include/hephaestus/serdes/protobuf/concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
namespace heph::serdes::protobuf {

template <class T>
struct ProtoAssociation {
using Type = void;
};
struct ProtoAssociation {};

template <typename T>
concept ProtobufMessage = requires(T proto, void* out_data, const void* in_data, int size) {
Expand Down
6 changes: 1 addition & 5 deletions modules/serdes/include/hephaestus/serdes/serdes.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
namespace heph::serdes {

template <class T>
concept ProtobufSerializable = requires(T data) {
{ !std::is_same_v<typename protobuf::ProtoAssociation<T>::Type, void> };
};

// ProtoAssociation<T>::Type
concept ProtobufSerializable = protobuf::ProtobufMessage<typename protobuf::ProtoAssociation<T>::Type>;

template <class T>
[[nodiscard]] auto serialize(const T& data) -> std::vector<std::byte>;
Expand Down
6 changes: 3 additions & 3 deletions modules/utils/src/version_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ static constexpr std::uint8_t VERSION_MAJOR = 0;
static constexpr std::uint8_t VERSION_MINOR = 0;
static constexpr std::uint16_t VERSION_PATCH = 1;

static constexpr std::string_view REPO_BRANCH = "feature/spinner";
static constexpr std::string_view BUILD_PROFILE = "RelWithDebInfo";
static constexpr std::string_view REPO_HASH = "6b4f737";
static constexpr std::string_view REPO_BRANCH = "fix/proto_concept";
static constexpr std::string_view BUILD_PROFILE = "Release";
static constexpr std::string_view REPO_HASH = "900c283";

} // namespace heph::utils

0 comments on commit 77f82e1

Please sign in to comment.