Skip to content
Snippets Groups Projects

F grpc f acm

Merged Timm Fitschen requested to merge f-grpc-f-acm into dev
Files
2
+ 21
30
@@ -29,29 +29,24 @@
#ifndef CAOSDB_ENTITY_H
#define CAOSDB_ENTITY_H
#include "caosdb/data_type.h" // for DataType
#include "caosdb/entity/v1/main.pb.h" // for RepeatedPtrField
#include "caosdb/logging.h" // for CAOSDB_LOG_WARN
#include "caosdb/message_code.h" // for get_message_code
#include "caosdb/protobuf_helper.h" // for get_arena
#include "caosdb/status_code.h" // for StatusCode
#include "caosdb/value.h" // for Value
#include <boost/log/core/record.hpp> // for record
#include <boost/log/detail/attachable_sstream_buf.hpp> // for basic_ostring...
#include <boost/log/sources/record_ostream.hpp> // for basic_record_...
#include <boost/preprocessor/seq/limits/enum_256.hpp> // for BOOST_PP_SEQ_...
#include <boost/preprocessor/seq/limits/size_256.hpp> // for BOOST_PP_SEQ_...
#include <cstdint> // for int64_t
#include <filesystem> // for path
#include <google/protobuf/arena.h> // for Arena
#include <google/protobuf/message.h> // for RepeatedPtrField
#include <iosfwd> // for streamsize
#include <iterator> // for iterator, output_iterato...
#include <map> // for map
#include <stdexcept> // for out_of_range
#include <string> // for string, basic...
#include <utility> // for move
#include <vector> // for vector
#include "caosdb/data_type.h" // for DataType
#include "caosdb/entity/v1/main.pb.h" // for RepeatedPtrField
#include "caosdb/file_descriptor.h" // for FileDescriptor
#include "caosdb/logging.h" // for CAOSDB_LOG_WARN
#include "caosdb/message_code.h" // for get_message_code
#include "caosdb/protobuf_helper.h" // for get_arena
#include "caosdb/status_code.h" // for StatusCode
#include "caosdb/value.h" // for Value
#include <cstdint> // for int64_t
#include <filesystem> // for path
#include <google/protobuf/arena.h> // for Arena
#include <google/protobuf/message.h> // for RepeatedPtrField
#include <iterator> // for iterator, output_iterato...
#include <map> // for map
#include <stdexcept> // for out_of_range
#include <string> // for string, basic...
#include <utility> // for move
#include <vector> // for vector
namespace caosdb::entity {
using caosdb::entity::v1::IdResponse;
@@ -60,7 +55,6 @@ using std::filesystem::is_directory;
using ProtoParent = caosdb::entity::v1::Parent;
using ProtoProperty = caosdb::entity::v1::Property;
using ProtoEntity = caosdb::entity::v1::Entity;
using ProtoFileDescriptor = caosdb::entity::v1::FileDescriptor;
using ProtoMessage = caosdb::entity::v1::Message;
using ProtoValue = caosdb::entity::v1::Value;
using ProtoDataType = caosdb::entity::v1::DataType;
@@ -109,12 +103,6 @@ const std::map<Role, std::string> role_names = {{Role::UNSPECIFIED, "UNSPECIFIED
{Role::PROPERTY, "PROPERTY"},
{Role::FILE, "FILE"}};
struct FileDescriptor {
FileTransmissionId *file_transmission_id;
ProtoFileDescriptor *wrapped;
std::filesystem::path local_path;
};
/**
* Abstract base class for Messages, Properties and Parents container classes.
*
@@ -719,6 +707,9 @@ public:
: static_cast<ProtoDataType *>(nullptr)) {
properties.wrapped = this->wrapped->mutable_properties();
parents.wrapped = this->wrapped->mutable_parents();
if(this->wrapped->has_file_descriptor()) {
file_descriptor.wrapped = this->wrapped->mutable_file_descriptor();
}
};
explicit inline Entity(EntityResponse *response) : Entity(response->mutable_entity()) {
this->errors.wrapped->Swap(response->mutable_errors());
Loading