当前位置: 首页>>代码示例>>C++>>正文


C++ Transaction函数代码示例

本文整理汇总了C++中Transaction函数的典型用法代码示例。如果您正苦于以下问题:C++ Transaction函数的具体用法?C++ Transaction怎么用?C++ Transaction使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Transaction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Transaction

Transaction MixClient::replaceGas(Transaction const& _t, Secret const& _secret, u256 const& _gas)
{
	if (_t.isCreation())
		return Transaction(_t.value(), _t.gasPrice(), _gas, _t.data(), _t.nonce(), _secret);
	else
		return Transaction(_t.value(), _t.gasPrice(), _gas, _t.receiveAddress(), _t.data(), _t.nonce(), _secret);
}
开发者ID:gluk256,项目名称:cpp-ethereum,代码行数:7,代码来源:MixClient.cpp

示例2: TRAPD

void CWspCOTransaction::AbortInvoke()
	{
	// Check the state - no need to send S-MethodAbort primitive if the method
	// is still in the null state.
	if( iMethodState == ENullMethod )
		{
		// Inform the client that the tranaction has failed.
		TRAPD(err, Transaction().SendEventL(THTTPEvent::EFailed,
											THTTPEvent::EIncoming,
											THTTPFilterHandle::EProtocolHandler));

		// Get the protocol handler to deal with the method abort.
		iObserver.HandleMethodAbort(*this);				

		// If the event could not be sent, we must take more drastic action.  Note that
		// this _must_ follow the observer's handling of method abort, since the use
		// of RHTTPTransaction::Fail() is drastic, and could result in the whole
		// transaction having been deleted by the time we get back here.
		if (err != KErrNone)
			Transaction().Fail(THTTPFilterHandle::EProtocolHandler);
		}
	else
		{
		__ASSERT_DEBUG( iMethodState == ERequesting, Panic(KWspPanicBadMethodState) );

		// Send MethodAbort.req primitive - defer sending as could be in 
		// callstack from either MethodInvokeCnf() or MethodInvokeDataCnf().
		iPrimitiveSender->InitiateSend(ESMethodAbort);
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:30,代码来源:CWspCOTransaction.cpp

示例3: __LEAVE

void CDbTableDatabase::DoCreateTableL(const TDesC& aName,const CDbColSet& aColSet,const CDbKey* aPrimaryKey)
	{
	if (SchemaL().Find(aName))
		__LEAVE(KErrAlreadyExists);
// validate the colset set passed in
	Validate::NameL(aName);
	Validate::ColSetL(aColSet);
	Transaction().DDLBeginLC();
	iSchema.Add(CreateTableL(aName,aColSet,aPrimaryKey));
	Transaction().DDLCommitL();
	CleanupStack::Pop();		// rollback not required
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:12,代码来源:UT_DBS.CPP

示例4: AssertIsOnOwningThread

void
IDBCursor::Advance(uint32_t aCount, ErrorResult &aRv)
{
  AssertIsOnOwningThread();

  if (!mTransaction->IsOpen()) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
    return;
  }

  if (!mHaveValue || mContinueCalled) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
    return;
  }

  if (!aCount) {
    aRv.ThrowTypeError(MSG_INVALID_ADVANCE_COUNT);
    return;
  }

  mBackgroundActor->SendContinueInternal(AdvanceParams(aCount));

  mContinueCalled = true;

#ifdef IDB_PROFILER_USE_MARKS
  {
    if (mType == Type_ObjectStore || mType == Type_ObjectStoreKey) {
      IDB_PROFILER_MARK("IndexedDB Request %llu: "
                        "database(%s).transaction(%s).objectStore(%s)."
                        "cursor(%s).advance(%ld)",
                        "IDBRequest[%llu] MT IDBCursor.advance()",
                        Request()->GetSerialNumber(),
                        IDB_PROFILER_STRING(Transaction()->Database()),
                        IDB_PROFILER_STRING(Transaction()),
                        IDB_PROFILER_STRING(mSourceObjectStore),
                        IDB_PROFILER_STRING(mDirection), aCount);
    } else {
      IDB_PROFILER_MARK("IndexedDB Request %llu: "
                        "database(%s).transaction(%s).objectStore(%s)."
                        "index(%s).cursor(%s).advance(%ld)",
                        "IDBRequest[%llu] MT IDBCursor.advance()",
                        Request()->GetSerialNumber(),
                        IDB_PROFILER_STRING(Transaction()->Database()),
                        IDB_PROFILER_STRING(Transaction()),
                        IDB_PROFILER_STRING(mSourceIndex->ObjectStore()),
                        IDB_PROFILER_STRING(mSourceIndex),
                        IDB_PROFILER_STRING(mDirection), aCount);
    }
  }
#endif
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:51,代码来源:IDBCursor.cpp

示例5: Notify

/**
 * Media control, for spindle motor and media tray or door.
 * This includes CDROM, TAPE and anything with a media loader.
 *
 * @param lun Logical Unit Number
 * @param ctl 0x00 Stop Motor, 0x01 Start Motor, 0x02 Eject Media, 0x03 Load Media
 * @return 0 on success
 */
uint8_t BulkOnly::MediaCTL(uint8_t lun, uint8_t ctl) {
        Notify(PSTR("\r\nMediaCTL\r\n"), 0x80);
        Notify(PSTR("-----------------\r\n"), 0x80);
        SetCurLUN(lun);
        uint8_t rcode = MASS_ERR_UNIT_NOT_READY;
        if (bAddress) {
                CommandBlockWrapper cbw;

                cbw.dCBWSignature = MASS_CBW_SIGNATURE;
                cbw.dCBWTag = ++dCBWTag;
                cbw.dCBWDataTransferLength = 0;
                cbw.bmCBWFlags = MASS_CMD_DIR_OUT;
                cbw.bmCBWLUN = lun;
                cbw.bmCBWCBLength = 6;

                for (uint8_t i = 0; i < 16; i++)
                        cbw.CBWCB[i] = 0;

                cbw.CBWCB[0] = SCSI_CMD_START_STOP_UNIT;
                cbw.CBWCB[1] = lun << 5;
                cbw.CBWCB[4] = ctl & 0x03;

                rcode = HandleSCSIError(Transaction(&cbw, 0, NULL, 0));
        }
        return rcode;
}
开发者ID:ArkanaLord,项目名称:USB_Host_Shield_2.0,代码行数:34,代码来源:masstorage.cpp

示例6: Transaction

void UK2Node_CommutativeAssociativeBinaryOperator::RemoveInputPin(UEdGraphPin* Pin)
{
	if(CanRemovePin(Pin))
	{
		FScopedTransaction Transaction( LOCTEXT("RemovePinTx", "RemovePin") );
		Modify();

		if (RemovePin(Pin))
		{
			--NumAdditionalInputs;

			int32 NameIndex = 0;
			const UEdGraphPin* OutPin = FindOutPin();
			const UEdGraphPin* SelfPin = FindSelfPin();
			for (int32 PinIndex = 0; PinIndex < Pins.Num(); ++PinIndex)
			{
				UEdGraphPin* LocalPin = Pins[PinIndex];
				if(LocalPin && (LocalPin != OutPin) && (LocalPin != SelfPin))
				{
					const FString PinName = GetNameForPin(NameIndex);
					if(PinName != LocalPin->PinName)
					{
						LocalPin->Modify();
						LocalPin->PinName = PinName;
					}
					NameIndex++;
				}
			}
			FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(GetBlueprint());
		}
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:32,代码来源:K2Node_CommutativeAssociativeBinaryOperator.cpp

示例7: GetPinInformation

void UAnimGraphNode_BlendListByEnum::RemovePinFromBlendList(UEdGraphPin* Pin)
{
	int32 RawArrayIndex = 0;
	bool bIsPosePin = false;
	bool bIsTimePin = false;
	GetPinInformation(Pin->PinName, /*out*/ RawArrayIndex, /*out*/ bIsPosePin, /*out*/ bIsTimePin);

	const int32 ExposedEnumIndex = (bIsPosePin || bIsTimePin) ? (RawArrayIndex - 1) : INDEX_NONE;

	if (ExposedEnumIndex != INDEX_NONE)
	{
		FScopedTransaction Transaction( LOCTEXT("RemovePin", "RemovePin") );
		Modify();

		// Record it as no longer exposed
		VisibleEnumEntries.RemoveAt(ExposedEnumIndex);

		// Remove the pose from the node
		UProperty* AssociatedProperty;
		int32 ArrayIndex;
		GetPinAssociatedProperty(GetFNodeType(), Pin, /*out*/ AssociatedProperty, /*out*/ ArrayIndex);

		ensure(ArrayIndex == (ExposedEnumIndex + 1));

		// setting up removed pins info 
		RemovedPinArrayIndex = ArrayIndex;
		Node.RemovePose(ArrayIndex);
		ReconstructNode();
		//@TODO: Just want to invalidate the visual representation currently
		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(GetBlueprint());
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:32,代码来源:AnimGraphNode_BlendListByEnum.cpp

示例8: __ASSERT_DEBUG

void CWspCOTransaction::MethodInvokeData()
	{
	__ASSERT_DEBUG( iNegotiatedCapInfo.GetProtocolOptions() & ELargeDataTransfer, Panic(KWspPanicLDTNotSuppoted) );
	__ASSERT_DEBUG( iMethodState == ERequesting, Panic(KWspPanicNotExpectingMoreRequestData) );

	__LOG1(_L("Trans %d - Sending S-MethodInvokeData.req"), Transaction().Id());

	// Down-cast to derived CTxData object
	CWspCOTxData* txData = STATIC_CAST(CWspCOTxData*, iTxData);

	// Get the request body data supplier
	MHTTPDataSupplier& dataSupplier = txData->RequestBodyData();
	TPtrC8 bodyData;
	iMoreRequestData = !dataSupplier.GetNextDataPart(bodyData);

	// Send the S-MethodInvoke.req primitive
	iMethodInvoker.MethodInvokeDataReq(
									  *this, 
									  bodyData,
									  txData->RequestHeadersData(),
									  iMoreRequestData
									  );

	__LOG(_L("---Method in Requesting state"));

	// WSP method transaction remains in requesting state - do nothing.
	// Release request body data
	dataSupplier.ReleaseData();
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:29,代码来源:CWspCOTransaction.cpp

示例9: AssertIsOnOwningThread

already_AddRefed<IDBTransaction>
IDBDatabase::Transaction(JSContext* aCx,
                         const StringOrStringSequence& aStoreNames,
                         IDBTransactionMode aMode,
                         ErrorResult& aRv)
{
  AssertIsOnOwningThread();

  if ((aMode == IDBTransactionMode::Readwriteflush ||
       aMode == IDBTransactionMode::Cleanup) &&
      !IndexedDatabaseManager::ExperimentalFeaturesEnabled()) {
    // Pretend that this mode doesn't exist. We don't have a way to annotate
    // certain enum values as depending on preferences so we just duplicate the
    // normal exception generation here.
    aRv.ThrowTypeError<MSG_INVALID_ENUM_VALUE>(
      NS_LITERAL_STRING("Argument 2 of IDBDatabase.transaction"),
      NS_LITERAL_STRING("readwriteflush"),
      NS_LITERAL_STRING("IDBTransactionMode"));
    return nullptr;
  }

  RefPtr<IDBTransaction> transaction;
  aRv = Transaction(aCx, aStoreNames, aMode, getter_AddRefs(transaction));
  if (NS_WARN_IF(aRv.Failed())) {
    return nullptr;
  }

  return transaction.forget();
}
开发者ID:digideskio,项目名称:newtab-dev,代码行数:29,代码来源:IDBDatabase.cpp

示例10: Release

//
// Create an incremental table altering object
//
CDbTableDatabase::CIncremental* CDbTableDatabase::OpenAlterTableL(const TDesC& aTable,const CDbColSet& aNewDef,TInt& aStep)
	{
	CDbTableDef& tDef=SchemaL().FindL(aTable);
	Validate::ColSetL(aNewDef);
	Release(tDef);				// release the tables using the old schema
	return CAlterTable::NewL(Transaction(),tDef,aNewDef,aStep);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:10,代码来源:UT_DBS.CPP

示例11: Transaction

FReply FEditorUtilityInstanceDetails::OnExecuteAction(TWeakObjectPtr<UFunction> WeakFunctionPtr)
{
    if (UFunction* Function = WeakFunctionPtr.Get())
    {
        FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "BlutilityAction", "Blutility Action") );
        FEditorScriptExecutionGuard ScriptGuard;

        UClass* MinRequiredClass = Function->GetOuterUClass();

        // Execute this function on any objects that support it
        for (auto SelectedObjectIt = SelectedObjectsList.CreateConstIterator(); SelectedObjectIt; ++SelectedObjectIt)
        {
            UObject* Object = (*SelectedObjectIt).Get();

            if ((Object != NULL) && (Object->IsA(MinRequiredClass)))
            {
                Object->ProcessEvent(Function, NULL);

                if (UGlobalEditorUtilityBase* BlutilityInstance = Cast<UGlobalEditorUtilityBase>(Object))
                {
                    BlutilityInstance->PostExecutionCleanup();
                }
            }
        }
    }

    return FReply::Handled();
}
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:28,代码来源:BlutilityDetailsPanel.cpp

示例12: Transaction

void FJavascriptEditorModule::StartupModule()
{
#if WITH_EDITOR	
	auto Isolate = NewObject<UJavascriptIsolate>();
	auto Context = Isolate->CreateContext();
	
	JavascriptContext = Context;
	JavascriptContext->AddToRoot();

	JavascriptContext->SetContextId(TEXT("Editor"));

	Tick = NewObject<UJavascriptEditorTick>(JavascriptContext);
	JavascriptContext->Expose(TEXT("Root"), Tick);
	Tick->AddToRoot();

	if (!IsRunningCommandlet())
	{
		FScopedTransaction Transaction(NSLOCTEXT("UnrealEd", "UnrealJS", "Javascript action"));
		FEditorScriptExecutionGuard ScriptGuard;

		Context->RunFile("editor.js");
	}

	bRegistered = true;
	
	FCoreDelegates::OnPreExit.AddRaw(this, &FJavascriptEditorModule::Unregister);
#endif
}
开发者ID:Grinkers,项目名称:Unreal.js,代码行数:28,代码来源:JavascriptEditor.cpp

示例13: Transaction

void UK2Node_MakeArray::RemoveInputPin(UEdGraphPin* Pin)
{
	FScopedTransaction Transaction( LOCTEXT("RemovePinTx", "RemovePin") );
	Modify();

	check(Pin->Direction == EGPD_Input);

	int32 PinRemovalIndex = INDEX_NONE;
	if (Pins.Find(Pin, /*out*/ PinRemovalIndex))
	{
		for (int32 PinIndex = PinRemovalIndex + 1; PinIndex < Pins.Num(); ++PinIndex)
		{
			Pins[PinIndex]->Modify();
			Pins[PinIndex]->PinName = FString::Printf(TEXT("[%d]"), PinIndex - 2); // -1 to shift back one, -1 to account for the output pin at the 0th position
		}

		Pins.RemoveAt(PinRemovalIndex);
		Pin->Modify();
		Pin->BreakAllPinLinks();

		--NumInputs;

		ClearPinTypeToWildcard();

		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(GetBlueprint());
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:27,代码来源:K2Node_MakeArray.cpp

示例14: Tick

	virtual void Tick(float DeltaTime) override
	{
		FScopedTransaction Transaction(NSLOCTEXT("UnrealEd", "UnrealJS", "Javascript action"));
		FEditorScriptExecutionGuard ScriptGuard;

		Object->OnTick.ExecuteIfBound(DeltaTime);
	}
开发者ID:Grinkers,项目名称:Unreal.js,代码行数:7,代码来源:JavascriptEditorTick.cpp

示例15: Notify

/* We won't be needing this... */
uint8_t BulkOnly::Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser * prs) {
#if MS_WANT_PARSER
        if(!LUNOk[lun]) return MASS_ERR_NO_MEDIA;
        Notify(PSTR("\r\nRead (With parser)\r\n"), 0x80);
        Notify(PSTR("---------\r\n"), 0x80);

        CommandBlockWrapper cbw = CommandBlockWrapper();

        cbw.dCBWSignature = MASS_CBW_SIGNATURE;
        cbw.dCBWTag = ++dCBWTag;
        cbw.dCBWDataTransferLength = ((uint32_t)bsize * blocks);
        cbw.bmCBWFlags = MASS_CMD_DIR_IN,
                cbw.bmCBWLUN = lun;
        cbw.bmCBWCBLength = 10;

        cbw.CBWCB[0] = SCSI_CMD_READ_10;
        cbw.CBWCB[8] = blocks;
        cbw.CBWCB[2] = ((addr >> 24) & 0xff);
        cbw.CBWCB[3] = ((addr >> 16) & 0xff);
        cbw.CBWCB[4] = ((addr >> 8) & 0xff);
        cbw.CBWCB[5] = (addr & 0xff);

        return HandleSCSIError(Transaction(&cbw, bsize, prs, 1));
#else
        return MASS_ERR_NOT_IMPLEMENTED;
#endif
}
开发者ID:radiumray,项目名称:mdxly,代码行数:28,代码来源:masstorage.cpp


注:本文中的Transaction函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。