本文整理匯總了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;
}
示例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();
}
示例3: Begin
//==============================================================//
// //
//==============================================================//
void vrWrapper::Render()
{
Begin();
if ( object )
{
vrTriObject2 *o = ( vrTriObject2* )object;
if ( o ) o->Render();
}
End();
}
示例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;
}
示例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;
}
示例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);
}
示例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";
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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)
示例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();
}
示例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));
}