您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddTail函数代码示例

51自学网 2021-06-01 19:45:35
  C++
这篇教程C++ AddTail函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例6: _MEMTRACK

////// _MEMTRACK// add a new node to the memory tracking listsvoid _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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例12: RemoveAll

CFormList & CFormList::operator =(CFormList &newList){	RemoveAll();	AddTail(&newList);	return *this;}
开发者ID:mellertson,项目名称:ARExplorer,代码行数:7,


示例13: FreeARNameList

/////////////////////////////////////////////////////////////////////// Fills the list with all the form names on the servervoid 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,


示例14: add_popup_ext

// Add PopUp extensionsvoid 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,


示例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,


示例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,


示例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,


示例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,


示例19: RethinkPlayers

voidRethinkPlayers ( 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,


示例20: funced_compile

// Compile function list into functionvoid 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,


示例21: cAutoLock

void CPacketQueue::Add(CAutoPtr<Packet> p){	CAutoLock cAutoLock(this);	if(p)	{		m_size += p->GetDataSize();		if(p->bAppendable && !p->bDiscontinuity && !p->pmt		&& p->rtStart == Packet::INVALID_TIME		&& !IsEmpty() && GetTail()->rtStart != Packet::INVALID_TIME)		{			Packet* tail = GetTail();						int oldsize = tail->GetCount();			int newsize = tail->GetCount() + p->GetCount();			tail->SetCount(newsize, max(1024, newsize)); // doubles the reserved buffer size			memcpy(tail->GetData() + oldsize, p->GetData(), p->GetCount());			/*			GetTail()->Append(*p); // too slow			*/			return;		}	}	AddTail(p);}
开发者ID:banduladh,项目名称:meplayer,代码行数:26,


示例22: CreateResouces

BOOLCreateResouces( struct ResourceIteratorList* ril,                struct List*                 result,                struct ISAPNPBase*           res ){  // Allocate resources for current iterators  struct ResourceIterator* iter;  for( iter = (struct ResourceIterator*)               ril->m_ResourceIterators.mlh_Head;       iter->m_MinNode.mln_Succ != NULL;       iter = (struct ResourceIterator*)               iter->m_MinNode.mln_Succ )  {    struct ISAPNP_Resource* resource;    resource = CreateResource( iter, res );        if( resource == NULL )    {      return FALSE;    }        AddTail( result, (struct Node*) resource );  }  return TRUE;}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:29,


示例23: ASSERT_VALID

///////////////////////////////////////////////////////////////////// CChartList::Open// This reads in records from the file YY/chart//BOOL CChartList::Open(const char* pszChartFileName){    const int SZCHARTLINE = 80;    char ChartInputRecord[SZCHARTLINE+1];    CChart c;    BOOL bGOOD_INPUT;    ASSERT_VALID( this );    int rec_cnt = 0;    CStdioFile cf( pszChartFileName, CFile::modeRead );    while ( cf.ReadString( ChartInputRecord, SZCHARTLINE ) )    {	bGOOD_INPUT = c.Convert( ChartInputRecord );	if( bGOOD_INPUT  ) {	    AddTail( new CChart( c ) );	}    }    cf.Close();    return TRUE;}
开发者ID:jkozik,项目名称:nf1988,代码行数:29,


示例24: InitSemaphore

struct MidiCluster *NewCluster(char *name,struct CamdBase *CamdBase){	struct MyMidiCluster *mymidicluster;	struct MidiCluster *midicluster;	mymidicluster=AllocMem(sizeof(struct MyMidiCluster),MEMF_ANY | MEMF_CLEAR | MEMF_PUBLIC);	if(mymidicluster==NULL) return NULL;	InitSemaphore(&mymidicluster->semaphore);	midicluster=&mymidicluster->cluster;	midicluster->mcl_Node.ln_Name=AllocVec(mystrlen(name) + 1,MEMF_ANY|MEMF_PUBLIC);	if(midicluster->mcl_Node.ln_Name==NULL){		FreeMem(midicluster,sizeof(struct MyMidiCluster));		return NULL;	}	mysprintf(CamdBase,midicluster->mcl_Node.ln_Name,"%s",name);	NEWLIST(&midicluster->mcl_Receivers);	NEWLIST(&midicluster->mcl_Senders);	AddTail(&CB(CamdBase)->midiclusters,&midicluster->mcl_Node);	return midicluster;}
开发者ID:jgideonr,项目名称:camd,代码行数:30,


示例25: Assert

AUI_ERRCODE aui_DirtyList::AddRect(	sint32 left,	sint32 top,	sint32 right,	sint32 bottom ){	if ( left < right && top < bottom )	{		RECT *rect = m_rectMemory->New();		Assert( rect != NULL );		if ( !rect ) return AUI_ERRCODE_MEMALLOCFAILED;		rect->left = left;		rect->top = top;		rect->right = right;		rect->bottom = bottom;		AddTail( rect );		if ( m_spanListArray )			ComputeSpans( rect );	}	return AUI_ERRCODE_OK;}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:26,


示例26: thylacine_Init

static int thylacine_Init(struct ThylacineBase *tb){    struct Library *ExpansionBase;    int unit = 0;    InitSemaphore(&tb->tb_UnitLock);    NEWLIST(&tb->tb_Units);    if ((ExpansionBase = OpenLibrary("expansion.library", 36))) {        struct ConfigDev *cd = NULL;        while ((cd = FindConfigDev(cd, THYLACINE_VENDOR, THYLACINE_PRODUCT))) {            struct sl811hs *sl;            ULONG addr = (ULONG)(IPTR)cd->cd_BoardAddr;            ULONG data = addr + 0x4000;            // ULONG reset = addr + 0x100;            sl = sl811hs_Attach(addr, data, INTB_EXTER);            if (sl) {                ((struct Node *)sl)->ln_Pri = unit++;                ((struct Node *)sl)->ln_Name = "thylacine.device";                AddTail(&tb->tb_Units, (struct Node *)sl);            }        }        CloseLibrary(ExpansionBase);    }    return IsListEmpty(&tb->tb_Units) ? 0 : 1;}
开发者ID:ezrec,项目名称:poseidon-sl811hs,代码行数:30,


示例27: assert

bool CMyArray::Insert(int nIndex, int newElem){  assert(nIndex >= 0);  assert(nIndex < m_nLength);    if (m_pData == NULL)  {    AddTail(newElem);    return true;  }  //空间不够  else if (m_nLength >= m_nSize)  {    Alloc(m_nSize, m_nSize * 2);  }  //移动元素//   memmove(m_pData + nIndex + 1, //           m_pData + nIndex, //           (m_nLength - nIndex) * sizeof(int));  for (int i = m_nLength; i > nIndex; i--)  {    m_pData[i] = m_pData[i - 1];  }  m_pData[nIndex] = newElem;  m_nLength++;  return true;}
开发者ID:styxschip,项目名称:Note,代码行数:31,


示例28: LIBFUNC1

LIBFUNC1(void, Reschedule, struct Task *, task, struct ExecBase *,SysBase){    switch(task->tc_State)    {	case TS_READY:            Enqueue(&SysBase->TaskReady, (struct Node *)task);            break;	case TS_ADDED:	    Enqueue(&SysBase->TaskReady, (struct Node *)task);	    break;	case TS_WAIT:	    AddTail(&SysBase->TaskWait, (struct Node *)task);	    break;	case TS_REMOVED:	    /* Ideally we should free the task here, but we can't	       because that would corrupt the memory lists.	    */	    break;	case TS_INVALID:	case TS_EXCEPT:	case TS_RUN:	    /* We should never be called with this state. */	    break;    }}
开发者ID:AlexisBerger,项目名称:novaos,代码行数:28,


示例29: TYSIniSection

/*=============================================================================*NAME		:TYSIniFile::Add			:*MODULE		:YSIniFiles.cpp			:*FUNCTION	:追加
C++ AddTask函数代码示例
C++ AddTag函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。