caosdb/protobuf_helper.h

Defines

CAOSDB_DEBUG_MESSAGE_STRING(message, out)
namespace caosdb
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 caosdb::entity::RepeatedPtrFieldWrapper< Message, ProtoMessage >, caosdb::entity::RepeatedPtrFieldWrapper< Property, ProtoProperty >, caosdb::entity::RepeatedPtrFieldWrapper< Parent, ProtoParent >, caosdb::utility::ScalarProtoMessageWrapper< ProtoProperty >, caosdb::utility::ScalarProtoMessageWrapper< ProtoParent >, caosdb::utility::ScalarProtoMessageWrapper< ProtoMessage >, caosdb::utility::ScalarProtoMessageWrapper< ProtoValue >, caosdb::utility::ScalarProtoMessageWrapper< ProtoDataType >, caosdb::utility::ScalarProtoMessageWrapper< ProtoScalarValue >, caosdb::utility::ScalarProtoMessageWrapper< ProtoEntity >, caosdb::entity::RepeatedPtrFieldWrapper< T, P >, caosdb::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 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.