• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddTail函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AddTail函数的典型用法代码示例。如果您正苦于以下问题:C++ AddTail函数的具体用法?C++ AddTail怎么用?C++ AddTail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: sort_list

void sort_list(Att_List *input_list)
{
 struct Node *node,*tmpnode,*next_node;
struct List *list,sorted;

list=&input_list->list;

if	(list && !IsListEmpty(list))
	{
	NewList(&sorted);

	while	((node=(struct Node*)(list->lh_Head)) && list->lh_Head->ln_Succ!=NULL) /* list not empty!*/
		{
		tmpnode=node;
		while	((next_node=node->ln_Succ))
			{
			if	(stricmp(tmpnode->ln_Name,node->ln_Name)>0)
				tmpnode=node;

			node=next_node;
			}
		Remove(tmpnode);
		AddTail(&sorted,tmpnode);
		}

	while	((node=sorted.lh_Head) && sorted.lh_Head->ln_Succ!=NULL) /* list not empty!*/
		{
		Remove(node);
		AddTail(list,node);
		}
	}
}
开发者ID:timofonic,项目名称:dopus5allamigas,代码行数:32,代码来源:ftp_addrsupp.c


示例2: AddTail

void CPTRList::InsertAfter( int n,void *pData)
{
	if ( n<0 )	
	{
		AddTail(pData);
		return ;
	}
	if ( n==GetCount()-1)	
	{
		AddTail(pData);
		return;
	}
	
	GetAt(n);
	nCurrent	= -1;

	PTR_BLK *pNew	= new PTR_BLK;
	pNew->pData		= pData;
	pNew->pPrev		= pCur;
	pNew->pNext		= pCur->pNext;

	pCur->pNext->pPrev	= pNew;
	pCur->pNext		= pNew;
	nMax++;
}
开发者ID:dalek7,项目名称:umbrella,代码行数:25,代码来源:PTRList.cpp


示例3: al

DWORD LStrList::LoadFromFile(LTxtFile* tf, BOOL bIncludeNull)
{
    LAutoLock al(m_lock);

    // 如果列表为空,则按照来源文件编码
    if (LPtrList::IsEmpty())
    {
        m_dwFlags = 0;
        if (tf->IsUnicode())
        {
            m_dwFlags = SLFLAG_UNICODE;
            m_pfnCopy = LStrList_CopyW;
            m_pfnDestroy = LStrList_DestroyW;
        }
        else
        {
            m_pfnCopy = LStrList_CopyA;
            m_pfnDestroy = LStrList_DestroyA;
        }
    }

    DWORD ret = 0;
    if (IsUnicode())
    {
        LStringW str;
        while (!tf->Eof())
        {
            tf->ReadLn(&str);
            if ((L'\0' != str[0]) || bIncludeNull)
            {
                AddTail(str);
                ++ret;
            }
        }
    }
    else
    {
        LStringA str;
        while (!tf->Eof())
        {
            tf->ReadLn(&str);
            if (('\0' != str[0]) || bIncludeNull)
            {
                AddTail(str);
                ++ret;
            }
        }
    }
    return ret;
}
开发者ID:lvtx,项目名称:pdl-titilima,代码行数:50,代码来源:strlist.cpp


示例4: ASSERT_VALID

void CStringList::Serialize(CArchive& ar)
{
    ASSERT_VALID(this);

    CObject::Serialize(ar);

    if (ar.IsStoring())
    {
        ar << (WORD) m_nCount;
        for (CNode* pNode = m_pNodeHead; pNode != NULL; pNode = pNode->pNext)
        {
            ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
            ar << pNode->data;
        }
    }
    else
    {
        WORD nNewCount;
        ar >> nNewCount;

        CString newData;
        while (nNewCount--)
        {
            ar >> newData;
            AddTail(newData);
        }
    }
}
开发者ID:shuowen,项目名称:OpenNT,代码行数:28,代码来源:list_s.cpp


示例5: URLHistoryFound

