本文整理汇总了C++中clearList函数的典型用法代码示例。如果您正苦于以下问题:C++ clearList函数的具体用法?C++ clearList怎么用?C++ clearList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clearList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Q64G
FUNCTION void Q64G(obj Q4F0, obj Q62D, int Q571)
{
int Q63U;
list metal;
clearList(metal);
Q4S8(metal, Q62D);
for(int num = numInList(metal); num > 0x00; num --)
{
int Q56Z;
obj Q5UD = metal[0x00];
int Q4Q1 = getResource(Q56Z, Q5UD, "metal", 0x03, 0x02);
if(Q571 >= Q56Z)
{
transferResources(Q4F0, Q5UD, Q56Z, "metal");
deleteObject(Q5UD);
removeItem(metal, 0x00);
Q571 = Q571 - Q56Z;
}
else
{
transferResources(Q4F0, Q5UD, Q571, "metal");
Q4Q1 = getResource(Q56Z, Q5UD, "metal", 0x03, 0x02);
if(Q56Z < 0x01)
{
deleteObject(Q5UD);
}
break;
}
}
clearList(metal);
return;
}
开发者ID:Grimoric,项目名称:UODEMO,代码行数:32,代码来源:blacksmith.m.C
示例2: clearList
Status LogReader::SetFilter(const char *a_filter, unsigned int a_filterSize,
unsigned int a_maxFindSize, bool a_raw)
{
if (a_filterSize > 0 && a_filter == InvPtr)
return s_invalidParameter;
m_filter = a_filter;
m_filterSize = a_filterSize;
clearList();
StrClose *l_strClose;
if (!a_raw)
{
StrEntry *const l_strEntry = new(std::nothrow) StrEntry;
if (l_strEntry == InvPtr)
return s_memAllocError;
l_strClose = new(std::nothrow) StrClose;
if (l_strClose == InvPtr)
{
delete l_strEntry;
return s_memAllocError;
}
addToList(l_strEntry);
}
m_status = s_ok;
machine();
if (m_status == s_ok && m_list == InvPtr)
{
Substit *const l_substit = new(std::nothrow) Substit(0, true);
if (l_substit == InvPtr)
m_status = s_memAllocError;
else
addToList(l_substit);
}
if (m_status != s_ok)
{
delete l_strClose;
clearList();
}
else
{
if (!a_raw)
addToList(l_strClose);
m_raw = a_raw;
m_maxFindSize = a_maxFindSize;
reset();
}
return m_status;
}
开发者ID:rasim-valiullin,项目名称:d512388b-9b91-45f9-8f88-b6d4e252c270,代码行数:60,代码来源:logreader.cpp
示例3: QWidget
DownloadManager::DownloadManager(QWidget* parent)
: QWidget(parent)
, ui(new Ui::DownloadManager)
, m_isClosing(false)
, m_lastDownloadOption(NoOption)
{
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
ui->setupUi(this);
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
QtWin::extendFrameIntoClientArea(this);
}
#endif
ui->clearButton->setIcon(QIcon::fromTheme("edit-clear"));
QzTools::centerWidgetOnScreen(this);
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearList()));
QShortcut* clearShortcut = new QShortcut(QKeySequence("CTRL+L"), this);
connect(clearShortcut, SIGNAL(activated()), this, SLOT(clearList()));
loadSettings();
QzTools::setWmClass("Download Manager", this);
#ifdef W7TASKBAR
if (QtWin::isRunningWindows7()) {
win7.init(QtWin::hwndOfWidget(this));
}
#endif
}
开发者ID:JandunCN,项目名称:qupzilla,代码行数:31,代码来源:downloadmanager.cpp
示例4: clearList
ResourceLoader::~ResourceLoader() {
for (Common::Array<ResourceCache>::iterator i = _cache.begin(); i != _cache.end(); ++i) {
ResourceCache &r = *i;
delete[] r.fname;
delete[] r.resPtr;
}
clearList(_models);
clearList(_colormaps);
clearList(_keyframeAnims);
clearList(_lipsyncs);
}
开发者ID:salty-horse,项目名称:residualvm,代码行数:11,代码来源:resource.cpp
示例5: clearList
void LLFloaterTopObjects::onRefresh()
{
U32 mode = STAT_REPORT_TOP_SCRIPTS;
U32 flags = 0;
std::string filter = "";
mode = mCurrentMode;
flags = mFlags;
filter = mFilter;
clearList();
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LandStatRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->nextBlockFast(_PREHASH_RequestData);
msg->addU32Fast(_PREHASH_ReportType, mode);
msg->addU32Fast(_PREHASH_RequestFlags, flags);
msg->addStringFast(_PREHASH_Filter, filter);
msg->addS32Fast(_PREHASH_ParcelLocalID, 0);
msg->sendReliable(gAgent.getRegionHost());
mFilter.clear();
mFlags = 0;
}
开发者ID:Xara,项目名称:Astra-Viewer-2,代码行数:27,代码来源:llfloatertopobjects.cpp
示例6: list_node_test
/* List Node Test function */
void list_node_test(void)
{
Node_t *pList = NULL;
elemType data[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
elemType *ret_data;
initList(&pList);
pList = createList(pList, data, 10L);
printList(pList);
lk_print("The size of pList: %ld.\n", sizeList(pList));
lk_print("getElement(pList, 4) = %d.\n", getElement(pList, 4));
ret_data = getDataFromList(pList, 4);
lk_print("ret_data[4] = %d.\n", *ret_data);
setDataByPosition(pList, 4, 0);
printList(pList);
insertHeadNode(&pList, 9);
lk_print("The size of pList: %ld.\n", sizeList(pList));
printList(pList);
insertLastNode(&pList, 0);
printList(pList);
lk_print("The size of pList: %ld.\n", sizeList(pList));
insertNodeByPosition(&pList, 14, 8);
printList(pList);
deleteNodeByPosition(&pList, 12);
printList(pList);
swapTwoNodeElemInList(&pList, 10, 10);
printList(pList);
clearList(pList);
lk_print("done\n");
}
开发者ID:nkymey,项目名称:learning_note,代码行数:31,代码来源:single_list_node_ops.c
示例7: main
/**********************************************************
* main: Prompts the user to enter an operation code, *
* then calls a function to perform the requested *
* action. Repeats until the user enters the *
* command 'q'. Prints an error message if the user *
* enters an illegal code. *
**********************************************************/
int main(void)
{
char code;
struct player *team_roster = NULL;
printf("Operation Code: a for appending to the roster, d for deleteing a player, f for finding a player"
", p for printing the roster; q for quit.\n");
for (;;) {
printf("Enter operation code: ");
scanf(" %c", &code);
while (getchar() != '\n') /* skips to end of line */
;
switch (code) {
case 'a': team_roster = append_to_list(team_roster);
break;
case 'f': find_player(team_roster);
break;
case 'p': printList(team_roster);
break;
case 'd': delete_from_list(team_roster);
break;
case 'q': clearList(team_roster);
printf("\n");
return 0;
default: printf("Illegal code");
}
printf("\n");
}
}
开发者ID:Darksole,项目名称:class-projects,代码行数:36,代码来源:roster.c
示例8: clearList
void MainWindow::newListTriggerred()
{
if (this->modified.isModified() && promptForSaving() && promptForFilename() && !save()) {
return;
}
clearList();
}
开发者ID:Folcogh,项目名称:SC2Metro,代码行数:7,代码来源:MainWindow.cpp
示例9: main
void main()
{
int a[10] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};
int i;
struct List L;
initList(&L, 5);
for(i = 0; i < 10; i++){
insertLastList(&L, a[i]);
}
insertPosList(&L, 11, 48); insertPosList(&L, 1, 64);
printf("%d ", getElem(&L, 1));
traverseList(&L);
printf("%d ", findList(&L, 10));
updatePosList(&L, 3, 20);
printf("%d ", getElem(&L, 3));
traverseList(&L);
deleteFirstList(&L); deleteFirstList(&L);
deleteLastList(&L); deleteLastList(&L);
deletePosList(&L, 5); ;deletePosList(&L, 7);
printf("%d ", sizeList(&L));
printf("%d ", emptyList(&L));
traverseList(&L);
clearList(&L);
return 0;
}
开发者ID:xhbang,项目名称:algorithms,代码行数:25,代码来源:merge-list.cpp
示例10: clearList
//读数据转化文件,生成转换列表
int CGateCmdHandler::init(void)
{
char fileName[256] = {0};
char fileDir[256] = {0};
char processName[256] = {0};
FILE* p_file = NULL;
char szExp[1024] = {0};
clearList();
if (getExePath(fileDir, processName, 256))
return -1;
sprintf(fileName, "%s/%s", fileDir, FILE_DATA_TRANS);
p_file = fopen(fileName, "r");
if (!p_file)
return -1;
while (fgets(szExp, 1024, p_file)) {
if (addExpression(szExp)) {
fclose(p_file);
return -1;
}
}
fclose(p_file);
return 0;
}
开发者ID:qzluo,项目名称:webConfig,代码行数:31,代码来源:gateCmdHandler.cpp
示例11: TRIGGER
TRIGGER( use )(obj user)
{
obj player = user;
if(!hasObjVar(this, "bountyPlayer"))
{
systemMessage(user, "Select player to bounty:");
targetObj(user, this);
return(0x00);
}
string Q5IU = "PD BugKiller";
if(hasObjVar(this, "bountyPlayerName"))
{
Q5IU = getObjVar(this, "bountyPlayerName");
}
systemMessage(user, "creating bounty for (" + objtoint(player) + ".");
obj bountyInfo = createNoResObjectAt(0x01, getLocation(user));
setObjVar(bountyInfo, "subject", player);
attachScript(bountyInfo, "bountyinfo");
list args = list( player, 0x029A, 0x00, Q5IU );
message(bountyInfo, "addBounty", args);
int Q4Q1 = teleport(bountyInfo, getRelayLoc(player));
if(isValid(bountyInfo))
{
clearList(args);
message(bountyInfo, "teleported", args);
}
args = list( getAdjFame(user) );
systemMessage(user, "MurderReport: Messaging via probe to " + objtoint(user) + ".");
Q56V(player, "murderReport", args);
obj head = createNoResObjectIn(0x1DA0, getBackpack(user));
setObjVar(head, "nameVar", Q5IU);
setObjVar(head, "controller", player);
return(0x00);
}
开发者ID:Grimoric,项目名称:UODEMO,代码行数:34,代码来源:bountytest.m.C
示例12: clearQueue
CSyncQueue::~CSyncQueue()
{
clearQueue();
clearList();
DeleteCriticalSection(&this->wQueue);
DeleteCriticalSection(&this->dList);
}
开发者ID:KagamiChan,项目名称:RapidCRC-Unicode,代码行数:7,代码来源:CSyncQueue.cpp
示例13: XOJ_CHECK_TYPE
ToolbarEntry::~ToolbarEntry() {
XOJ_CHECK_TYPE(ToolbarEntry);
clearList();
XOJ_RELEASE_TYPE(ToolbarEntry);
}
开发者ID:wbrenna,项目名称:xournalpp,代码行数:7,代码来源:ToolbarEntry.cpp
示例14: QWidget
DownloadManager::DownloadManager(QWidget* parent)
: QWidget(parent)
, ui(new Ui::DownloadManager)
, m_isClosing(false)
{
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
ui->setupUi(this);
#ifdef Q_WS_WIN
if (QtWin::isCompositionEnabled()) {
QtWin::extendFrameIntoClientArea(this);
}
#endif
ui->clearButton->setIcon(QIcon::fromTheme("edit-clear"));
qz_centerWidgetOnScreen(this);
m_networkManager = mApp->networkManager();
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearList()));
loadSettings();
#ifdef W7TASKBAR
if (QtWin::isRunningWindows7()) {
win7.init(this->winId());
}
#endif
}
开发者ID:srazi,项目名称:qupzilla,代码行数:27,代码来源:downloadmanager.cpp
示例15: main
/**********************************************************
* main: Prompts the user to enter an operation code, *
* then calls a function to perform the requested *
* action. Repeats until the user enters the *
* command 'q'. Prints an error message if the user *
* enters an illegal code. *
**********************************************************/
int main(void)
{
char code;
struct part *inv = NULL; /* points to first part */
for (;;) {
printf("Enter operation code: ");
scanf(" %c", &code);
while (getchar() != '\n') /* skips to end of line */
;
switch (code) {
case 'i': inv = insert(inv);
break;
case 's': search(inv);
break;
case 'u': update(inv);
break;
case 'p': print(inv);
break;
case 'q':
clearList(inv);
return 0;
default: printf("Illegal code\n");
}
printf("\n");
}
}
开发者ID:drod2169,项目名称:ProgramDesign,代码行数:34,代码来源:inventory2_linkedlist.c
示例16: clearList
/*virtual*/
_TDL_NamesList::~_TDL_NamesList()
{
/* Clear the arraylist */
/* Note: This can't happen in _TDL_ArrayList since that base
* class can't access _TDL_NamesList's version of deleteElement().
*/
clearList();
}
开发者ID:guillep19,项目名称:frob,代码行数:9,代码来源:_TDL_NamesList.C
示例17: clearList
void AstarPathfinding::getPath(float srcX, float srcY, float destX, float destY, PointList_t &path){
///init
this->srcP.x = srcX;
this->srcP.y = srcY;
this->destP.x = destX;
this->destP.y = destY;
clearList(path);
clearList(openedList);
clearList(closedList);
///set the first point
currentP = new Point_t();
currentP->x = srcX;
currentP->y = srcY;
currentP->costa = 0.f;
currentP->costb = (destX - srcX)*(destX - srcX) + (destY - srcY)*(destY - srcY);
currentP->totalcost = currentP->costa + currentP->costb;
openedList.push_back(currentP);
///perform
while(!openedList.empty() && !(currentP->x == destX && currentP->y == destY) ){
//std::cout << "currentP = " << currentP->x << "; " << currentP->y << "\n";
openedList.remove(currentP);
closedList.push_back(currentP);
perform();
currentP = getBest();
}
///return result
if(currentP != NULL && currentP->x == destX && currentP->y == destY){
do{
Point_t* p = new Point_t();
p->x = currentP->x;
p->y = currentP->y;
path.push_front(p);
currentP = currentP->previous;
}while(currentP != NULL);
}
clearList(openedList);
clearList(closedList);
}
开发者ID:whztt07,项目名称:ImpGears,代码行数:46,代码来源:AstarPathfinding.cpp
示例18: detachDocument
void detachDocument() {
if (!m_document)
return;
clearList();
m_document->undoHistory()->removeObserver(this);
m_document = nullptr;
}
开发者ID:ripesunflower,项目名称:aseprite,代码行数:8,代码来源:cmd_undo_history.cpp
示例19: Q4S8
FUNCTION void Q4S8(list metal, obj Q57Q)
{
clearList(metal);
for(int Q572 = 0x1BEF; Q572 <= 0x1BF4; Q572 ++)
{
getObjectsOfTypeIn(metal, Q57Q, Q572);
}
return;
}
开发者ID:Grimoric,项目名称:UODEMO,代码行数:9,代码来源:blacksmith.m.C
示例20: clearList
void
McGripOptimizer::reset()
{
clearList(JTD_negI_list);
clearList(NegB_list);
clearList(GO_list);
clearList(FO_list);
clearList(SO_list);
clearList(Th_list);
clearList(lowerBounds_list);
clearList(upperBounds_list);
}
开发者ID:HumanoidRobotics,项目名称:graspit,代码行数:12,代码来源:eigenTorques.cpp
注:本文中的clearList函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论