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


C++ Begin函数代码示例

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


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

示例1: Find

	ConstIterator Find(const Value &value) const
	{
		ConstIterator start(Begin());
		if (start.fReferenceIterator != fReferenceVector.end()) {
			for (; start.fReferenceIterator != fReferenceVector.end();
				 ++start.fReferenceIterator, ++start.fMyIterator) {
				if (*start.fReferenceIterator == value) {
					MyConstIterator myIt = fMyVector.Find(value);
					CHK(&*myIt == &*start.fMyIterator);
					return start;
				}
			}
			CHK(fMyVector.Find(value) == fMyVector.End());
			CHK(start.fMyIterator == fMyVector.End());
			return start;
		}
		CHK(fMyVector.Find(value) == fMyVector.End());
		return start;
	}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:19,代码来源:VectorTest.cpp

示例2: Assert

int TimedMilestonePath::Eval(Real t,Config& x) const
{
  Assert(!edges.empty());
  if(t < 0) {
    x = Begin();
    return -1;
  }
  for(size_t i=0;i<edges.size();i++) {
    if(t <= durations[i]) {
      if(durations[i] == 0) x=edges[i]->Start();
      else edges[i]->Eval(t/durations[i],x);
      return (int)i; 
    }
    t -= durations[i];
  }
  //fall through: t is longer than path
  x = End();
  return edges.size();
}
开发者ID:HargisJ,项目名称:KrisLibrary,代码行数:19,代码来源:TimedPath.cpp

示例3: Begin

//==============================================================//
//																//
//==============================================================//
void vrWrapper::Render()
{

Begin();

	if ( object ) 
	{
		vrTriObject2 *o = ( vrTriObject2* )object;
		
		if ( o ) o->Render();

	}

End();




}
开发者ID:vr55,项目名称:VR3DEngine2,代码行数:22,代码来源:vrWrapper.cpp

示例4: String

		String String::Reverse() const
		{
			if (Length() < 2)
			{
				return String(*this);
			}

			String result;
			result.Allocate(Length());

			Iterator dest = result.MutableEnd();
			for (ConstIterator src = Begin(); src != End(); ++src)
			{
				--dest;
				*dest = *src;
			}

			return result;
		}
开发者ID:odanek,项目名称:saf,代码行数:19,代码来源:String.cpp

示例5: SaveToBinary

bool TextTable::SaveToBinary(Serializer& serializer)
{
	serializer.Refresh();

	BYTE byMargin = 1;
	serializer << byMargin;

	TABLE::iterator iter;
	for (iter = Begin(); End() != iter; iter++)
	{
		sTEXT_TBLDAT* pTableData = (sTEXT_TBLDAT*)(iter->second);

		serializer << pTableData->tblidx;
		serializer << (WORD)((pTableData->wstrText).size());
		serializer.In((pTableData->wstrText).c_str(), (int)((pTableData->wstrText).size() * sizeof(WCHAR)));
	}

	return true;
}
开发者ID:ChowZenki,项目名称:dboserver,代码行数:19,代码来源:TextAllTable.cpp

示例6: gl_list_square_bevelled_plain

/*
 * Draw a square with 3D relief
 */
void gl_list_square_bevelled_plain (fpoint tl, fpoint br,
                                    texp tex, fsize tex_tl, fsize tex_br,
                                    fsize uv, color hi, color med, color lo,
                                    fsize bevel)
{
    fpoint a = {tl.x, tl.y};
    fpoint b = {br.x, tl.y};
    fpoint c = {br.x, br.y};
    fpoint d = {tl.x, br.y};
    fpoint a1 = {tl.x + bevel.width, tl.y + bevel.height};
    fpoint b1 = {br.x - bevel.width, tl.y + bevel.height};
    fpoint c1 = {br.x - bevel.width, br.y - bevel.height};
    fpoint d1 = {tl.x + bevel.width, br.y - bevel.height};

    glEnable(GL_TEXTURE_2D);

    /*
     * Draw the central flat square
     */
    Begin(GL_TRIANGLE_FAN);

    glcolor(med);
    vertex(tl, br, a.x, a.y, tex_tl, tex_br, uv);
    vertex(tl, br, b.x, b.y, tex_tl, tex_br, uv);
    vertex(tl, br, c.x, c.y, tex_tl, tex_br, uv);
    vertex(tl, br, d.x, d.y, tex_tl, tex_br, uv);

    End();

    /*
     * Now draw the bevelled border
     */
    glcolor(lo);
    quaduv(tl, br, c1, c, d, d1, tex_tl, tex_br, uv);
    glcolor(hi);
    quaduv(tl, br, a, a1, d1, d, tex_tl, tex_br, uv);

    glcolor(hi);
    quaduv(tl, br, a, b, b1, a1, tex_tl, tex_br, uv);
    glcolor(lo);
    quaduv(tl, br, b, c, c1, b1, tex_tl, tex_br, uv);
}
开发者ID:goblinhack,项目名称:adventurine,代码行数:45,代码来源:glshapes.c

