Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
2fc9ec2b
Verified
Commit
2fc9ec2b
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
DOC: docstrings for MultiResultSet and TransactionType
parent
c8161806
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
F multi retrieve
Pipeline
#11417
passed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#11418
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/caosdb/transaction.h
+29
-7
29 additions, 7 deletions
include/caosdb/transaction.h
with
29 additions
and
7 deletions
include/caosdb/transaction.h
+
29
−
7
View file @
2fc9ec2b
...
...
@@ -124,6 +124,9 @@ class Transaction;
static
const
std
::
string
logger_name
=
"caosdb::transaction"
;
/**
* Abstract base class for the results of a Transaction.
*/
class
ResultSet
{
public:
virtual
~
ResultSet
()
=
default
;
...
...
@@ -131,6 +134,12 @@ public:
[[
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
{
public:
~
MultiResultSet
()
=
default
;
...
...
@@ -145,6 +154,12 @@ public:
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
{
public:
~
UniqueResult
()
=
default
;
...
...
@@ -171,14 +186,21 @@ private:
*/
class
Transaction
{
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
{
NONE
,
READ_ONLY
,
INSERT
,
UPDATE
,
DELETE
,
MIXED_WRITE
,
MIXED_READ_AND_WRITE
NONE
,
/// Unspecified or not specified yet.
READ_ONLY
,
/// Only retrievals (by id, by query)
INSERT
,
/// Only insertions
UPDATE
,
/// Only updates
DELETE
,
/// Only deletions
MIXED_WRITE
,
/// Only insertions, deletions, updates
MIXED_READ_AND_WRITE
/// all kind of transaction.
};
Transaction
(
std
::
shared_ptr
<
EntityTransactionService
::
Stub
>
service_stub
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment