• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetResult函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Open

bool 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,代码来源:v4vmsg.cpp


示例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,代码来源:list_policies.cpp


示例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,代码来源:graffititab.cpp


示例4: AllocateAndAssociateAddress

void 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,代码来源:allocate_address.cpp


示例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,代码来源:testICalculator.cpp


示例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,代码来源:_nstroutf.cpp


示例7: Load

bool 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,代码来源:shader.cpp


示例8: MakeCallback

void 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,代码来源:binding.cpp


示例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,代码来源:executecommanddialog.cpp


示例10: SetPyException

void 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,代码来源:Utils.cpp


示例11: rangeObject

void 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,代码来源:main.cpp


示例12: GetResult

void 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,代码来源:CExampleTest.cpp


示例13: main

int 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,代码来源:calc_Beta_v1.c


示例14: SendLibraNum

// Виконааня команди cmd з параметрами params
int 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,代码来源:libraLP.cpp


示例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,代码来源:PackWebRsp.c


示例16: ProcOneString

BOOL 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,代码来源:MatrixDoc.cpp


示例17: GetFocus

void 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,代码来源:ToolBox.cpp


示例18: GetResult

void Report::Flush()
{
	if(pagei >= 0) {
		Drawing dw = GetResult();
		page.At(pagei).Append(dw);
		Create(GetSize());
	}
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:8,代码来源:Report.cpp


示例19: GetResult

std::string FootballMatch::GetLoser() const
{
	Result res = GetResult();
	if (res.home < res.guest)
		return m_homeTeam;
		
	return m_guestTeam;
}
开发者ID:rigoz,项目名称:qDB,代码行数:8,代码来源:FootballMatch.cpp


示例20: main

//프로그램의 전체적 흐름.
int main(void)
{
	int nResult = 0;

	nResult = GetResult();
	printf("당신의 학점은 '%c'(%d)입니다.\n", GetGrade(nResult), nResult);
	return 0;
}
开发者ID:VincentCodeKim,项目名称:Book_C_DokhageStartC,代码行数:9,代码来源:funcdesign03.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetRhsVar函数代码示例发布时间:2022-05-30
下一篇:
C++ GetResponse函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap