linkahead/protobuf_helper.h

Defines

LINKAHEAD_DEBUG_MESSAGE_STRING(message, out)
namespace linkahead
namespace utility

Functions

auto get_arena() -> Arena*
auto reset_arena() -> void
template<typename P>
class ProtoMessageWrapper
#include <protobuf_helper.h>

Abstract wrapper class for Protobuf messages.

Subclassed by linkahead::entity::RepeatedPtrFieldWrapper< Message, ProtoMessage >, linkahead::entity::RepeatedPtrFieldWrapper< Parent, ProtoParent >, linkahead::entity::RepeatedPtrFieldWrapper< Property, ProtoProperty >, linkahead::entity::RepeatedPtrFieldWrapper< T, P >, linkahead::utility::ScalarProtoMessageWrapper< P >

Public Functions

virtual ~ProtoMessageWrapper() = 0
inline virtual auto ToString() const noexcept -> const std::string = 0

Return a json representation of this object.

inline auto operator==(const ProtoMessageWrapper<P> &other) const noexcept -> bool

Return true if the underlying Protobuf messages have the same serialization.

inline auto operator!=(const ProtoMessageWrapper<P> &other) const noexcept -> bool

Return true if the underlying Protobuf messages have a different serialization.

Protected Functions

inline ProtoMessageWrapper()
inline ProtoMessageWrapper(P *wrapped)

Protected Attributes

P *wrapped

Protected Static Functions

static inline auto CopyProtoMessage(P *wrapped) -> P*
template<typename P>
class ScalarProtoMessageWrapper : public linkahead::utility::ProtoMessageWrapper<P>
#include <protobuf_helper.h>

Wrapper class for scalar Protobuf messages.

Scalar means in this context, any message but classes derived from RepeatedPtrField.

Subclassed by linkahead::entity::DataType, linkahead::entity::Entity, linkahead::entity::ListDataType, linkahead::entity::Message, linkahead::entity::Parent, linkahead::entity::Property, linkahead::entity::ReferenceDataType, linkahead::entity::ScalarValue, linkahead::entity::Value

Public Functions

inline virtual ~ScalarProtoMessageWrapper() = default
inline ScalarProtoMessageWrapper() = default
inline ScalarProtoMessageWrapper(P *wrapped)
inline virtual auto ToString() const noexcept -> const std::string override

Return a json representation of this object.