static bool URLHistoryFound(const char *url, const struct url_data *data)
{
	struct Node *node;

	/* skip this URL if it is already in the list */
	if(URLHistory_FindPage(url)) return true;

	node = AllocVec( sizeof( struct Node ), MEMF_SHARED|MEMF_CLEAR );

	if ( node )
	{
		STRPTR urladd = (STRPTR) AllocVec( strlen ( url ) + 1, MEMF_SHARED|MEMF_CLEAR );
		if ( urladd )
		{
			strcpy(urladd, url);
			node->ln_Name = urladd;
			AddTail( &PageList, node );
		}
		else
		{
			FreeVec(node);
		}
	}
	return true;
}
开发者ID:MarkieMark,项目名称:netsurf-git-svn,代码行数:25,代码来源:urlhistory.c


示例6: _MEMTRACK

///
/// _MEMTRACK
// add a new node to the memory tracking lists
void _MEMTRACK(const char *file, const int line, const char *func, void *ptr, size_t size)
{
  if(isFlagSet(debug_classes, DBC_MTRACK))
  {
    if(ptr != NULL && size != 0)
    {
      struct DbgMallocNode *dmn;

      if((dmn = AllocVec(sizeof(*dmn), MEMF_ANY)) != NULL)
      {
        dmn->memory = ptr;
        dmn->size = size;
        dmn->file = file;
        dmn->line = line;
        dmn->func = func;

        ObtainSemaphore(&DbgMallocListSema);

        AddTail((struct List *)&DbgMallocList[ptr2hash(ptr)], (struct Node *)&dmn->node);
        DbgMallocCount++;

        ReleaseSemaphore(&DbgMallocListSema);
      }
    }
    else
      _DPRINTF(DBC_WARNING, DBF_ALWAYS, file, line, "potential invalid %s call with return (0x%08lx, 0x%08lx)", func, ptr, size);
  }
}
开发者ID:amiga-mui,项目名称:texteditor,代码行数:31,代码来源:Debug.c


示例7: switch

CRecord CRecord::operator =(ARFieldValueList &fieldList)
{
	ARFieldValueStruct *pFieldValuePair = fieldList.fieldValueList; // working pointer
	CFieldValuePair FieldValuePair; // working field value pair
	CString workingString; // working string to convert value

	// Loop once for each field/value pair in the list
	for(UINT i=0; i<fieldList.numItems; i++, pFieldValuePair++)
	{
		// decode the field/value pair
		FieldValuePair.uiFieldId = pFieldValuePair->fieldId; // save field id
		FieldValuePair.uiType = pFieldValuePair->value.dataType; // save data type
		switch(pFieldValuePair->value.dataType) // convert the value based on data type
		{
		case AR_DATA_TYPE_NULL:
			workingString.Empty();
			break;
		case AR_DATA_TYPE_INTEGER:
		case AR_DATA_TYPE_TIME:
		case AR_DATA_TYPE_DATE:
		case AR_DATA_TYPE_TIME_OF_DAY:
		case AR_DATA_TYPE_KEYWORD:
		case AR_DATA_TYPE_BITMASK:
			workingString.Format("%d", pFieldValuePair->value.u.intVal);
			break;
		case AR_DATA_TYPE_REAL:
			workingString.Format("%e", pFieldValuePair->value.u.realVal);
			break;
		case AR_DATA_TYPE_CHAR:
		case AR_DATA_TYPE_DIARY:
		case AR_DATA_TYPE_DECIMAL:
			workingString = pFieldValuePair->value.u.charVal;
			break;
		case AR_DATA_TYPE_ENUM:
			workingString.Format("%u", pFieldValuePair->value.u.enumVal);
			break;
		case AR_DATA_TYPE_ATTACH:
			workingString = FieldValuePair.StoreAttachment(pFieldValuePair->value.u.attachVal);
			break;
		case AR_DATA_TYPE_CURRENCY:
			workingString = FieldValuePair.StoreCurrency(pFieldValuePair->fieldId,
														 pFieldValuePair->value.u.currencyVal);
			break;
		default:
			workingString.Empty();
			ThrowARSException(UNKNOWN_DATA_TYPE, "CRecord::operator=()");
			break;
		} // end switch
		
		// decode attachement fields

		// decode currency fields
		FieldValuePair.Value = workingString; // save the decoded value

		AddTail(FieldValuePair); // Add the field/value pair
	} // end for
	
	// return the populated record
	return *this;
}
开发者ID:mellertson,项目名称:ARExplorer,代码行数:60,代码来源:Record.cpp


