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


C++ UList::Next方法代码示例

本文整理汇总了C++中UList::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ UList::Next方法的具体用法?C++ UList::Next怎么用?C++ UList::Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UList的用法示例。


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

示例1: Sort

void Selection::Sort (GraphicView* views) {
/*
 * Note: this doesn't work if there are views in the selection from more than
 * one GraphicViews.
 */
    Iterator i;
    UList* cur;
    UList* newList = new UList;

    views->First(i);

    while (!views->Done(i) && !_ulist->IsEmpty()) {
        cur = _ulist->First();

        while (cur != _ulist->End()) {
            if (views->GetView(i) == View(cur)) {
                _ulist->Remove(cur);
                newList->Append(cur);
                break;
            } else {
                cur = cur->Next();
            }
        }
        views->Next(i);
    }
    if (!_ulist->IsEmpty()) {
        cerr << "warning: selection contained spurious element(s)\n";
    }
    delete _ulist;
    _ulist = newList;
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:31,代码来源:selection.c

示例2: ConstProcs

void PostScriptView::ConstProcs (ostream& out) {
    UList* fonts = GetPSFonts();
    int nfonts = Count(fonts);

    out << "/IdrawDict " << (50 + nfonts) << " dict def\n";
    out << "IdrawDict begin\n\n";

    if (nfonts > 0) {
	for (const char** line = reencodeISO; *line != nil; ++line) {
	    out << *line << "\n";
	}

	for (UList* u = fonts->First(); u != fonts->End(); u = u->Next()) {
	    PSFont* font = GetFont(u);

	    // No way to check if the X font's encoding is iso8859-1, so...
	    if (strncmp(font->GetPrintFont(), "Symbol", 6) != 0) {
		out << "/" << font->GetPrintFont() << " reencodeISO def\n";
	    } else {
		out << "/" << font->GetPrintFont() << " dup findfont def\n";
	    }
	}
	out << "\n";
    }

    out << "/none null def\n";
    out << "/numGraphicParameters 17 def\n";
    out << "/stringLimit 65535 def\n\n";
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:29,代码来源:psview.c

示例3: Count

static int Count (UList* list) {
    int i = 0;

    for (UList* u = list->First(); u != list->End(); u = u->Next()) {
        ++i;
    }
    return i;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:8,代码来源:psview.c

示例4: Uncollected

static boolean Uncollected (const char* name, UList* fonts) {
    for (UList* u = fonts->First(); u != fonts->End(); u = u->Next()) {
        PSFont* font = (PSFont*) (*u)();

        if (strcmp(font->GetPrintFont(), name) == 0) {
            return false;
        }
    }
    return true;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:10,代码来源:psview.c

示例5: FindView

OverlayView* OverlayComp::FindView (Viewer* viewer) {
    if (!_views) return nil;
    for (UList* u = _views->First(); u != _views->End(); u = u->Next()) {
	ComponentView* compview = View(u);
	if (compview->IsA(OVERLAY_VIEW) && 
	    ((OverlayView*)compview)->GetViewer() == viewer) 
	    return (OverlayView*)compview;
    }
    return nil;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:10,代码来源:ovcomps.c

示例6: Find

UHashElem* UHashTable::Find (void* key) {
    int n = Hash(key);
    UList* slot = _slot[n];

    if (slot != nil) {
        for (UList* u = slot->First(); u != slot->End(); u = u->Next()) {
            UHashElem* elem = Elem(u);

            if (Equal(elem->GetKey(), key)) {
                return elem;
            }
        }
    }
    return nil;
}
开发者ID:PNCG,项目名称:neuron,代码行数:15,代码来源:uhash.cpp

示例7: Copy

Component* DrawIdrawComp::Copy () {
    DrawIdrawComp* comps = new DrawIdrawComp(GetPathName());
    if (attrlist()) comps->SetAttributeList(new AttributeList(attrlist()));
    Iterator i;
    First(i);
    while (!Done(i)) {
	comps->Append((GraphicComp*)GetComp(i)->Copy());
	Next(i);
    }
    for (UList* u = _graphedges->First(); u != _graphedges->End(); u = u->Next()) {
      EdgeComp* edgecomp = (EdgeComp*) (*u)();
      comps->AppendEdge(edgecomp);
    }
    return comps;
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:15,代码来源:drawcomps.c

示例8: make_pts

MultiLineObj* MultiLineObj::make_pts (const Coord* x, const Coord* y, int npts) {
    if (!_pts_by_n_enabled) {
        Coord *copyx, *copyy;
	ArrayDup(x, y, npts, copyx, copyy);
	MultiLineObj* mlo = new MultiLineObj(copyx, copyy, npts);
	mlo->_pts_made = 1;
	return mlo;
    }

    if (!_pts_by_n) {
	_pts_by_n = new UList*[_pts_by_n_size];
	for (int i=0; i<_pts_by_n_size; i++) 
	    _pts_by_n[i] = nil;
    }
    if (npts>=_pts_by_n_size) {
	int new_size = max(_pts_by_n_size*2, npts+1);
	UList** new_pts_by_n = new UList*[new_size];
	int i = 0;
	for (;i<_pts_by_n_size; i++) 
	    new_pts_by_n[i] = _pts_by_n[i];
	for (;i<new_size; i++) 
	    new_pts_by_n[i] = nil;
	delete _pts_by_n;
	_pts_by_n = new_pts_by_n;
	_pts_by_n_size = new_size;
    }

    if (_pts_by_n[npts]) {

	MultiLineObj temp_mlo((int*)x, (int*)y, npts);
	UList* ptr = _pts_by_n[npts]->First();
	while (ptr != _pts_by_n[npts]->End()) {
	    if (*(MultiLineObj*)(*ptr)() == temp_mlo) 
		return (MultiLineObj*)(*ptr)();
	    ptr = ptr->Next();
	}
    } else 
	_pts_by_n[npts] = new UList();
    
    Coord *copyx, *copyy;
    ArrayDup(x, y, npts, copyx, copyy);
    MultiLineObj* mlo = new MultiLineObj(copyx, copyy, npts);
    _pts_by_n[npts]->Append(mlo->_ulist = new UList(mlo));
    return mlo;
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:45,代码来源:geomobjs.c

示例9: Interpret

void OverlayComp::Interpret(Command* cmd) {
    Editor* ed = cmd->GetEditor();

    if (cmd->IsA(UNHIDE_VIEWS_CMD) || cmd->IsA(SENSITIZE_VIEWS_CMD)) {
	for (UList* u = _views->First(); u != _views->End(); u = u->Next()) {
	    ComponentView* compview = View(u);
	    if (compview->IsA(OVERLAY_VIEW)) {
		((OverlayView*)compview)->Sensitize();
		if (cmd->IsA(UNHIDE_VIEWS_CMD))
		  ((OverlayView*)compview)->Show();
	    }
	}
	Notify();
	
    } else {
      GraphicComp::Interpret(cmd);
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:18,代码来源:ovcomps.c

示例10: Next

void UHashTable::Next (Iterator& i) {
    UHashElem* elem = GetElem(i);

    if (elem != nil) {
        int n = Hash(elem->GetKey());
        UList* u = UElem(i);
        u = u->Next();

        if (u == _slot[n]->End()) {
            for (int j = n+1; j < _nslots; ++j) {
                if (_slot[j] != nil) {
                    u = _slot[j]->First();
                    break;
                }
            }
        }
        i.SetValue(u);
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:19,代码来源:uhash.cpp

示例11: Retransmit

void Connector::Retransmit (Path* path) {
    if (path->Visited(this)) {
        return;
    }
    boolean forking = _cnxns->First() != _cnxns->Last(); // fork if > 1 cnxn
    path->Visit(this);
    
    for (UList* u = _cnxns->First(); u != _cnxns->End(); u = u->Next()) {
        Connector* peer = Conn(u);

        if (!path->Visited(peer)) {
            if (forking) {
                Path fork(path);
                Retransmit(peer, &fork);
            } else {
                Retransmit(peer, path);
            }
        }
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:20,代码来源:connector.c

示例12: FontNames

void PostScriptView::FontNames (ostream& out) {
    UList* fonts = GetPSFonts();
    const char* comment = "%%DocumentFonts:";
    int linelen = strlen(comment);
    out << comment;

    for (UList* u = fonts->First(); u != fonts->End(); u = u->Next()) {
	PSFont* font = GetFont(u);

	if (linelen + strlen(font->GetPrintFont()) + 2 <= MAXLINELEN) {
	    out << " ";
	    ++linelen;
	} else {
	    out << "\n%%+ ";
	    linelen = strlen("%%+ ");
	}
	out << font->GetPrintFont();
	linelen += strlen(font->GetPrintFont());
    }
    out << "\n";
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:21,代码来源:psview.c

示例13: Unregister

void UHashTable::Unregister (void* key) {
    int n = Hash(key);
    UList* slot = _slot[n];

    if (slot != nil) {
        for (UList* u = slot->First(); u != slot->End(); u = u->Next()) {
            UHashElem* elem = Elem(u);

            if (Equal(elem->GetKey(), key)) {
                slot->Remove(u);
                delete elem;
                delete u;

		if (_slot[n]->IsEmpty()) {
		    delete _slot[n];
		    _slot[n] = nil;
		}
                break;
            }
        }
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:22,代码来源:uhash.cpp

示例14: Notify

void Component::Notify () {
    for (UList* u = _views->First(); u != _views->End(); u = u->Next()) {
	View(u)->Update();
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:5,代码来源:component.c

示例15: Notify

void StateVar::Notify () {
    for (UList* v = _views->First(); v != _views->End(); v = v->Next()) {
        view(v)->Update();
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:5,代码来源:statevar.c


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