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


C++ Ret函数代码示例

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


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

示例1: Ret

//-----Início Operadores de Multplicação-----//
Matrix Matrix::operator *(Matrix Mat1)//Operador de Multiplicação Matriz Matriz
{

    float temp = 0;
    Matrix Ret(this->rows, Mat1.cols);

    try
    {
        if (this->cols != Mat1.rows)
        {
            throw "As dimensoes das matrizes nao batem, a multiplicacao nao e possivel";
            Ret.zeros(this->rows, Mat1.cols);
        }
        else
        {
            for(int i = 0; i < this->rows; i++)
            {
                for (int col = 0; col < Mat1.cols; col++)
                {
                    temp = 0;
                    for (int j = 0; j < this->cols; j++)
                        temp += this->Mat[i][j]*Mat1.Mat[j][col];
                    Ret.Mat[i][col] = temp;
                }

            }
            return Ret;
       }
    }
    catch(const char* msg)
    {
        cerr<<endl<<msg<<endl;
    }
    return Ret;
}
开发者ID:MarlosAraujo,项目名称:Matrizes,代码行数:36,代码来源:matrix.cpp

示例2: Ret

// Function to return the speed of each planet
// as an array of 2-D vectors.
vec2dN System::derX(vec2dN L){
    vec2dN Ret(nObj);
    for (int i = 0 ; i < nObj ; i++){
        Ret[i] = sys[i].relV + L[i];
    }
    return Ret;
}
开发者ID:vetlewi,项目名称:Projects,代码行数:9,代码来源:system.cpp

示例3: Ret

