本文整理汇总了C++中Transaction::Repository方法的典型用法代码示例。如果您正苦于以下问题:C++ Transaction::Repository方法的具体用法?C++ Transaction::Repository怎么用?C++ Transaction::Repository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::Repository方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
status_t
PackageManager::PrepareTransaction(Transaction& transaction)
{
Volume* volume = fRoot->GetVolume(transaction.Repository().Location());
if (volume == NULL)
return B_BAD_VALUE;
return volume->CreateTransaction(transaction.Repository().Location(),
transaction.ActivationTransaction(),
transaction.TransactionDirectory());
}
示例2:
void
BPackageManager::_CommitPackageChanges(Transaction& transaction)
{
InstalledRepository& installationRepository = transaction.Repository();
fUserInteractionHandler->ProgressStartApplyingChanges(
installationRepository);
// commit the transaction
BCommitTransactionResult transactionResult;
status_t error = fInstallationInterface->CommitTransaction(transaction,
transactionResult);
if (error != B_OK)
DIE(error, "failed to commit transaction");
if (transactionResult.Error() != B_TRANSACTION_OK)
DIE(transactionResult);
fUserInteractionHandler->ProgressTransactionCommitted(
installationRepository, transactionResult);
BEntry transactionDirectoryEntry;
if ((error = transaction.TransactionDirectory()
.GetEntry(&transactionDirectoryEntry)) != B_OK
|| (error = transactionDirectoryEntry.Remove()) != B_OK) {
fUserInteractionHandler->Warn(error,
"failed to remove transaction directory");
}
fUserInteractionHandler->ProgressApplyingChangesDone(
installationRepository);
}