示例8: ASSERT_VALID

void CObList::Serialize(CArchive& ar)
{
	ASSERT_VALID(this);

	CObject::Serialize(ar);

	if (ar.IsStoring())
	{
		ar.WriteCount(m_nCount);
		for (CNode* pNode = m_pNodeHead; pNode != NULL; pNode = pNode->pNext)
		{
			ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
			ar << pNode->data;
		}
	}
	else
	{
		DWORD_PTR nNewCount = ar.ReadCount();
		CObject* newData;
		while (nNewCount--)
		{
			ar >> newData;
			AddTail(newData);
		}
	}
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:26,代码来源:list_o.cpp


示例9: addfile

/**
*
* Add a filename to a list.
*
**/
void addfile(char *name)
{
  FileNode *filenode = (FileNode *)malloc(sizeof(FileNode) + strlen(name));

  strcpy(filenode->name, name);
  AddTail(&filelist, &filenode->node);
}
开发者ID:jamjr,项目名称:Helios-NG,代码行数:12,代码来源:tiddles.c


示例10: L_AddSorted

void LIBFUNC L_AddSorted(
	REG(a0, struct List *list),
	REG(a1, struct Node *node))
{
	struct Node *posnode,*lastnode=0;
	BOOL added=0;

	// Go through existing nodes
	for (posnode=list->lh_Head;
		posnode->ln_Succ;
		lastnode=posnode,posnode=posnode->ln_Succ)
	{
		// Compare new node name against existing name
		if ((stricmp(node->ln_Name,posnode->ln_Name))<=0)
		{
			// Insert into list
			Insert(list,node,lastnode);
			added=1;
			break;
		}
	}

	// If not added, add to end of list
	if (!added) AddTail(list,node);
}
开发者ID:timofonic,项目名称:dopus5allamigas,代码行数:25,代码来源:list_management.c


示例11: CheckFractalBitmap

BOOL GlobalFractalList::AddFractal(FillGeometryAttribute* NewFractal)
{
	CachedFractal* ExistingFrac = CheckFractalBitmap(NewFractal);

	if (ExistingFrac != NULL)
	{
		ExistingFrac->IncUsageCount();
		return FALSE;
	}

	CachedFractal* Fractal = new CachedFractal();

	if (Fractal == NULL)
		return FALSE;

	TRACEUSER( "Mike", _T("Adding Cached Fractal @ %x\n"),Fractal);

	Fractal->SetCachedFractal(NewFractal);
	Fractal->IncUsageCount();

	AddTail((ListItem*)Fractal);

	if (this != GetApplication()->GetGlobalFractalList())
		Fractal->MakeFakeFractal();

	TRACEUSER( "Mike", _T("Cached Fractal Count = %d\n"),GetFractalCacheCount());
	TRACEUSER( "Mike", _T("Cached Fractal Size  = %d\n"),GetFractalCacheSize());

	return(TRUE);
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:30,代码来源:fraclist.cpp


示例12: RemoveAll

CFormList & CFormList::operator =(CFormList &newList)
{
	RemoveAll();
	AddTail(&newList);

	return *this;
}
开发者ID:mellertson,项目名称:ARExplorer,代码行数:7,代码来源:FormList.cpp


示例13: FreeARNameList

/////////////////////////////////////////////////////////////////////
// Fills the list with all the form names on the server
void CFormList::GetForms(CARSConnection &arsConnection, unsigned int uiType)
{
	ARStatusList statusList;
	ARNameList nameList;	// list of form names
	ARNameType *pNameType; // pointer to a single form name
	unsigned int i = 0;

	// get the list of form names
	if(ARGetListSchema(&arsConnection.LoginInfo,
					   0, // change since
					   uiType, // form type to get
					   NULL, // name of uplink/downlink form
					   NULL, // id list of fields to qualify forms retrieved
					   &nameList, // return value, the list of form names
					   &statusList) > AR_RETURN_OK)
	{
		FreeARNameList(&nameList, FALSE);
		ThrowARSException(statusList, "CFormList::GetForms()");
	}
	FreeARStatusList(&statusList, FALSE);

	CString strFormName;
	for(i=0, pNameType = nameList.nameList; 
		i < nameList.numItems; 
		i++, pNameType++)
	{
		strFormName = (char*)pNameType;
		AddTail(strFormName);
	}

	// Free heap memory
	FreeARNameList(&nameList, FALSE);
}
开发者ID:mellertson,项目名称:ARExplorer,代码行数:35,代码来源:FormList.cpp


示例14: add_popup_ext

// Add PopUp extensions
void add_popup_ext(char *menu,Att_List *type_list,char *command,ULONG flags)
{
	Att_Node *node;

	// Go through menu list
	for (node=(Att_Node *)type_list->list.lh_Head;
		node->node.ln_Succ;
		node=(Att_Node *)node->node.ln_Succ)
	{
		Cfg_Filetype *ftype=0;
		ULONG type=0;
		short a;

		// No name?
		if (!node->node.ln_Name) continue;

		// Special type?
		for (a=0;icon_types[a];a++)
		{
			// Compare string
			if (stricmp(node->node.ln_Name,icon_types[a])==0)
			{
				// All?
				if (a==0) type=POPUP_ALL;
				else type=a;
				break;
			}
		}

		// Search filetypes?
		if (!type)
		{
			// Try to find filetype
			if (!(ftype=filetype_find(node->node.ln_Name,1)))
				ftype=filetype_find(node->node.ln_Name,0);
		}

		// Got something to match on?
		if (type || ftype)
		{
			PopUpExt *ext;

			// Allocate PopUpExtension
			if ((ext=AllocMemH(global_memory_pool,sizeof(PopUpExt))))
			{
				// Fill it out
				ext->pe_Type=type;
				if (ftype) stccpy(ext->pe_FileType,ftype->type.name,sizeof(ext->pe_FileType));
				stccpy(ext->pe_Command,command,40);
				stccpy(ext->pe_Menu,menu,40);
				ext->pe_Flags=flags;

				// Lock list and add new entry
				lock_listlock(&GUI->popupext_list,TRUE);
				AddTail(&GUI->popupext_list.list,(struct Node *)ext);
				unlock_listlock(&GUI->popupext_list);
			}
		}
	}
}
开发者ID:timofonic,项目名称:dopus5allamigas,代码行数:61,代码来源:popup.c


示例15: gptimer1_handler

void gptimer1_handler(int id) {
	uint32_t irq = reg32r(GPTIMER1_BASE, GPT_TISR);

	{
		static int blink = 0;

		if (blink & (1<<2)) {
			LEDS_OFF(LED0);
			LEDS_ON(LED1);
		} else {
			LEDS_ON(LED0);
			LEDS_OFF(LED1);
		}
		blink++;
	}

	// check for overflow int
	if (irq & OVF_IT_FLAG) {
		Remove(&thistask->Node);
		AddTail(&tasks, &thistask->Node);

		thistask = (struct task *)tasks.Head;
		irq_new_task(tcb_to_sp(&thistask->tcb));
	}

	// clear ints
	reg32w(GPTIMER1_BASE, GPT_TISR, ~0);
}
开发者ID:corywalker,项目名称:puppybits,代码行数:28,代码来源:irq-timer.c


示例16: AddRecord

BOOL CPtrListExt :: AddRecord (COleVariant varBookmark, const char *pAbfallArt, BOOL bFirst/* = TRUE*/)
{
	ASSERT (NULL != pAbfallArt && AfxIsValidString (pAbfallArt));
	ASSERT (*pAbfallArt);

	try
	{
		CString strArt (pAbfallArt);
		CRecordInfo *pInfo = new CRecordInfo (strArt, varBookmark);
		AddTail (pInfo);					

	//	ggf. als 1. Satz setzen
		if (bFirst)
			return SetFirstRecord (varBookmark);

		return TRUE;
	}
	catch (CDaoException *e)
	{
		:: DisplayDaoException (e);
		e -> Delete ();
	}
	catch (CException *e)
	{
		e -> ReportError ();
		e -> Delete ();
	}

	return FALSE;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:30,代码来源:Abfset.cpp


示例17: ASSERT_VALID

POSITION CPtrList::InsertAfter(POSITION position, void* newElement)
{

	ASSERT_VALID(this);

	if (position == NULL)
		return AddTail(newElement); // insert after nothing -> tail of the list

	// Insert it before position
	CNode* pOldNode = (CNode*) position;
	ASSERT(AfxIsValidAddress(pOldNode, sizeof(CNode)));
	CNode* pNewNode = NewNode(pOldNode, pOldNode->pNext);
	pNewNode->data = newElement;

	if (pOldNode->pNext != NULL)
	{
		ASSERT(AfxIsValidAddress(pOldNode->pNext, sizeof(CNode)));
		pOldNode->pNext->pPrev = pNewNode;
	}
	else
	{
		ASSERT(pOldNode == m_pNodeTail);
		m_pNodeTail = pNewNode;
	}
	pOldNode->pNext = pNewNode;
	return (POSITION) pNewNode;

}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:28,代码来源:list_p.cpp


示例18: ERROR2

BOOL CDRArrowheadStore::AddChunkToStore(RIFFFile *RIFF)
{
	if(RIFF->GetObjType() != RIFFOBJECTTYPE_CHUNK)
	{
		ERROR2(FALSE, "CDRAttributeStore::AddChunkToStore called without a chunk in the RIFFFile");
	}

	// get a new item obect
	CDRArrowheadStoredItem *Item = new CDRArrowheadStoredItem;

	if(Item == 0)
		return FALSE;

	// get the data of the RIFF chunk
	if(!Item->Aquire(RIFF))
	{
		delete Item;
		return FALSE;
	}

	Item->Size = RIFF->GetObjSize();

	// and add the new item to the list
	AddTail(Item);

	return TRUE;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:27,代码来源:cdroutl.cpp


示例19: RethinkPlayers

void
RethinkPlayers ( struct AHIDevUnit *iounit,
                 struct AHIBase *AHIBase )
{
  struct MinList templist;
  struct AHIRequest *ioreq;

  NewList((struct List *) &templist);

  ObtainSemaphore(&iounit->ListLock);

  RemPlayers((struct List *) &iounit->PlayingList, iounit, AHIBase);
  RemPlayers((struct List *) &iounit->SilentList, iounit, AHIBase);

  // Move all silent requests to our temporary list

  while((ioreq = (struct AHIRequest *) RemHead((struct List *) &iounit->SilentList)))
  {
    AddTail((struct List *) &templist, (struct Node *) ioreq);
  }

  // And add them back...
  while((ioreq = (struct AHIRequest *) RemHead((struct List *) &templist)))
  {
    AddWriter(ioreq, iounit, AHIBase);
  }

  ReleaseSemaphore(&iounit->ListLock);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:29,代码来源:devcommands.c


示例20: funced_compile

// Compile function list into function
void funced_compile(FuncEdData *data)
{
	FunctionEntry *entry;
	Cfg_Instruction *ins;
	Att_Node *node;

	// Free existing instructions
	FreeInstructionList(data->function);

	// Got a label?
	if (data->label[0])
	{
		// Create label instruction
		if ((ins=NewInstruction(0,INST_LABEL,data->label)))
			AddHead((struct List *)&data->function->instructions,(struct Node *)ins);
	}

	// Go through instructions
	for (node=(Att_Node *)data->function_list->list.lh_Head;
		node->node.ln_Succ;
		node=(Att_Node *)node->node.ln_Succ)
	{
		// Get function entry
		entry=(FunctionEntry *)node->data;

		// Create a new instruction
		if ((ins=NewInstruction(0,entry->type,entry->buffer)))
		{
			// Add to function list
			AddTail((struct List *)&data->function->instructions,(struct Node *)ins);
		}
	}
}
开发者ID:timofonic,项目名称:dopus5allamigas,代码行数:34,代码来源:function_editor.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddTask函数代码示例发布时间:2022-05-30
下一篇:
C++ AddTag函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap