linkahead/data_type.h
-
namespace linkahead
-
namespace entity
DataTypes have 2 dimensions: They may be atomic or reference typed, and they may be scalar or list valued. If they are atomic, they have an AtomicDataType. If they are reference typed, the reference name can be obtained with GetName().
MessageCodes for entity messages.
In contrast to the status codes, the message codes are part of the LinkAhead API. Messages (and their codes) represent the state of the entities in a transaction or the server.
For a specification of the message codes, look at the protobuf documentation. The sources and documentation can be found at https://gitlab.indiscale.com/caosdb/src/caosdb-proto.
Typedefs
-
using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType
-
typedef caosdb::entity::v1::DataType ProtoDataType
-
using ProtoListDataType = caosdb::entity::v1::ListDataType
-
using ProtoReferenceDataType = caosdb::entity::v1::ReferenceDataType
-
using DataTypeCase = caosdb::entity::v1::DataType::DataTypeCase
-
using ListDataTypeCase = caosdb::entity::v1::ListDataType::ListDataTypeCase
Enums
Variables
-
const std::map<AtomicDataType, std::string> atomicdatatype_names = {{AtomicDataType::UNSPECIFIED, "UNSPECIFIED"}, {AtomicDataType::TEXT, "TEXT"}, {AtomicDataType::DOUBLE, "DOUBLE"}, {AtomicDataType::DATETIME, "DATETIME"}, {AtomicDataType::INTEGER, "INTEGER"}, {AtomicDataType::BOOLEAN, "BOOLEAN"}}
-
class DataType : public linkahead::utility::ScalarProtoMessageWrapper<ProtoDataType>
Public Functions
-
inline DataType(ProtoDataType *wrapped)
-
inline DataType()
-
inline DataType(AtomicDataType data_type, bool list_type = false)
Create an AtomicDataType typed DataType. For references, use the std::string constructor.
-
inline DataType(const std::string &data_type, bool list_type = false)
Create a reference typed DataType.
-
~DataType() = default
-
inline auto IsUndefined() const noexcept -> bool
-
inline auto IsAtomic() const noexcept -> bool
-
inline auto GetAsAtomic() const noexcept -> AtomicDataType
-
inline auto IsReference() const noexcept -> bool
-
inline auto GetAsReference() const noexcept -> const ReferenceDataType&
-
inline auto IsList() const noexcept -> bool
-
inline auto GetAsList() const noexcept -> const ListDataType&
Public Static Functions
-
static inline auto ListOf(const AtomicDataType &atomic_data_type) -> DataType
Protected Attributes
-
mutable std::unique_ptr<ReferenceDataType> reference_data_type
-
mutable std::unique_ptr<ListDataType> list_data_type
Friends
- friend class Entity
- friend class Property
-
inline DataType(ProtoDataType *wrapped)
-
class ListDataType : public linkahead::utility::ScalarProtoMessageWrapper<ProtoDataType>
Public Functions
-
inline auto IsListOfReference() const noexcept -> bool
-
inline auto GetReferenceDataType() const -> const ReferenceDataType&
-
inline auto IsListOfAtomic() const noexcept -> bool
-
inline auto GetAtomicDataType() const -> AtomicDataType
Protected Attributes
-
mutable std::unique_ptr<ReferenceDataType> reference_data_type
Protected Static Functions
-
static inline auto GetEmptyInstance() -> const ListDataType&
-
static inline auto Create(ProtoDataType *wrapped) -> std::unique_ptr<ListDataType>
Friends
- friend class DataType
-
inline auto IsListOfReference() const noexcept -> bool
-
class ReferenceDataType : public linkahead::utility::ScalarProtoMessageWrapper<ProtoDataType>
Public Functions
-
inline auto GetName() const noexcept -> const std::string&
-
inline auto GetWrapped() const -> const ProtoDataType*
Protected Static Functions
-
static inline auto GetEmptyInstance() -> const ReferenceDataType&
-
static inline auto Create(ProtoDataType *wrapped) -> std::unique_ptr<ReferenceDataType>
Friends
- friend class DataType
- friend class ListDataType
-
inline auto GetName() const noexcept -> const std::string&
-
using ProtoAtomicDataType = caosdb::entity::v1::AtomicDataType
-
namespace entity