这篇教程C++ GetResult函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetResult函数的典型用法代码示例。如果您正苦于以下问题:C++ GetResult函数的具体用法?C++ GetResult怎么用?C++ GetResult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetResult函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Openbool Open(V4V_CONTEXT& ctx, domid_t partner, uint32_t port){ ATLTRACE(__FUNCTION__ " Entry/n"); DWORD error(0); DWORD bytes(0); OVERLAPPED ov = { 0 }; ov.hEvent = ::CreateEvent(0, true, false, 0); ::memset(&ctx, 0, sizeof(V4V_CONTEXT)); ctx.flags = V4V_FLAG_OVERLAPPED; ATLTRACE(__FUNCTION__ " V4vOpen/n"); if (!V4vOpen(&ctx, RingSize, &ov)) { error = ::GetLastError(); } else { error = GetResult(ctx, &ov, bytes); } if (error) { ATLTRACE(__FUNCTION__ " V4vOpen Error:%d/n", error); } else { v4v_ring_id_t v4vid = { 0 }; v4vid.addr.domain = V4V_DOMID_NONE; v4vid.addr.port = port; v4vid.partner = partner; ATLTRACE(__FUNCTION__ " V4vBind/n"); if (!V4vBind(&ctx, &v4vid, &ov)) { error = ::GetLastError(); } else { error = GetResult(ctx, &ov, bytes); } if (error) { ATLTRACE(__FUNCTION__ " V4vBind Error:%d/n", error); } } ::CloseHandle(ov.hEvent); ATLTRACE(__FUNCTION__ " Exit Result:%d/n", error); return (0 == error);}
开发者ID:barryrandall,项目名称:xc-windows,代码行数:57,
示例2: main/** * Lists all iam policies */int main(int argc, char** argv){ Aws::SDKOptions options; Aws::InitAPI(options); { Aws::IAM::IAMClient iam; Aws::IAM::Model::ListPoliciesRequest request; bool done = false; bool header = false; while (!done) { auto outcome = iam.ListPolicies(request); if (!outcome.IsSuccess()) { std::cout << "Failed to list iam policies: " << outcome.GetError().GetMessage() << std::endl; break; } if (!header) { std::cout << std::left << std::setw(55) << "Name" << std::setw(30) << "ID" << std::setw(80) << "Arn" << std::setw(64) << "Description" << std::setw(12) << "CreateDate" << std::endl; header = true; } const auto &policies = outcome.GetResult().GetPolicies(); for (const auto &policy : policies) { std::cout << std::left << std::setw(55) << policy.GetPolicyName() << std::setw(30) << policy.GetPolicyId() << std::setw(80) << policy.GetArn() << std::setw(64) << policy.GetDescription() << std::setw(12) << policy.GetCreateDate().ToGmtString(DATE_FORMAT) << std::endl; } if (outcome.GetResult().GetIsTruncated()) { request.SetMarker(outcome.GetResult().GetMarker()); } else { done = true; } } } Aws::ShutdownAPI(options); return 0;}
开发者ID:gabordc,项目名称:aws-doc-sdk-examples,代码行数:56,
示例3: handleIterateFinished void GraffitiTab::handleIterateFinished () { auto recIterator = qobject_cast<RecIterator*> (sender ()); recIterator->deleteLater (); const auto& files = recIterator->GetResult (); FilesWatcher_->AddFiles (files); FilesModel_->AddFiles (files); auto resolver = LMPProxy_->GetTagResolver (); auto worker = [resolver, files] () -> QList<MediaInfo> { QList<MediaInfo> infos; for (const auto& file : files) try { infos << resolver->ResolveInfo (file.absoluteFilePath ()); } catch (const std::exception& e) { qWarning () << Q_FUNC_INFO << e.what (); } return infos; }; auto scanWatcher = new QFutureWatcher<QList<MediaInfo>> (); connect (scanWatcher, SIGNAL (finished ()), this, SLOT (handleScanFinished ())); scanWatcher->setProperty ("LMP/Graffiti/Filename", recIterator->property ("LMP/Graffiti/Filename")); scanWatcher->setFuture (QtConcurrent::run (std::function<QList<MediaInfo> ()> (worker))); }
开发者ID:MellonQ,项目名称:leechcraft,代码行数:35,
示例4: AllocateAndAssociateAddressvoid AllocateAndAssociateAddress(const Aws::String& instance_id){ Aws::EC2::EC2Client ec2; Aws::EC2::Model::AllocateAddressRequest request; request.SetDomain(Aws::EC2::Model::DomainType::vpc); auto outcome = ec2.AllocateAddress(request); if(!outcome.IsSuccess()) { std::cout << "Failed to allocate elastic ip address:" << outcome.GetError().GetMessage() << std::endl; return; } Aws::String allocation_id = outcome.GetResult().GetAllocationId(); Aws::EC2::Model::AssociateAddressRequest associate_request; associate_request.SetInstanceId(instance_id); associate_request.SetAllocationId(allocation_id); auto associate_outcome = ec2.AssociateAddress(associate_request); if(!associate_outcome.IsSuccess()) { std::cout << "Failed to associate elastic ip address" << allocation_id << " with instance " << instance_id << ":" << associate_outcome.GetError().GetMessage() << std::endl; return; } std::cout << "Successfully associated elastic ip address " << allocation_id << " with instance " << instance_id << std::endl;}
开发者ID:ronhash10,项目名称:aws-doc-sdk-examples,代码行数:31,
示例5: TEST/// @brief 添加一个TestCase到一个TestSuite/n/// TEST(TestICalc, ExceptionData)将测试所有异常的数据TEST(TestICalc, ExceptionData){ for (int i=0; i<8; i++) { EXPECT_EQ( ExceptionResult[i], GetResult(ExceptionData[i]) ) << "Error at index :" << i; }}
开发者ID:testzzzz,项目名称:hwccnet,代码行数:9,
示例6: nstring//-----------------------------------------------------------------------------C_NStrOutf::operator nstring () const{ bool bFormat = false; nstring szResult; nstring szFormat; std::vector<nstring>::size_type Pos = 0; for(const nstring::value_type &Itor : m_szFormat) { if(Itor == __T('{')) { bFormat = true; continue; }//if if(Itor == __T('}')) { bFormat = false; szResult += GetResult(szFormat, m_Data.size() > Pos ? m_Data[Pos] : __T('')); szFormat.clear(); ++Pos; continue; }//if if(bFormat) szFormat += Itor; else szResult += Itor; }//for return szResult;}
开发者ID:yinweli,项目名称:platform,代码行数:35,
示例7: Loadbool ResourceShader::Load( ResourceMemoryAllocator &inAllocator, ResourceDirectory &inDir ) { allocator = &inAllocator; auto res = ResourceDirectory::instance->Open(GetLocation(), ResourceDirectory::PERMISSION_ReadOnly); auto resIo = res.GetResult(); if(!resIo) return false; Int size = 0; Int realSize = 0; Int bytesRead; const Int increment = 1024; do { size += increment; string = (char*)allocator->Reallocate(string, size+1); bytesRead = resIo->Read(string+size-increment, increment).GetResult(); realSize += bytesRead; if(bytesRead < increment) break; } while(true); string = (char*)allocator->Reallocate(string, realSize+1); string[realSize] = 0; return true;}
开发者ID:prototypegames,项目名称:polymania,代码行数:28,
示例8: MakeCallbackvoid MakeCallback(uv_work_t* req) { Nan::HandleScope scope; Nan::TryCatch try_catch; sass_context_wrapper* ctx_w = static_cast<sass_context_wrapper*>(req->data); struct Sass_Context* ctx; if (ctx_w->dctx) { ctx = sass_data_context_get_context(ctx_w->dctx); } else { ctx = sass_file_context_get_context(ctx_w->fctx); } int status = GetResult(ctx_w, ctx); if (status == 0 && ctx_w->success_callback) { // if no error, do callback(null, result) ctx_w->success_callback->Call(0, 0); } else if (ctx_w->error_callback) { // if error, do callback(error) const char* err = sass_context_get_error_json(ctx); v8::Local<v8::Value> argv[] = { Nan::New<v8::String>(err).ToLocalChecked() }; ctx_w->error_callback->Call(1, argv); } if (try_catch.HasCaught()) { Nan::FatalException(try_catch); } sass_free_context_wrapper(ctx_w);}
开发者ID:jjcarey,项目名称:starkiller-wordpress-theme,代码行数:34,
示例9: pageIds void ExecuteCommandDialog::handleCurrentChanged (int id) { if (!dynamic_cast<WaitPage*> (currentPage ())) return; const auto& ids = pageIds (); const int pos = ids.indexOf (id); if (pos <= 0) return; const auto prevPage = page (ids.at (pos - 1)); if (dynamic_cast<CommandsListPage*> (prevPage)) { const AdHocCommand& cmd = dynamic_cast<CommandsListPage*> (prevPage)->GetSelectedCommand (); if (cmd.GetName ().isEmpty ()) deleteLater (); else ExecuteCommand (cmd); } else if (dynamic_cast<CommandResultPage*> (prevPage)) { const auto crp = dynamic_cast<CommandResultPage*> (prevPage); const auto& action = crp->GetSelectedAction (); if (action.isEmpty ()) return; auto result = crp->GetResult (); result.SetDataForm (crp->GetForm ()); ProceedExecuting (result, action); } }
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:32,
示例10: SetPyExceptionvoid SetPyException(const std::exception& ex){ const char* message = ex.what(); if (dynamic_cast<const MI::TypeConversionException*>(&ex)) { PyErr_SetString(PyExc_TypeError, message); } else { PyObject* d = PyDict_New(); PyObject* pyEx = nullptr; if (dynamic_cast<const MI::MITimeoutException*>(&ex)) { pyEx = PyMITimeoutError; } else { pyEx = PyMIError; } if (dynamic_cast<const MI::MIException*>(&ex)) { auto miex = static_cast<const MI::MIException*>(&ex); PyDict_SetItemString(d, "error_code", PyLong_FromUnsignedLong(miex->GetErrorCode())); PyDict_SetItemString(d, "mi_result", PyLong_FromUnsignedLong(miex->GetResult())); } PyDict_SetItemString(d, "message", PyUnicode_FromString(message)); PyErr_SetObject(pyEx, d); Py_DECREF(d); }}
开发者ID:alinbalutoiu,项目名称:PyMI,代码行数:32,
示例11: rangeObjectvoid rangeObject(ClientPtrType client, String bucketName, String key, String path, size_t min, size_t max){ String base = "=== Range Object [" + bucketName + "/" + key; std::cout << base << "]: Start ===/n"; std::cout << "Reading from " << path << "/n"; String range(("byte=" + std::to_string(min) + "-" + std::to_string(max)).c_str()); auto inpData = Aws::MakeShared<Aws::FStream>("GetObjectInputStream", path.c_str(), std::ios_base::in | std::ios_base::binary); auto objReq = Aws::S3::Model::GetObjectRequest(); objReq.WithBucket(bucketName).WithKey(key).WithRange(range); auto objRes = client->GetObject(objReq); if (!objRes.IsSuccess()) { std::cout << base << "]: Client Side failure ===/n"; std::cout << objRes.GetError().GetExceptionName() << "/t" << objRes.GetError().GetMessage() << "/n"; std::cout << base << "]: Failed ===/n"; } else { Aws::IOStream& file = objRes.GetResult().GetBody(); if (!doFilesMatch(inpData.get(), file, min, max)) { std::cout << base << "]: Content not equal ===/n"; } } std::cout << base << "]: End ===/n/n";}
开发者ID:leo-project,项目名称:leofs_client_tests,代码行数:28,
示例12: GetResultvoid CExampleTest::TestCase02(){ char *input[] = {"10 10 10 10 10 10 9 xiaoyuanwang","0 0 0 0 0 0 0 beast"}; char result[100] = {0}; GetResult(input, 2, result); CPPUNIT_ASSERT(0 == strcmp(result, "xiaoyuanwang 10.00/nbeast 0.00") );}
开发者ID:VicoandMe,项目名称:HW,代码行数:7,
示例13: mainint main(){ char input[20] = {0}; int len = 0; int res = 0; int i = 0; int j = 0; ElementType infix[20] = {0}; ElementType suffix[20] = {0}; //StackNode* infix_head; //StackNode* top; fgets(input,20,stdin); len = ArrayToInfix(input,infix); //PrintFormula(infix, len); len = InfixToSuffix(infix,suffix,len); //PrintFormula(suffix, len); res = GetResult(suffix,len); printf("= %d/n", res); //PrintInfix(infix,len); /*InitStack(&infix_head, &top); for (i = 0; i < len; ++i) { StackPush(infix_head,&top,infix[i]); } PrintStack(infix_head);*/ }
开发者ID:KoenChiu,项目名称:C-Projects,代码行数:29,
示例14: SendLibraNum// Виконааня команди cmd з параметрами paramsint XLibraLP::DoCmd(unsigned char cmd, char *params){ SendLibraNum(); Write(&cmd, 1); switch (cmd) { case 0x82: Write(params, 83); break; case 0x8a: Write(params, 9); break; case 0x8d: Write(params, 4); break; case 0x81: Write(params, 4); unsigned char ch; for (int i(0); i < 100; i++) Read(&ch, 1); break; }; Listen(); return GetResult()->error;}
开发者ID:kilydz,项目名称:tp-exchange,代码行数:30,
示例15: PackWebRsp/****************************************************************** 功 能:应答报文组包** 输入参数:** ptApp app结构指针** 输出参数:** szRspBuf 交易应答报文** 返 回 值:** >0 报文长度** FAIL 失败** 作 者:** fengwei** 日 期:** 2012/12/18** 调用说明:**** 修改日志:****************************************************************/int PackWebRsp(T_App *ptApp, char *szRspBuf){ int iIndex; /* buf索引 */ int iMsgCount; /* 短信记录数 */ int iRetDescLen; /* 响应信息长度 */ iIndex = 0; /* 交易代码 */ memcpy(szRspBuf+iIndex, ptApp->szTransCode, 8); iIndex += 8; /* 响应码 */ memcpy(szRspBuf+iIndex, ptApp->szRetCode, 2); iIndex += 2; /* 根据返回码取返回信息 */ if(strlen(ptApp->szRetDesc) == 0) { GetResult(ptApp->szRetCode, ptApp->szRetDesc); } /* 响应信息长度 */ iRetDescLen = strlen(ptApp->szRetDesc); szRspBuf[iIndex] = iRetDescLen; iIndex += 1; /* 响应信息 */ memcpy(szRspBuf+iIndex, ptApp->szRetDesc, iRetDescLen); iIndex += iRetDescLen; return iIndex;}
开发者ID:Yifei0727,项目名称:epay5,代码行数:50,
示例16: ProcOneStringBOOL CMatrixDoc::ProcOneString(const CString & sData){ CString temp=sData; CString sName=_T(""); bool IsExisted=false; CArrayMatrix *PtrNew=NULL; if(!CArrayMatrix::SetStringName(temp,sName)) return FALSE; CArrayMatrix::ProcString(temp); POSITION pos=m_VariablePtrList.GetHeadPosition(); for(int i=0;i<m_VariablePtrList.GetCount();i++) { CArrayMatrix *Ptr=(CArrayMatrix *)m_VariablePtrList.GetAt(pos); if(Ptr->GetName()==sName) {IsExisted=true;PtrNew=Ptr;break;} m_VariablePtrList.GetNext(pos); } if(!IsExisted) { PtrNew=new CArrayMatrix; pos=m_VariablePtrList.AddTail(PtrNew); } //现在PtrNew指向新的目标变量 CArrayMatrix tpMatrix; if(!GetResult(temp,tpMatrix)) { if(!IsExisted) { delete PtrNew; m_VariablePtrList.RemoveAt(pos); return FALSE; } } *PtrNew=tpMatrix; return true;}
开发者ID:eecrazy,项目名称:acmcode,代码行数:34,
示例17: GetFocusvoid CWndToolbox::DoModal(){ BIOS::SYS::Beep(100); /*#ifdef _WIN32 // no enough ram for this on ARM M3 :( ui16 buffer[Width*Height]; BIOS::LCD::GetImage( m_rcClient, buffer );#endif */ m_bRunning = true; m_bFirst = true; m_bAdcEnabled = BIOS::ADC::Enabled(); BIOS::ADC::Enable(false); if ( MainWnd.m_wndMenuInput.m_wndListTrigger.IsVisible() ) MainWnd.m_wndMenuInput.m_wndListTrigger.Invalidate(); if ( MainWnd.m_wndMenuInput.m_itmTrig.IsVisible() ) MainWnd.m_wndMenuInput.m_itmTrig.Invalidate(); CWnd* pSafeFocus = GetFocus(); SetFocus(); ShowWindow( CWnd::SwShow ); Invalidate(); while ( IsRunning() ) { Sleep(20); } ShowWindow( CWnd::SwHide ); /*#ifdef _WIN32 BIOS::LCD::PutImage( m_rcClient, buffer );#endif*/ switch ( GetResult() ) { case MenuPauseResume: // Resume / Pause m_bAdcEnabled = !m_bAdcEnabled; break; case MenuManager: m_bAdcEnabled = FALSE; // Load wave BIN break; case MenuReset: Settings.Reset(); break; case -1: break; } UpdateAdc(); pSafeFocus->SetFocus(); CRect rcSafe = m_rcOverlay; m_rcOverlay.Invalidate(); MainWnd.Invalidate(); // to redraw the graph m_rcOverlay = rcSafe;}
开发者ID:cycologist,项目名称:DS203,代码行数:59,
示例18: GetResultvoid Report::Flush(){ if(pagei >= 0) { Drawing dw = GetResult(); page.At(pagei).Append(dw); Create(GetSize()); }}
开发者ID:ultimatepp,项目名称:mirror,代码行数:8,
示例19: GetResultstd::string FootballMatch::GetLoser() const{ Result res = GetResult(); if (res.home < res.guest) return m_homeTeam; return m_guestTeam;}
开发者ID:rigoz,项目名称:qDB,代码行数:8,
|