本文整理汇总了C++中Last函数的典型用法代码示例。如果您正苦于以下问题:C++ Last函数的具体用法?C++ Last怎么用?C++ Last使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Last函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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();
}
}
示例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());
}
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
}
示例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());
}
示例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);
}
}
示例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;
}
示例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);
}