示例7: Begin

void BH280::LoopOfflineExample()
{
/*  *****************************
			hand thread
	***************************** */
	Begin(VEL_CONTROL);

	double T=0.0;
	gettimeofday(&lc, NULL);
	while (shouldRun)
	{	
		gettimeofday(&now, NULL);
		T+=diffclock(&now,&lc);
		ReadFromHand();

		double f=0.2;//Hz
		double value = 0.8*PI/3 + (PI/4*sin( f* T*2*PI));

		if(!pps)
		{
			int m=1;
			Cons.cValues[m]=value;			
			int temp=(int)((PositionControlC(m) * props.scaleIN[m])+0.5);
			result=bh.RTSetVelocity(m + '1', temp);
			m=0;
			Cons.cValues[m]=value;	
			temp=(int)((PositionControl(m) * props.scaleIN[m])+0.5);
			result=bh.RTSetVelocity(m + '1', temp);

			m=3;
			Cons.cValues[m]=1;	
			temp=(int)((PositionControl(m) * props.scaleIN[m])+0.5);
			result=bh.RTSetVelocity(m + '1', temp);
			
		}
		bh.RTUpdate();
		RememberData();
	}
	bh.RTAbort();
	result = bh.Command("t");
	cout<<"Terminating thread bh280\n";
}
开发者ID:mmmatjaz,项目名称:BarrettHand,代码行数:42,代码来源:bh280.cpp

示例8: LLBC_SetLastError

LLBC_Array::Iter LLBC_Array::Replace(LLBC_Array::Iter n0, Obj *o)
{
    if (UNLIKELY(o))
    {
        LLBC_SetLastError(LLBC_ERROR_ARG);
        return End();
    }
    if (!(n0 >= Begin() && n0 < End()))
    {
        LLBC_SetLastError(LLBC_ERROR_ARG);
        return End();
    }

    _objs[n0._idx]->Release();

    _objs[n0._idx] = o;
    _objs[n0._idx]->Retain();

    return n0;
}
开发者ID:lailongwei,项目名称:llbc,代码行数:20,代码来源:Array.cpp

示例9: Begin

