apt: pkgDepCache::Transaction Class Reference

apt 3.3.3 commandline package manager

Classes | Public Types | Public Member Functions | List of all members
pkgDepCache::Transaction Class Referencefinal

Perform changes to the depcache atomically. More...

`#include <apt-pkg/depcache.h>`

## Classes
struct | Private

## Public Types
enum class | Behavior { COMMIT , ROLLBACK , AUTO }

## Public Member Functions
| Transaction (pkgDepCache &cache, Behavior behavior)
void | commit ()
| Commit the transaction immediately.
void | rollback ()
| Rollback the transaction immediately.
void | temporaryRollback ()
| Like rollback, but can be called multiple times.
| ~Transaction ()
| Commit or rollback the transaction based on default policy.

## Detailed Description

Perform changes to the depcache atomically.

The default policy for a transaction is to rollback if the number of broken packages increased, otherwise to commit. Call commit() or rollback() to override the default policy.

## Member Function Documentation

## ◆ temporaryRollback()

void temporaryRollback | ( |  | ) |

Like rollback, but can be called multiple times.

You can for example create a new transaction, then temporarily rollback to the state before the previous transaction in that transaction.

Referenced by rollback().

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

- apt-pkg/depcache.h
- apt-pkg/depcache.cc