Skip to content
Snippets Groups Projects
Verified Commit 33b57593 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: consolidation

parent b4ae3e2b
No related branches found
No related tags found
1 merge request!12F consolidation
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define CAOSDB_VALUE_H #define CAOSDB_VALUE_H
#include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper #include "caosdb/protobuf_helper.h" // for ProtoMessageWrapper
#include "caosdb/entity/v1alpha1/main.pb.h" // for RepeatedPtrField, Message #include "caosdb/entity/v1alpha1/main.pb.h" // for RepeatedPtrField, Message
#include "caosdb/logging.h"
#include <google/protobuf/util/json_util.h> // for MessageToJson... #include <google/protobuf/util/json_util.h> // for MessageToJson...
#include <memory> // for unique_ptr #include <memory> // for unique_ptr
#include <string> // for string #include <string> // for string
...@@ -102,9 +102,13 @@ public: ...@@ -102,9 +102,13 @@ public:
class Value : public ProtoMessageWrapper<ProtoValue> { class Value : public ProtoMessageWrapper<ProtoValue> {
public: public:
explicit inline Value(const Value &value){
this->wrapped = value.wrapped;
}
inline Value() : ProtoMessageWrapper<ProtoValue>() { inline Value() : ProtoMessageWrapper<ProtoValue>() {
// has NULL_VALUE now // has NULL_VALUE now
} }
explicit inline Value(ProtoValue *wrapped) : ProtoMessageWrapper<ProtoValue>(wrapped) {}
explicit inline Value(const std::string &value) explicit inline Value(const std::string &value)
: ProtoMessageWrapper<ProtoValue>() { : ProtoMessageWrapper<ProtoValue>() {
this->wrapped->mutable_scalar_value()->set_string_value(value); this->wrapped->mutable_scalar_value()->set_string_value(value);
...@@ -214,6 +218,7 @@ public: ...@@ -214,6 +218,7 @@ public:
inline auto ToString() const noexcept -> const std::string { inline auto ToString() const noexcept -> const std::string {
CAOSDB_DEBUG_MESSAGE_STRING(*wrapped, out) CAOSDB_DEBUG_MESSAGE_STRING(*wrapped, out)
CAOSDB_LOG_DEBUG("caosdb::entity") << "HERE 1 [" << wrapped << "] " << out;
return out; return out;
} }
......
...@@ -197,14 +197,7 @@ auto Entity::SetVersionId(const std::string &id) -> void { ...@@ -197,14 +197,7 @@ auto Entity::SetVersionId(const std::string &id) -> void {
} }
auto Entity::CopyTo(ProtoEntity *target) -> void { auto Entity::CopyTo(ProtoEntity *target) -> void {
CAOSDB_DEBUG_MESSAGE_STRING(*(this->wrapped), out);
CAOSDB_LOG_DEBUG(logger_name) << "COPY ENTITY: " << out;
CAOSDB_DEBUG_MESSAGE_STRING(*target, out_2);
CAOSDB_LOG_DEBUG(logger_name) << "COPY ENTITY TO: " << out_2;
target->Clear();
target->CopyFrom(*(this->wrapped)); target->CopyFrom(*(this->wrapped));
CAOSDB_DEBUG_MESSAGE_STRING(*target, out_3);
CAOSDB_LOG_DEBUG(logger_name) << "COPY ENTITY FINAL: " << out_3;
} }
auto Entity::SetRole(Role role) -> void { auto Entity::SetRole(Role role) -> void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment