Skip to content
Snippets Groups Projects

F cpp to string

Merged Timm Fitschen requested to merge f-cpp-to-string into dev
All threads resolved!
Files
14
+ 10
9
@@ -40,6 +40,7 @@ using ProtoReferenceDataType = caosdb::entity::v1alpha1::ReferenceDataType;
using DataTypeCase = caosdb::entity::v1alpha1::DataType::DataTypeCase;
using ListDataTypeCase = caosdb::entity::v1alpha1::ListDataType::ListDataTypeCase;
using caosdb::utility::ProtoMessageWrapper;
using caosdb::utility::ScalarProtoMessageWrapper;
class Entity;
class Property;
@@ -68,7 +69,7 @@ const std::map<AtomicDataType, std::string> atomicdatatype_names = {
class DataType;
class ListDataType;
class ReferenceDataType : public ProtoMessageWrapper<ProtoDataType> {
class ReferenceDataType : public ScalarProtoMessageWrapper<ProtoDataType> {
public:
[[nodiscard]] inline auto GetName() const noexcept -> const std::string & {
// is list of reference?
@@ -91,11 +92,11 @@ protected:
inline static auto Create(ProtoDataType *wrapped) -> std::unique_ptr<ReferenceDataType> {
return std::unique_ptr<ReferenceDataType>(new ReferenceDataType(wrapped));
}
ReferenceDataType() : ProtoMessageWrapper<ProtoDataType>() {}
ReferenceDataType(ProtoDataType *wrapped) : ProtoMessageWrapper<ProtoDataType>(wrapped) {}
ReferenceDataType() : ScalarProtoMessageWrapper<ProtoDataType>() {}
ReferenceDataType(ProtoDataType *wrapped) : ScalarProtoMessageWrapper<ProtoDataType>(wrapped) {}
};
class ListDataType : public ProtoMessageWrapper<ProtoDataType> {
class ListDataType : public ScalarProtoMessageWrapper<ProtoDataType> {
public:
[[nodiscard]] inline auto IsListOfReference() const noexcept -> bool {
return this->wrapped->list_data_type().list_data_type_case() ==
@@ -130,17 +131,17 @@ protected:
inline static auto Create(ProtoDataType *wrapped) -> std::unique_ptr<ListDataType> {
return std::unique_ptr<ListDataType>(new ListDataType(wrapped));
}
ListDataType() : ProtoMessageWrapper<ProtoDataType>() {}
ListDataType() : ScalarProtoMessageWrapper<ProtoDataType>() {}
ListDataType(ProtoDataType *wrapped) : ProtoMessageWrapper<ProtoDataType>(wrapped) {}
ListDataType(ProtoDataType *wrapped) : ScalarProtoMessageWrapper<ProtoDataType>(wrapped) {}
mutable std::unique_ptr<ReferenceDataType> reference_data_type;
};
class DataType : public ProtoMessageWrapper<ProtoDataType> {
class DataType : public ScalarProtoMessageWrapper<ProtoDataType> {
public:
DataType(ProtoDataType *wrapped) : ProtoMessageWrapper<ProtoDataType>(wrapped) {}
DataType() : ProtoMessageWrapper<ProtoDataType>() {}
DataType(ProtoDataType *wrapped) : ScalarProtoMessageWrapper<ProtoDataType>(wrapped) {}
DataType() : ScalarProtoMessageWrapper<ProtoDataType>() {}
/**
* Create an AtomicDataType typed DataType. For references, use the std::string constructor.
*/
Loading