caosdb/protobuf_helper.h

Defines

CAOSDB_DEBUG_MESSAGE_STRING(message, out)
namespace caosdb::utility

Functions

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

Abstract wrapper class for Protobuf messages.

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

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 caosdb::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 caosdb::entity::DataType, caosdb::entity::Entity, caosdb::entity::ListDataType, caosdb::entity::Message, caosdb::entity::Parent, caosdb::entity::Property, caosdb::entity::ReferenceDataType, caosdb::entity::ScalarValue, caosdb::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.