| RDB 2

Public Member Functions | Public Attributes | List of all members
riegl::rdb::pointcloud::TransactionScope Class Reference

Point cloud transaction scope helper class. More...

`#include <transactionScope.hpp>`

## Public Member Functions
| TransactionScope (riegl::rdb::Pointcloud &pointcloud, const std::string &title, const std::string &agent, const std::string &comments="", const std::string &settings="")
| Begin new transaction. More...
| ~TransactionScope ()
| End transaction. More...
Transaction::ID | id () const
| Get transaction ID. More...
void | commit ()
| Commit transaction. More...
template<typename Callable >
void | commit (Callable &&progress)
template<typename Callable , typename Receiver >
void | commit (Callable &&progress, Receiver &&receiver)
void | rollback ()
| Rollback transaction. More...

## Public Attributes
bool | autoCommit
| true: call commit(), false: call rollback() on deletion More...

## Detailed Description

Point cloud transaction scope helper class.

This class wraps transaction creation, commit and rollback. It automatically starts a new transaction on construction and either commits or reverts the transaction on deletion. Whether commit() or rollback() is called is defined by variable autoCommit, default is false (i.e. rollback).

See also
  riegl::rdb::pointcloud::Transactions

Examples:
  rdb-example-01-create-database.cpp, rdb-example-02-insert-points.cpp, rdb-example-04-update-points.cpp, rdb-example-05-remove-points.cpp, rdb-example-07-fill-points.cpp, and rdb-example-08-invert-points.cpp.

Definition at line 59 of file transactionScope.hpp.

## Constructor & Destructor Documentation

## ◆ TransactionScope()

riegl::rdb::pointcloud::TransactionScope::TransactionScope | ( | riegl::rdb::Pointcloud & | pointcloud,
|  | const std::string & | title,
|  | const std::string & | agent,
|  | const std::string & | comments = `""`,
|  | const std::string & | settings = `""`
| ) |  |
| inline explicit

Begin new transaction.

See also
  riegl::rdb::pointcloud::Transactions::begin()

Parameters

  [in] | pointcloud | target point cloud object
  [in] | title | short description, e.g. "Import"
  [in] | agent | software name, e.g. "rdbimport v1.0"
  [in] | comments | e.g. process details for humans
  [in] | settings | e.g. process settings for software

Definition at line 68 of file transactionScope.hpp.

## ◆ ~TransactionScope()

riegl::rdb::pointcloud::TransactionScope::~TransactionScope | ( |  | ) |
| inline

End transaction.

Definition at line 88 of file transactionScope.hpp.

## Member Function Documentation

## ◆ commit() [1/3]

void riegl::rdb::pointcloud::TransactionScope::commit | ( |  | ) |
| inline

Commit transaction.

See also
  riegl::rdb::pointcloud::Transactions::commit()

Examples:
  rdb-example-01-create-database.cpp, rdb-example-02-insert-points.cpp, rdb-example-04-update-points.cpp, rdb-example-05-remove-points.cpp, rdb-example-07-fill-points.cpp, and rdb-example-08-invert-points.cpp.

Definition at line 108 of file transactionScope.hpp.

## ◆ commit() [2/3]

template<typename Callable >

void riegl::rdb::pointcloud::TransactionScope::commit | ( | Callable && | progress | ) |
| inline

Definition at line 117 of file transactionScope.hpp.

## ◆ commit() [3/3]

template<typename Callable , typename Receiver >

void riegl::rdb::pointcloud::TransactionScope::commit | ( | Callable && | progress,
|  | Receiver && | receiver
| ) |  |
| inline

Definition at line 128 of file transactionScope.hpp.

## ◆ id()

Transaction::ID riegl::rdb::pointcloud::TransactionScope::id | ( |  | ) | const
| inline

Get transaction ID.

See also
  riegl::rdb::pointcloud::Transaction::id

Definition at line 99 of file transactionScope.hpp.

## ◆ rollback()

void riegl::rdb::pointcloud::TransactionScope::rollback | ( |  | ) |
| inline

Rollback transaction.

See also
  riegl::rdb::pointcloud::Transactions::rollback()

Definition at line 144 of file transactionScope.hpp.

## Member Data Documentation

## ◆ autoCommit

bool riegl::rdb::pointcloud::TransactionScope::autoCommit

true: call commit(), false: call rollback() on deletion

Definition at line 62 of file transactionScope.hpp.

The documentation for this class was generated from the following file:

- riegl/rdb/pointcloud/transactionScope.hpp