本文整理汇总了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);
}
示例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);
}
}
示例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
}
示例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
}
示例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;
}
示例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());
}
}
}
示例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());
}
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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
}
示例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());
}
}
示例14: Tick
virtual void Tick(float DeltaTime) override
{
FScopedTransaction Transaction(NSLOCTEXT("UnrealEd", "UnrealJS", "Javascript action"));
FEditorScriptExecutionGuard ScriptGuard;
Object->OnTick.ExecuteIfBound(DeltaTime);
}
示例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
}