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
Merge requests
!33
Release 0.1
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Release 0.1
dev
into
main
Overview
0
Commits
59
Pipelines
1
Changes
1
Merged
Timm Fitschen
requested to merge
dev
into
main
3 years ago
Overview
0
Commits
59
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Viewing commit
2e6e09f6
Prev
Next
Show latest version
1 file
+
12
−
12
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
2e6e09f6
Rename TransactionType cases to ..._ONLY
· 2e6e09f6
Timm Fitschen
authored
3 years ago
include/caosdb/transaction.h
+
19
−
24
Options
@@ -55,12 +55,12 @@
return StatusCode::TRANSACTION_STATUS_ERROR; \
} \
switch (this->transaction_type) { \
case
NONE:
\
case
TransactionType::NONE:
\
this->transaction_type = TransactionType::READ_ONLY; \
break; \
case
READ_ONLY:
\
case
TransactionType::READ_ONLY:
\
break; \
case MIXED_READ_AND_WRITE:
\
case
TransactionType::
MIXED_READ_AND_WRITE: \
break; \
default: \
CAOSDB_LOG_ERROR_AND_RETURN_STATUS( \
@@ -91,11 +91,11 @@
return StatusCode::TRANSACTION_STATUS_ERROR; \
} \
switch (this->transaction_type) { \
case
NONE:
\
case
TransactionType::NONE:
\
this->transaction_type = TransactionType::MIXED_WRITE; \
case
DELETE:
\
case
MIXED_WRITE:
\
case MIXED_READ_AND_WRITE:
\
case
TransactionType::DELETE_ONLY:
\
case
TransactionType::MIXED_WRITE:
\
case
TransactionType::
MIXED_READ_AND_WRITE: \
break; \
default: \
CAOSDB_LOG_ERROR_AND_RETURN_STATUS( \
@@ -113,11 +113,11 @@
return StatusCode::TRANSACTION_STATUS_ERROR; \
} \
switch (this->transaction_type) { \
case
NONE:
\
case
TransactionType::NONE:
\
this->transaction_type = TransactionType::MIXED_WRITE; \
case
INSERT:
\
case
MIXED_WRITE:
\
case MIXED_READ_AND_WRITE:
\
case
TransactionType::INSERT_ONLY:
\
case
TransactionType::MIXED_WRITE:
\
case
TransactionType::
MIXED_READ_AND_WRITE: \
break; \
default: \
CAOSDB_LOG_ERROR_AND_RETURN_STATUS( \
@@ -135,11 +135,11 @@
return StatusCode::TRANSACTION_STATUS_ERROR; \
} \
switch (this->transaction_type) { \
case
NONE:
\
case
TransactionType::NONE:
\
this->transaction_type = TransactionType::MIXED_WRITE; \
case
UPDATE:
\
case
MIXED_WRITE:
\
case MIXED_READ_AND_WRITE:
\
case
TransactionType::UPDATE_ONLY:
\
case
TransactionType::MIXED_WRITE:
\
case
TransactionType::
MIXED_READ_AND_WRITE: \
break; \
default: \
CAOSDB_LOG_ERROR_AND_RETURN_STATUS( \
@@ -287,9 +287,9 @@ public:
enum
TransactionType
{
NONE
,
//!< Unspecified or not specified yet.
READ_ONLY
,
//!< Only retrievals (by id, by query)
INSERT
,
//!< Only insertions
UPDATE
,
//!< Only updates
DELETE
,
//!< Only deletions
INSERT
_ONLY
,
//!< Only insertions
UPDATE
_ONLY
,
//!< Only updates
DELETE
_ONLY
,
//!< Only deletions
MIXED_WRITE
,
//!< Only insertions, deletions, updates
MIXED_READ_AND_WRITE
//!< all kind of transaction.
};
@@ -406,7 +406,7 @@ public:
* Instead, do Execute() or WaitForIt() and only call this method afterwards.
*/
[[
nodiscard
]]
inline
auto
GetResultSet
()
const
noexcept
->
const
ResultSet
&
{
if
(
!
this
->
result_set
)
{
if
(
this
->
result_set
==
nullptr
)
{
CAOSDB_LOG_ERROR
(
logger_name
)
<<
"GetResultSet was called before the transaction has terminated. This is a programming "
"error of the code which uses the transaction."
;
@@ -517,11 +517,6 @@ private:
std
::
vector
<
FileDescriptor
>
upload_files
;
std
::
map
<
std
::
string
,
FileDescriptor
>
download_files
;
// auto RegisterUploadFile(RegisterFileUploadResponse *response) -> void;
auto
UploadFile
(
FileUploadResponse
*
response
,
const
FileDescriptor
&
file_descriptor
,
const
std
::
string
&
registration_id
)
->
void
;
auto
DownloadFile
(
FileDownloadResponse
*
response
,
const
FileTransmissionId
&
file_transmission_id
)
->
void
;
bool
has_query
=
false
;
TransactionType
transaction_type
=
TransactionType
::
NONE
;
mutable
std
::
unique_ptr
<
ResultSet
>
result_set
;
Loading