void Painter::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Color ink, int n, const int *dx)
{
	Begin();
	EvenOdd(true);
	if(angle)
		Rotate(angle * M_2PI / 36000);
	if(n < 0)
		n = wstrlen(text);
	double *ddx = NULL;
	Buffer<double> h;
	if(dx) {
		h.Alloc(n);
		ddx = h;
		for(int i = 0; i < n; i++)
			ddx[i] = dx[i];
	}
	Text(x, y, text, font, n, ddx);
	Fill(ink);
	End();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:20,代码来源:Painter.cpp

示例10:

_JATTA_EXPORT Jatta::String Jatta::JSON::Object::ToString()
{
    Jatta::String ret = "{\n";
    Jatta::JSON::ind++;
    for (std::map<Jatta::String, Jatta::JSON::Value>::iterator e = Begin(); e != End();)
    {
        ret += Jatta::JSON::__Indent();
        ret += '"';
        ret += e->first;
        ret += "\": ";
        ret += e->second.ToString();
        if (++e != End())
            ret += ',';
        ret += "\n";
    }
    Jatta::JSON::ind--;
    ret += Jatta::JSON::__Indent();
    ret += "}";
    return ret;
}
开发者ID:JoshuaBrookover,项目名称:Jatta,代码行数:20,代码来源:JSON.cpp

示例11: RES

//--------------------------------------------------------------------------------------
//       Class:  YARPSoundDeviceDriver
//      Method:  open 
// Description:  (public) this is one of the external visible method. It supports the 
// abstraction (open,close,IOCtl). 
//--------------------------------------------------------------------------------------
int 
YARPSoundDeviceDriver::open (void *res)
{
	int ret;
	SoundResources& d = RES(system_resources);
	
	Begin ();  //Start the thread first. The identifier is necesary in the lower level	
	
	/***************************************************************************
	 * The thread ID is necesary to run the waveIn call that uses it to assing *
	 * the callback message to this thread. Therefore, the Body part of the    *
	 * thread will receive the messages (linked internally to hardware         *
	 * interrupts) generated by the low level sound driver.                    *
	 ***************************************************************************/
	((SoundOpenParameters *)res)->m_callbackthread_identifier = this->identifier;
	
	ret = d._initialize (*(SoundOpenParameters *)res);

	return ret;
}
开发者ID:robotology-legacy,项目名称:yarp1,代码行数:26,代码来源:YARPSoundDeviceDriver.cpp

示例12: LLBC_STREAM_BEGIN_WRITE

void LLBC_Array::SerializeInl(LLBC_Stream &s, bool extended) const
{
    LLBC_STREAM_BEGIN_WRITE(s);

    LLBC_STREAM_WRITE(static_cast<uint64>(_size));

    ConstIter it = Begin(), endIt = End();
    for (; it != endIt; it++)
    {
        if (!extended)
        {
            LLBC_STREAM_WRITE(*it);
        }
        else
        {
            LLBC_STREAM_WRITE_EX(*it);
        }
    }

    LLBC_STREAM_END_WRITE();
}
开发者ID:lailongwei,项目名称:llbc,代码行数:21,代码来源:Array.cpp

示例13: count

size_t  List<T>::Remove (const T& t)
// Remove all copies of t
// This doesn't use member priviledge, so could be an external function
// It gives the archetype for interaction between Remove(i) and ++i
{
  size_t count(0);
  Iterator i = Begin();
  while (i != End())
  {
    if (t == *i)
    {
      i = Remove(i);
      ++count;
    }
    else
    {
      ++i;
    }
  }
  return (count);
}  // end Remove(t)
开发者ID:cob174,项目名称:school-projects,代码行数:21,代码来源:list.cpp

示例14: _Init

VGraphicPath::VGraphicPath( const VPolygon& inPolygon)
{
	_Init( false, true);
	Begin();
	sLONG count = inPolygon.GetPointCount();
	if (count >= 2)
	{
		VPoint pt;
		inPolygon.GetNthPoint( 1, pt);
		BeginSubPathAt( pt);
		VPoint ptStart = pt;
		for (sLONG index = 2; index <= count; index++)
		{
			inPolygon.GetNthPoint( index, pt);
			AddLineTo( pt);
		}
		if (pt != ptStart)
			CloseSubPath();
	}
	End();
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:21,代码来源:XWinBezier.cpp

示例15: VPoint

void VGraphicPath::BeginSubPathAt(const VPoint& inLocalPoint)
{
#if !GRAPHIC_MIXED_GDIPLUS_D2D
	if (!VWinD2DGraphicContext::IsAvailable())
	{
#endif
		fLastPoint = VPoint((GReal)inLocalPoint.GetX(), (GReal)inLocalPoint.GetY());
		fPath->StartFigure();
#if !GRAPHIC_MIXED_GDIPLUS_D2D
	}
#endif

#if ENABLE_D2D
	if (VWinD2DGraphicContext::IsAvailable())
	{
		if (!fGeomSink)
		{
			Begin();
			if (!fGeomSink)
				return;
		}

		if (!fFigureIsClosed)
			//do not forget to close current figure before opening new figure to prevent really nasty artifacts...
			fGeomSink->EndFigure( D2D1_FIGURE_END_OPEN);
		fGeomSink->BeginFigure( D2D1::Point2F( inLocalPoint.GetX(), inLocalPoint.GetY()),
								   D2D1_FIGURE_BEGIN_FILLED);
		fFigureIsClosed = false;
	}
#endif

	fPolygon.AddPoint(inLocalPoint);

	if (fComputeBoundsAccurate)
		_addPointToBounds( inLocalPoint);
	_ComputeBounds();

	if (fCreateStorageForCrispEdges)
		fDrawCmds.push_back( VGraphicPathDrawCmd( GPDCT_BEGIN_SUBPATH_AT, inLocalPoint));
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:40,代码来源:XWinBezier.cpp


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