/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
TBool CTraceContainer::IsServerOn()
{
	TBool Ret(EFalse);
	
	TFileName res;
	TFindProcess find;
  	while(find.Next(res) == KErrNone)
    {
    	RProcess ph;
	  	ph.Open(res);
	  	  			
	  	if(ph.SecureId() == (TUint32)KUidTraceServerUID.iUid)
	 	{
	 		TExitType Exxit =ph.ExitType();
	 		if(Exxit == EExitPending)
	 		{
		  		Ret = ETrue;
		  		break;
	 		}
	  	}
	  	
	  	ph.Close();
    }
 
    return Ret;
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:30,代码来源:MainContainer.cpp

示例4: xround

Ret xround(T val, Ret ret = Ret()) {
    return static_cast<Ret>(
        (val >= 0) ?
        floor(val + (T)(.5)) :
        ceil( val - (T)(.5))
    );
}
开发者ID:CCJY,项目名称:coliru,代码行数:7,代码来源:main.cpp

示例5: Ret

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CExPolicy_Server::OkToAddToValDb(RDbDatabase& aDatabase,const TDesC& aCode,const TDesC8& aString)
{
	TBool Ret(ETrue);
	
	TFileName QueryBuffer;
	QueryBuffer.Copy(_L("SELECT * FROM "));
	QueryBuffer.Append(KtxtVallist);
	
	RDbView Myview;
	Myview.Prepare(aDatabase,TDbQuery(QueryBuffer));
	CleanupClosePushL(Myview);
	Myview.EvaluateAll();
	Myview.FirstL();
	
	QueryBuffer.Copy(aString);
		
	while(Myview.AtRow()) // Just delete one instance of the message           
	{	
		Myview.GetL();		
		
		if(QueryBuffer == Myview.ColDes(3)
		&& aCode == Myview.ColDes(2))
		{
			Ret = EFalse;
			break;	
		}
			
		Myview.NextL();
	} 
	
	CleanupStack::PopAndDestroy(1); // Myview
	
	return Ret;
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:38,代码来源:ExampleServer.cpp

示例6: Ret

/*
----------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------
*/
TInt RExampleServerClient::GetItemL(TExampleItem& aItemBuffer)
{
	TInt Ret(KErrNone);
	
	TPckgBuf<TExampleItem> ItemBuffer(aItemBuffer);
	
#ifdef __SERIES60_3X__
	
	TIpcArgs args(&ItemBuffer);
	Ret = SendReceive(EExamplePServGetItem, args);
#else	
	TAny* messageParameters[KMaxMessageArguments];

    messageParameters[0] = static_cast<TAny*>(&ItemBuffer);
    
	Ret = SendReceive(EExamplePServGetItem, &messageParameters[0]);
#endif

	aItemBuffer.iName.Copy(ItemBuffer().iName);
    aItemBuffer.iExitCatogory.Copy(ItemBuffer().iExitCatogory);
    aItemBuffer.iProcess.Copy(ItemBuffer().iProcess);
    aItemBuffer.iExitType = ItemBuffer().iExitType;
    aItemBuffer.iExitReason = ItemBuffer().iExitReason;
    aItemBuffer.iTime = ItemBuffer().iTime;
    
	return Ret;	
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:32,代码来源:ExampleServerSession.cpp

示例7: walk

        Nodecl::NodeclVisitor<void>::Ret AVX2StrideVisitorConv::unhandled_node(const Nodecl::NodeclBase& node) 
        {
            //printf("Unsupported %d: %s\n", _vector_num_elements, node.prettyprint().c_str()); 
            
            if (node.get_type().is_vector())
            {

                Nodecl::NodeclBase new_node = node.shallow_copy().as<Nodecl::NodeclBase>();

                new_node.set_type(TL::Type::get_int_type().get_vector_of_elements(
                            _vector_num_elements));

                // TODO better
                node.replace(new_node);

                Nodecl::NodeclBase::Children children = node.children();
                for(Nodecl::NodeclBase::Children::iterator it = children.begin();
                        it != children.end();
                        it ++)
                {
                    walk(*it);
                }
            }
            return Ret(); 
        }
开发者ID:bsc-pm,项目名称:mcxx,代码行数:25,代码来源:tl-vector-legalization-avx2.cpp

示例8: bind_first

 std::function<Ret (Param...)> bind_first(const std::function<Ret (P1, Param...)> &f, O&& o)
 {
   return std::function<Ret (Param...)>(
       [f, o](Param...param) -> Ret {
         return f(o, std::forward<Param>(param)...);
       });
 }
开发者ID:Coldreader88,项目名称:ChaiScript,代码行数:7,代码来源:bind_first.hpp

示例9: Ret

glm::vec4 Grid::Box( Actor const& Obj, double Dt )const
{
    Opt<IMoveComponent> moveC = Obj.Get<IMoveComponent>();
    float const MvX = moveC.IsValid() ? Dt * moveC->GetSpeedX() : 0.0f;
    float const MvY = moveC.IsValid() ? Dt * moveC->GetSpeedY() : 0.0f;

    double const Radius = Obj.Get<ICollisionComponent>()->GetRadius();
    Opt<IPositionComponent> const objPositionC = Obj.Get<IPositionComponent>();
    double const Ox = objPositionC->GetX() - mMin.x;
    double const Oy = objPositionC->GetY() - mMin.y;
    glm::vec4 Ret( Ox - Radius,
                   Oy - Radius,
                   Ox + Radius,
                   Oy + Radius );
    if( MvX < 0.0 )
    {
        Ret.x += MvX;
    }
    else
    {
        Ret.z += MvX;
    }
    if( MvY < 0.0 )
    {
        Ret.y += MvY;
    }
    else
    {
        Ret.w += MvY;
    }
    return Ret;
}
开发者ID:abannerth,项目名称:Reaping2,代码行数:32,代码来源:grid.cpp

示例10: Ret

//----Início Operador de Matriz Transposta-----//
Matrix Matrix::operator~()//Faz a transporta da Matriz
{
    Matrix temp = *this, Ret(this->cols, this->rows);
    for(int i = 0; i < this->cols; i++)
        for (int j = 0; j < this->rows; j++)
                Ret.Mat[i][j] = temp.Mat[j][i];
    return Ret;
}
开发者ID:EngineeringLibrary,项目名称:deteccao_de_estruturas_MQ,代码行数:9,代码来源:matrix.cpp

示例11: Ret

FPooledRenderTargetDesc FRCPassPostProcessTestImage::ComputeOutputDesc(EPassOutputId InPassOutputId) const
{
	FPooledRenderTargetDesc Ret(FPooledRenderTargetDesc::Create2DDesc(GSceneRenderTargets.GetBufferSizeXY(), PF_B8G8R8A8, TexCreate_None, TexCreate_RenderTargetable, false));

	Ret.DebugName = TEXT("TestImage");

	return Ret;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:8,代码来源:PostProcessTestImage.cpp

示例12: NormDataToColor

color4i NormDataToColor(double const Value)
{
	int const Index = Clamp<int>((int) (Value * ION_ARRAYSIZE(ch20m151010)), 0, ION_ARRAYSIZE(ch20m151010) - 1);
	color3f r = ch20m151010[Index];
	color4f Ret(r[0], r[1], r[2], (float) Value);
	Ret.Alpha = (float) Value;
	return Ret;
}
开发者ID:iondune,项目名称:Aqueous-2.0,代码行数:8,代码来源:ColorTable.cpp

示例13: Ret

FPooledRenderTargetDesc FRCPassPostProcessTestImage::ComputeOutputDesc(EPassOutputId InPassOutputId) const
{
	FPooledRenderTargetDesc Ret(FPooledRenderTargetDesc::Create2DDesc(FSceneRenderTargets::Get_FrameConstantsOnly().GetBufferSizeXY(), PF_B8G8R8A8, FClearValueBinding::None, TexCreate_None, TexCreate_RenderTargetable, false));

	Ret.DebugName = TEXT("TestImage");

	return Ret;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:8,代码来源:PostProcessTestImage.cpp

示例14: Ret

FPooledRenderTargetDesc FRCPassPostProcessScreenSpaceReflections::ComputeOutputDesc(EPassOutputId InPassOutputId) const
{
	FPooledRenderTargetDesc Ret(FPooledRenderTargetDesc::Create2DDesc(FSceneRenderTargets::Get_FrameConstantsOnly().GetBufferSizeXY(), PF_FloatRGBA, FClearValueBinding::None, TexCreate_None, TexCreate_RenderTargetable, false));

	Ret.DebugName = TEXT("ScreenSpaceReflections");

	return Ret;
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:8,代码来源:ScreenSpaceReflections.cpp

示例15: Ret

FPooledRenderTargetDesc FRCPassPostProcessScreenSpaceReflections::ComputeOutputDesc(EPassOutputId InPassOutputId) const
{
	FPooledRenderTargetDesc Ret(FPooledRenderTargetDesc::Create2DDesc(GSceneRenderTargets.GetBufferSizeXY(), PF_FloatRGBA, TexCreate_None, TexCreate_RenderTargetable, false));

	Ret.DebugName = TEXT("ScreenSpaceReflections");

	return Ret;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:8,代码来源:ScreenSpaceReflections.cpp


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