本文整理汇总了C++中Last函数的典型用法代码示例。如果您正苦于以下问题:C++ Last函数的具体用法?C++ Last怎么用?C++ Last使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Last函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TFSet
void TGStatVec::PlotAllVsX(const TGStatVal& XVal, const TStr& OutFNm, TStr Desc, const TGpScaleTy& Scale, const bool& PowerFit) const {
const TFSet SkipStat = TFSet() | gsvFullDiamDev | gsvEffDiamDev | gsvEffWccDiamDev | gsvFullWccDiamDev;
for (int stat = gsvNone; stat < gsvMx; stat++) {
const TGStatVal Stat = TGStatVal(stat);
if (SkipStat.In(Stat)) { continue; }
if (Last()->HasVal(Stat) && Last()->HasVal(XVal) && Stat!=XVal) {
Plot(XVal, Stat, OutFNm, Desc, Scale, PowerFit);
}
}
}
开发者ID:Accio,项目名称:snap,代码行数:10,代码来源:gstat.cpp
示例2: assert
/** \brief Remember a previous nline-position
*/
void GRVoice::rememberNLinePosition(const TYPE_TIMEPOSITION & tp)
{
assert(tp == nlinetp);
GuidoPos pos = Last();
while (pos && pos != nlinepos)
{
GetCompositeElements().RemoveTail();
pos = Last();
}
}
开发者ID:anttirt,项目名称:guidolib,代码行数:13,代码来源:GRVoice.cpp
示例3: while
void MessageMQ::AppendData(const char* data, uint32_t size) {
size_t feeds = 0;
while (feeds < size) {
if (Last()->Completion()) {
mq_.push(CreateMessage(msg_type_));
}
feeds += Last()->AppendData(&data[feeds], size - feeds);
if (Last()->Completion()) {
printf("[MessageMQ] Recieved a complation message, type: %d, size: %lu\n", Last()->Type(), Last()->Size());
}
}
}
开发者ID:Dutch-Man,项目名称:EventLoop,代码行数:12,代码来源:message.cpp
示例4: AddFolge
BOOL CPunktFolge :: AddFolge( CPunktFolge* pP )
{ BOOL result = FALSE;
int i;
// Sonderfall 1: Die zu addierende Folge ist leer. ==> ignorieren! -------
if ( pP -> GetSize() == 0 ) return result;
// Sonderfall 2: Die aufnehmende Folge ist (noch) leer. ==> aufnehmen! ---
if ( GetSize() == 0 )
{ result = TRUE;
for ( i = 0; i < pP -> GetSize(); i++ )
Add( new CPunkt( *(CPunkt*)(pP -> GetAt( i ))));
return result;
}
// Sonderfall 3: Die zu addierende Folge schließt die Kontur. ------------
// Wird im folgenden automatisch berücksichtigt! -------------
// Normalfall: Beide Folgen sind nicht leer. ==> Gemeinsame Endpunkte ----
// suchen. ---------------------------------------------------
// Sonderfall 4: Folgen die lediglich aus einem Punkt bestehen werden ----
// jeweils bei Existenz eines gemeinsamen Endpuktes be- ------
// rücksichtigt. ---------------------------------------------
if ( pP -> First() == Last()) // einfach anhängen!
{ result = TRUE; // -> erster Punkt in pP fällt unter
if ( pP -> GetSize() > 1 ) // den Tisch!
for ( i = 1; i < pP -> GetSize(); i++ )
Add( new CPunkt( *(CPunkt*)(pP -> GetAt( i ))));
}
else if ( pP -> Last() == First()) // vorn einfügen
{ result = TRUE; // erster Punkt via InsertAt
if ( pP -> GetSize() > 1 ) // der Rest folgt via SetAt, nur der letzte
{ InsertAt( 0, new CPunkt( pP -> First()), pP -> GetSize() - 1 );
for ( i = 1; i <= pP -> GetSize() - 2; i++ ) // fällt weg!
SetAt( i, new CPunkt( *(CPunkt*)(pP -> GetAt( i ))));
} }
else if ( pP -> Last() == Last()) // umdrehen und anhängen
{ result = TRUE; // -> letzter Punkt wird durch Umdrehen
if ( pP -> GetSize() > 1 ) // erster und fällt weg!
for ( i = pP -> GetSize() - 2; i >= 0; i-- )
Add( new CPunkt( *(CPunkt*)(pP -> GetAt( i ))));
}
else if ( pP -> First() == First()) // umdrehen und vorn einfügen
{ result = TRUE; // letzter Punkt via InsertAt
if ( pP -> GetSize() > 1 ) // der Rest folgt via SetAt, nur der erste
{ InsertAt( 0, new CPunkt( pP -> Last()), pP -> GetSize() - 1 );
for ( i = pP -> GetSize() - 2; i > 0; i-- ) // fällt weg
SetAt( pP -> GetSize() - i - 1, new CPunkt( *(CPunkt*)(pP -> GetAt( i ))));
} }
return result;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:52,代码来源:GEOOBJ.CPP
示例5: YsShellExtEdit_LoopStitching
YSRESULT YsShellExtEdit_LoopStitching(YsShellExtEdit &shl)
{
YsShellExt_SingleUseEdgeCondition cond;
YSRESULT res=YSERR;
// First deal with a loop hanging on a vertex.
for(auto vtHd0 : shl.AllVertex())
{
auto connVtHd=shl.GetConnectedVertex(vtHd0,cond);
if(3<=connVtHd.GetN())
{
for(auto vtHd1 : connVtHd)
{
auto vtLoop=YsShellExt_TrackingUtil::TrackEdge(shl.Conv(),vtHd0,vtHd1,cond);
if(3<=vtLoop.GetN() && vtLoop[0]==vtLoop.Last())
{
YsShellExtEdge_EdgeStaplingUtil stitcher;
stitcher.SetCrackBoundary(shl.Conv(),vtLoop.GetN()-1,vtLoop);
if(YSOK==stitcher.StapleMinimumOpenAngleCorner(shl))
{
res=YSOK;
}
}
}
}
}
for(auto vtHd0 : shl.AllVertex())
{
auto connVtHd=shl.GetConnectedVertex(vtHd0,cond);
if(2==connVtHd.GetN())
{
auto vtLoop=YsShellExt_TrackingUtil::TrackEdge(shl.Conv(),vtHd0,connVtHd[0],cond);
if(3<=vtLoop.GetN() && vtLoop[0]==vtLoop.Last())
{
YsShellExtEdge_EdgeStaplingUtil stitcher;
stitcher.SetCrackBoundary(shl.Conv(),vtLoop.GetN()-1,vtLoop);
if(YSOK==stitcher.StapleMinimumOpenAngleCorner(shl))
{
res=YSOK;
}
}
}
}
return res;
}
开发者ID:ninkamat,项目名称:CMU-24-681-CAD-MIProject,代码行数:50,代码来源:ysshellextedit_stitchingutil.cpp
示例6: insertLast
void insertLast(List &L, address P)
{
if(First(L) == NULL)
{
insertFirst(L,P);
}
else
{
Next(P) = First(L);
Prev(P) = Last(L);
Next(Last(L))=P;
Prev(Last(L)) = P;
Last(L) = P;
}
}
开发者ID:mfarin,项目名称:Task_4,代码行数:15,代码来源:list.cpp
示例7: SystemNode
/** \brief Indicates, that a new system has started.
this must be reflected by a new entry into the sysvect.
*/
void GRVoice::startNewSystem(GRSystem * in)
{
SystemNode * sysnode = new SystemNode();
sysnode->grsystem = in;
sysnode->pos = Last();
mSysNodeList->AddTail(sysnode);
}
开发者ID:anttirt,项目名称:guidolib,代码行数:10,代码来源:GRVoice.cpp
示例8: Append
RectSelection::RectSelection (Coord l, Coord b, Coord r, Coord t, Graphic* gs)
: (gs) {
myname = "Rect";
Append(new IFillRect(l, b, r, t));
Append(new Rect(l, b, r, t));
}
// RectSelection reads data to initialize its graphic state and create
// its filled interior and outline.
RectSelection::RectSelection (istream& from, State* state) : (nil) {
myname = "Rect";
ReadGS(from, state);
Skip(from);
Coord l, b, r, t;
from >> l >> b >> r >> t;
Append(new IFillRect(l, b, r, t));
Append(new Rect(l, b, r, t));
}
// Copy returns a copy of the RectSelection.
Graphic* RectSelection::Copy () {
Coord l, b, r, t;
GetOriginal2(l, b, r, t);
return new RectSelection(l, b, r, t, this);
}
// GetOriginal2 returns the two corners that were passed to the
// RectSelection's constructor.
void RectSelection::GetOriginal2 (Coord& l, Coord& b, Coord& r, Coord& t) {
((Rect*) Last())->GetOriginal(l, b, r, t);
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:34,代码来源:slpolygons.c
示例9: NS_ERROR
//------------------------------------------------------------
void
nsFilteredContentIterator::Last()
{
if (!mCurrentIterator) {
NS_ERROR("Missing iterator!");
return;
}
// If we are switching directions then
// we need to switch how we process the nodes
if (mDirection != eBackward) {
mCurrentIterator = mIterator;
mDirection = eBackward;
mIsOutOfRange = false;
}
mCurrentIterator->Last();
if (mCurrentIterator->IsDone()) {
return;
}
nsINode *currentNode = mCurrentIterator->GetCurrentNode();
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));
bool didCross;
CheckAdvNode(node, didCross, eBackward);
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:30,代码来源:nsFilteredContentIterator.cpp
示例10: throw
data_string& data_string::operator=(char * new_string)
{
if (!new_string)
throw("Error memory alloc");
clean_up();
char *temp = new_string;
while (*temp++ != '\0') this->size++;
this->str = new char[this->size + 1];
if (this->str == NULL)
throw("Error Alloc memory");
temp = new_string;
for (size_t i = 0; i<=this->lenght(); i++)
this->str[i] = temp[i];
this->_fill = this->lenght();
Head(this->str);
Last(this->str + this->fill());
Tail(this->str + this->lenght());
return *this;
}
开发者ID:dneprstep,项目名称:doubly-linked_list,代码行数:27,代码来源:data_string.cpp
示例11: AND
void AND( ADNFClause dst, ADNFClause src)
{
ADNFClause newChainEnd; //the CURRENT tail of the new chain of and clauses
ADNFClause oldChainI; //old chain iterator
// ADNFClause oldCur;
ADNFClause srcI; //source iterator
ADNFClause t; //temp!
oldChainI=dst->next; //to read the original and clauses from the original linked list
newChainEnd=dst; //the head
newChainEnd->next=0;//empty list for now
while (oldChainI)
{
for (srcI= src->next; srcI; srcI= srcI->next) //traverse the other operand to and all the and clauses!
{
t=AddClause( newChainEnd, srcI->set | oldChainI->set); //if it's not added, t=0!
//Orring two sets means their union, therefore ANDing the and clauses
newChainEnd= (t)? (Last(t)): (newChainEnd); //if the new clause is not added, it has not deleted anything either
}
t= oldChainI->next;
free(oldChainI);
oldChainI= t;
}
}
开发者ID:Tabaie,项目名称:DNFMinimizer,代码行数:30,代码来源:DNFCMD.c
示例12: clean_up
void data_string::resize(const size_t& s)
{
if (s == 0)
{
clean_up();
return;
}
char *cur_temp = this->str;
size_t old_size = this->size;
this->size = s;
this->str = new char[this->size + 1];
if (this->str == NULL)
throw("Error alloc memory");
for (size_t i = 0; i <= old_size && i < this->lenght(); i++)
this->str[i] = cur_temp[i];
this->_fill = old_size>this->lenght() ? this->lenght() : this->fill();
this->str[this->fill()] = '\0';
delete[] cur_temp;
Head(this->str);
Last(this->str + this->fill());
Tail(this->str + this->lenght());
}
开发者ID:dneprstep,项目名称:doubly-linked_list,代码行数:30,代码来源:data_string.cpp
示例13: at
// Capitalize the first letter of each word.
// Trim leading and trailing non-graphic characters.
// Convert adjacent non-graphic characters a single space.
// Equal-signs (=) are treated as non-graphic characters.
void String::Capitalize(void) {
bool after_graphic = false;
String result;
char const space = ' ';
for (SizeType i_char = 0; i_char < Length(); i_char++) {
char ch = at(i_char);
bool const is_graphic = (::isgraph(ch) != 0 && ch != '=');
if (!is_graphic) {
ch = space;
} else if (!after_graphic) { // first letter of a word
ch = char(::toupper(ch));
}
if (is_graphic || after_graphic) {
result += ch;
}
after_graphic = is_graphic;
}
*this = result;
if (!IsEmpty() && Last() == space) {
// remove trailing space, which was originally some non-graphic character
Shorten(1);
}
}
开发者ID:stephengold,项目名称:gold-tiles,代码行数:33,代码来源:string.cpp
示例14: CreateList
void CreateList (List *L)
/* I.S. Sembarang */
/* F.S. Terbentuk list L kosong, dengan satu elemen dummy */
{
First(*L) = Nil;
Last(*L) = Nil;
}
开发者ID:fauzanriff,项目名称:slidingwindowprotocol,代码行数:7,代码来源:list2.c
示例15: Append
EllipseSelection::EllipseSelection (Coord x0, Coord y0, int rx, int ry,
Graphic* gs) : (gs) {
Append(new IFillEllipse(x0, y0, rx, ry));
Append(new Ellipse(x0, y0, rx, ry));
}
// EllipseSelection reads data to initialize its graphic state and
// create its filled interior and outline.
EllipseSelection::EllipseSelection (istream& from, State* state) : (nil) {
ReadGS(from, state);
Skip(from);
Coord x0, y0;
int rx, ry;
from >> x0 >> y0 >> rx >> ry;
Append(new IFillEllipse(x0, y0, rx, ry));
Append(new Ellipse(x0, y0, rx, ry));
}
// Copy returns a copy of the EllipseSelection.
Graphic* EllipseSelection::Copy () {
Coord x0, y0;
int rx, ry;
GetOriginal(x0, y0, rx, ry);
return new EllipseSelection(x0, y0, rx, ry, this);
}
// GetOriginal returns the center point and the x and y radii lengths
// that were passed to the EllipseSelection's constructor.
void EllipseSelection::GetOriginal (Coord& x0, Coord& y0, int& rx, int& ry) {
((Ellipse*) Last())->GetOriginal(x0, y0, rx, ry);
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:34,代码来源:slellipses.c
示例16: Unexecute
void MacroCmd::Unexecute () {
Iterator i;
for (Last(i); !Done(i); Prev(i)) {
GetCommand(i)->Unexecute();
}
}
开发者ID:PNCG,项目名称:neuron,代码行数:7,代码来源:macro.cpp
示例17: Last
template <class T> T *List<T>::UnlinkLast (void)
{
Node<T> *n = Last ();
if (!n)
return NULL;
n->Unlink ();
return (T *) n;
}
开发者ID:m0vie,项目名称:rarfilesource,代码行数:8,代码来源:List.cpp
示例18: S
void FName::AddToPath(char *Add)
{
String S(GetName());
NewName("");
AddString(Add);
if (Last()!='\\') *this << '\\';
AddString(S);
}
开发者ID:DavidKinder,项目名称:Level9,代码行数:8,代码来源:fname.cpp
示例19: n
void FName::NewPath(char *p)
{
String n(GetName());
Assign(p);
// force trailing "\\"
if (!Empty() && Last()!='\\') *this << '\\';
*this << n;
}
开发者ID:DavidKinder,项目名称:Level9,代码行数:8,代码来源:fname.cpp
示例20: InitWithArray
List InitWithArray(int *a, int n)
{
List L =NULL;
L = MakeEmpty(L);
for(int i = 0; i < n; i++){
Insert(a[i], L, Last(L));
}
return L;
}
开发者ID:alyadan,项目名称:answer-of-D,代码行数:9,代码来源:list.c
注:本文中的Last函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论