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

DOC: docstrings for MultiResultSet and TransactionType

parent c8161806
No related branches found
No related tags found
1 merge request!5F multi retrieve
Pipeline #11417 passed
Pipeline: caosdb-cppinttest

#11418

    This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
    ...@@ -124,6 +124,9 @@ class Transaction; ...@@ -124,6 +124,9 @@ class Transaction;
    static const std::string logger_name = "caosdb::transaction"; static const std::string logger_name = "caosdb::transaction";
    /**
    * Abstract base class for the results of a Transaction.
    */
    class ResultSet { class ResultSet {
    public: public:
    virtual ~ResultSet() = default; virtual ~ResultSet() = default;
    ...@@ -131,6 +134,12 @@ public: ...@@ -131,6 +134,12 @@ public:
    [[nodiscard]] virtual auto At(const int index) const -> const Entity & = 0; [[nodiscard]] virtual auto At(const int index) const -> const Entity & = 0;
    }; };
    /**
    * Container with results of a transaction.
    *
    * In contrast to UniqueResult, this one can also hold multiple entities or zero
    * entities.
    */
    class MultiResultSet : public ResultSet { class MultiResultSet : public ResultSet {
    public: public:
    ~MultiResultSet() = default; ~MultiResultSet() = default;
    ...@@ -145,6 +154,12 @@ public: ...@@ -145,6 +154,12 @@ public:
    std::vector<std::unique_ptr<Entity>> entities; std::vector<std::unique_ptr<Entity>> entities;
    }; };
    /**
    * Container with the single result of a transaction.
    *
    * In contrast to MultiResultSet, this one guarantees to hold exactly one
    * entity.
    */
    class UniqueResult : public ResultSet { class UniqueResult : public ResultSet {
    public: public:
    ~UniqueResult() = default; ~UniqueResult() = default;
    ...@@ -171,14 +186,21 @@ private: ...@@ -171,14 +186,21 @@ private:
    */ */
    class Transaction { class Transaction {
    public: public:
    /**
    * The transaction type restricts the kind of sub-transaction which may be
    * added to a transaction (insertion, update, deletion, retrieval).
    *
    * @note MIXED_READ_AND_WRITE and MIXED_WRITE transaction are not supported
    * yet.
    */
    enum TransactionType { enum TransactionType {
    NONE, NONE, /// Unspecified or not specified yet.
    READ_ONLY, READ_ONLY, /// Only retrievals (by id, by query)
    INSERT, INSERT, /// Only insertions
    UPDATE, UPDATE, /// Only updates
    DELETE, DELETE, /// Only deletions
    MIXED_WRITE, MIXED_WRITE, /// Only insertions, deletions, updates
    MIXED_READ_AND_WRITE MIXED_READ_AND_WRITE /// all kind of transaction.
    }; };
    Transaction(std::shared_ptr<EntityTransactionService::Stub> service_stub); Transaction(std::shared_ptr<EntityTransactionService::Stub> service_stub);
    ......
    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