本文整理汇总了C++中EndTransaction函数的典型用法代码示例。如果您正苦于以下问题:C++ EndTransaction函数的具体用法?C++ EndTransaction怎么用?C++ EndTransaction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EndTransaction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTargetFrame
/* static */ bool
WheelTransaction::WillHandleDefaultAction(WidgetWheelEvent* aWheelEvent,
nsWeakFrame& aTargetWeakFrame)
{
nsIFrame* lastTargetFrame = GetTargetFrame();
if (!lastTargetFrame) {
BeginTransaction(aTargetWeakFrame.GetFrame(), aWheelEvent);
} else if (lastTargetFrame != aTargetWeakFrame.GetFrame()) {
EndTransaction();
BeginTransaction(aTargetWeakFrame.GetFrame(), aWheelEvent);
} else {
UpdateTransaction(aWheelEvent);
}
// When the wheel event will not be handled with any frames,
// UpdateTransaction() fires MozMouseScrollFailed event which is for
// automated testing. In the event handler, the target frame might be
// destroyed. Then, the caller shouldn't try to handle the default action.
if (!aTargetWeakFrame.IsAlive()) {
EndTransaction();
return false;
}
return true;
}
示例2: CheckDirtyRead
static int
CheckDirtyRead(void)
{
SQLRETURN RetCode;
/* transaction 1 try to change a row but not commit */
odbc_command("UPDATE test_transaction SET t = 'second' WHERE n = 1");
SWAP_CONN();
/* second transaction try to fetch uncommited row */
RetCode = odbc_command2("SELECT * FROM test_transaction WHERE t = 'second' AND n = 1", "SE");
if (RetCode == SQL_ERROR) {
EndTransaction(SQL_ROLLBACK);
SWAP_CONN();
EndTransaction(SQL_ROLLBACK);
return 0; /* no dirty read */
}
CHKFetch("S");
CHKFetch("No");
SQLMoreResults(odbc_stmt);
EndTransaction(SQL_ROLLBACK);
SWAP_CONN();
EndTransaction(SQL_ROLLBACK);
return 1;
}
示例3: NS_ENSURE_TRUE
NS_IMETHODIMP
nsTransactionManager::DoTransaction(nsITransaction *aTransaction)
{
nsresult result;
NS_ENSURE_TRUE(aTransaction, NS_ERROR_NULL_POINTER);
bool doInterrupt = false;
result = WillDoNotify(aTransaction, &doInterrupt);
if (NS_FAILED(result)) {
return result;
}
if (doInterrupt) {
return NS_OK;
}
result = BeginTransaction(aTransaction);
if (NS_FAILED(result)) {
DidDoNotify(aTransaction, result);
return result;
}
result = EndTransaction();
nsresult result2 = DidDoNotify(aTransaction, result);
if (NS_SUCCEEDED(result))
result = result2;
return result;
}
示例4: EndTransaction
void FSpriteEditorViewportClient::NotifySpriteBeingEditedHasChanged()
{
//@TODO: Ideally we do this before switching
EndTransaction();
// Refresh the viewport in case we were not in realtime mode
Invalidate();
// Update components to know about the new sprite being edited
UPaperSprite* Sprite = GetSpriteBeingEdited();
RenderSpriteComponent->SetSprite(Sprite);
UpdateSourceTextureSpriteFromSprite(Sprite);
InternalActivateNewMode(CurrentMode);
//@TODO: Only do this if the sprite isn't visible (may consider doing a flashing pulse around the source region rect?)
RequestFocusOnSelection(/*bInstant=*/ true);
if (Sprite != nullptr)
{
// Create and display a notification about the new sprite being edited
const FText NotificationErrorText = FText::Format(LOCTEXT("SwitchingToSprite", "Editing {0}"), FText::AsCultureInvariant(Sprite->GetName()));
FNotificationInfo Info(NotificationErrorText);
Info.ExpireDuration = 2.0f;
FSlateNotificationManager::Get().AddNotification(Info);
}
}
示例5: fsal_posixdb_delete
fsal_posixdb_status_t fsal_posixdb_delete(fsal_posixdb_conn * p_conn, /* IN */
posixfsal_handle_t * p_parent_directory_handle, /* IN */
fsal_name_t * p_filename, /* IN */
fsal_posixdb_fileinfo_t *
p_object_info /* IN */ )
{
result_handle_t res;
fsal_posixdb_status_t st;
char query[2048];
/*******************
* 1/ sanity check *
*******************/
if(!p_conn || !p_parent_directory_handle || !p_filename)
ReturnCodeDB(ERR_FSAL_POSIXDB_FAULT, 0);
BeginTransaction(p_conn);
/*******************************
* 2/ we check the file exists *
*******************************/
snprintf(query, 2048, "SELECT Parent.handleid, Parent.handlets, "
"Handle.deviceid, Handle.inode, Handle.nlink, Handle.ctime, Handle.ftype "
"FROM Parent INNER JOIN Handle ON Parent.handleid = Handle.handleid "
"AND Parent.handlets=Handle.handlets "
"WHERE handleidparent=%llu AND handletsparent=%u AND name='%s' "
"FOR UPDATE", p_parent_directory_handle->data.id,
p_parent_directory_handle->data.ts, p_filename->name);
st = db_exec_sql(p_conn, query, &res);
if(FSAL_POSIXDB_IS_ERROR(st))
goto rollback;
if(mysql_num_rows(res) != 1)
{
/* parent entry not found */
mysql_free_result(res);
RollbackTransaction(p_conn);
ReturnCodeDB(ERR_FSAL_POSIXDB_NOENT, 0);
}
mysql_free_result(res);
/***********************************************
* 3/ Get information about the file to delete *
***********************************************/
st = fsal_posixdb_internal_delete(p_conn, p_parent_directory_handle->data.id,
p_parent_directory_handle->data.ts,
p_filename->name, p_object_info);
if(FSAL_POSIXDB_IS_ERROR(st))
goto rollback;
return EndTransaction(p_conn);
rollback:
RollbackTransaction(p_conn);
return st;
}
示例6: CancelableBlockState
WheelBlockState::WheelBlockState(const RefPtr<AsyncPanZoomController>& aTargetApzc,
bool aTargetConfirmed,
const ScrollWheelInput& aInitialEvent)
: CancelableBlockState(aTargetApzc, aTargetConfirmed)
, mScrollSeriesCounter(0)
, mTransactionEnded(false)
{
sLastWheelBlockId = GetBlockId();
if (aTargetConfirmed) {
// Find the nearest APZC in the overscroll handoff chain that is scrollable.
// If we get a content confirmation later that the apzc is different, then
// content should have found a scrollable apzc, so we don't need to handle
// that case.
RefPtr<AsyncPanZoomController> apzc =
mOverscrollHandoffChain->FindFirstScrollable(aInitialEvent);
// If nothing is scrollable, we don't consider this block as starting a
// transaction.
if (!apzc) {
EndTransaction();
return;
}
if (apzc != GetTargetApzc()) {
UpdateTargetApzc(apzc);
}
}
}
示例7: LOCK_TX_MANAGER
NS_IMETHODIMP
nsTransactionManager::EndBatch()
{
nsRefPtr<nsTransactionItem> tx;
nsCOMPtr<nsITransaction> ti;
nsresult result;
LOCK_TX_MANAGER(this);
// XXX: Need to add some mechanism to detect the case where the transaction
// at the top of the do stack isn't the dummy transaction, so we can
// throw an error!! This can happen if someone calls EndBatch() within
// the DoTransaction() method of a transaction.
//
// For now, we can detect this case by checking the value of the
// dummy transaction's mTransaction field. If it is our dummy
// transaction, it should be NULL. This may not be true in the
// future when we allow users to execute a transaction when beginning
// a batch!!!!
result = mDoStack.Peek(getter_AddRefs(tx));
if (NS_FAILED(result)) {
UNLOCK_TX_MANAGER(this);
return result;
}
if (tx)
tx->GetTransaction(getter_AddRefs(ti));
if (!tx || ti) {
UNLOCK_TX_MANAGER(this);
return NS_ERROR_FAILURE;
}
PRBool doInterrupt = PR_FALSE;
result = WillEndBatchNotify(&doInterrupt);
if (NS_FAILED(result)) {
UNLOCK_TX_MANAGER(this);
return result;
}
if (doInterrupt) {
UNLOCK_TX_MANAGER(this);
return NS_OK;
}
result = EndTransaction();
nsresult result2 = DidEndBatchNotify(result);
if (NS_SUCCEEDED(result))
result = result2;
UNLOCK_TX_MANAGER(this);
return result;
}
示例8: EndTransaction
FReply FCanvasSlotExtension::HandleAnchorEndDrag(const FGeometry& Geometry, const FPointerEvent& Event, EAnchorWidget::Type AnchorType)
{
EndTransaction();
bMovingAnchor = false;
return FReply::Handled().ReleaseMouseCapture();
}
示例9: EndTransaction
bool
WheelBlockState::SetContentResponse(bool aPreventDefault)
{
if (aPreventDefault) {
EndTransaction();
}
return CancelableBlockState::SetContentResponse(aPreventDefault);
}
示例10: EndTransaction
FSCSEditorViewportClient::~FSCSEditorViewportClient()
{
// Ensure that an in-progress transaction is ended
EndTransaction();
// Clean up the preview
DestroyPreview();
}
示例11: EndTransaction
/* static */ void
WheelTransaction::MayEndTransaction()
{
if (!sOwnScrollbars && ScrollbarsForWheel::IsActive()) {
ScrollbarsForWheel::OwnWheelTransaction(true);
} else {
EndTransaction();
}
}
示例12: EndTransaction
void FSingleTileEditorViewportClient::TrackingStopped()
{
// Stop transacting. Give the current editor mode an opportunity to do the transacting.
const bool bTransactingHandledByEditorMode = ModeTools->EndTracking(this, Viewport);
if (bManipulating && !bTransactingHandledByEditorMode)
{
EndTransaction();
bManipulating = false;
}
}
示例13: NS_ASSERTION
bool
LayerManagerComposite::EndEmptyTransaction(EndTransactionFlags aFlags)
{
NS_ASSERTION(mInTransaction, "Didn't call BeginTransaction?");
if (!mRoot) {
mInTransaction = false;
mIsCompositorReady = false;
return false;
}
EndTransaction(nullptr, nullptr);
return true;
}
示例14: EndTransaction
bool
LayerManagerD3D9::EndEmptyTransaction()
{
// If the device reset count from our last EndTransaction doesn't match
// the current device reset count, the device must have been reset one or
// more times since our last transaction. In that case, an empty transaction
// is not possible, because layers may need to be rerendered.
if (!mRoot || mDeviceResetCount != mDeviceManager->GetDeviceResetCount())
return false;
EndTransaction(nsnull, nsnull);
return true;
}
示例15: CheckPhantom
static int
CheckPhantom(void)
{
SQLRETURN RetCode;
/* transaction 2 read a row */
SWAP_CONN();
odbc_command("SELECT * FROM test_transaction WHERE t = 'initial'");
SQLMoreResults(odbc_stmt);
/* transaction 1 insert a row that match critera */
SWAP_CONN();
RetCode = odbc_command2("INSERT INTO test_transaction(n, t) VALUES(2, 'initial')", "SE");
if (RetCode == SQL_ERROR) {
EndTransaction(SQL_ROLLBACK);
SWAP_CONN();
EndTransaction(SQL_ROLLBACK);
SWAP_CONN();
return 0; /* no dirty read */
}
EndTransaction(SQL_COMMIT);
SWAP_CONN();
/* second transaction try to fetch commited row */
odbc_command("SELECT * FROM test_transaction WHERE t = 'initial'");
CHKFetch("S");
CHKFetch("S");
CHKFetch("No");
SQLMoreResults(odbc_stmt);
EndTransaction(SQL_ROLLBACK);
SWAP_CONN();
odbc_command("DELETE test_transaction WHERE n = 2");
EndTransaction(SQL_COMMIT);
return 1;
}