本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: xround
Ret xround(T val, Ret ret = Ret()) {
return static_cast<Ret>(
(val >= 0) ?
floor(val + (T)(.5)) :
ceil( val - (T)(.5))
);
}
示例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;
}
示例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;
}
示例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();
}
示例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)...);
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}