當前位置: 首頁>>代碼示例>>C++>>正文


C++ DELETE函數代碼示例

本文整理匯總了C++中DELETE函數的典型用法代碼示例。如果您正苦於以下問題:C++ DELETE函數的具體用法?C++ DELETE怎麽用?C++ DELETE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DELETE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DELETE

void asCVariableScope::Reset()
{
	isBreakScope = false;
	isContinueScope = false;

	for( asUINT n = 0; n < variables.GetLength(); n++ )
		if( variables[n] ) 
		{
			DELETE(variables[n],sVariable);
		}
	variables.SetLength(0);
}
開發者ID:gookeryoung,項目名稱:GKGE,代碼行數:12,代碼來源:as_variablescope.cpp

示例2: DELETE

ADMVideoMPD3Dlow::~ADMVideoMPD3Dlow()
{

 	DELETE(_param);
	delete  _uncompressed;
	delete  _stored;
	delete [] Line;
	Line=NULL;
	_param=NULL;
	_uncompressed=NULL;
	_stored=NULL;
}
開發者ID:BackupTheBerlios,項目名稱:avidemux-svn,代碼行數:12,代碼來源:ADM_vidMPLD3Dlow.cpp

示例3: deleteItem

void QGVector::clear()				// clear vector
{
    if ( vec ) {
	for ( uint i=0; i<len; i++ ) {		// delete each item
	    if ( vec[i] )
		deleteItem( vec[i] );
	}
	DELETE(vec);
	vec = 0;
	len = numItems = 0;
    }
}
開發者ID:OS2World,項目名稱:LIB-QT3_Toolkit_Vbox,代碼行數:12,代碼來源:qgvector.cpp

示例4: DELETE

 void RedisReply::Clear()
 {
     type = 0;
     integer = 0;
     double_value = 0;
     str.clear();
     DELETE(elements);
     if (self_pool && NULL != pool)
     {
         pool->Clear();
     }
 }
開發者ID:yinqiwen,項目名稱:comms,代碼行數:12,代碼來源:redis_reply.cpp

示例5: memset

/**
 * postSort() runs after sorting has been performed. For ZendArray, postSort()
 * handles rewiring the linked list according to the results of the sort. Also,
 * if resetKeys is true, postSort() will renumber the keys 0 thru n-1.
 */
void ZendArray::postSort(Bucket** buffer, bool resetKeys) {
  uint last = m_size-1;
  m_pListHead = buffer[0];
  m_pListTail = buffer[last];
  m_pos = (ssize_t)m_pListHead;
  Bucket* b = buffer[0];
  b->pListLast = NULL;
  if (resetKeys) {
    memset(m_arBuckets, 0, tableSize() * sizeof(Bucket*));
    for (uint i = 0; i < last; ++i) {
      Bucket* bNext = buffer[i+1];
      b->pListNext = bNext;
      bNext->pListLast = b;
      if (b->hasStrKey() && b->skey->decRefCount() == 0) {
        DELETE(StringData)(b->skey);
      }
      b->setIntKey(i);
      uint nIndex = (i & m_nTableMask);
      CONNECT_TO_BUCKET_LIST(b, m_arBuckets[nIndex]);
      SET_ARRAY_BUCKET_HEAD(m_arBuckets, nIndex, b);
      b = bNext;
    }
    if (b->hasStrKey() && b->skey->decRefCount() == 0) {
      DELETE(StringData)(b->skey);
    }
    b->setIntKey(last);
    uint nIndex = (last & m_nTableMask);
    CONNECT_TO_BUCKET_LIST(b, m_arBuckets[nIndex]);
    SET_ARRAY_BUCKET_HEAD(m_arBuckets, nIndex, b);
    m_nNextFreeElement = m_size;
  } else {
    for (uint i = 0; i < last; ++i) {
      Bucket* bNext = buffer[i+1];
      b->pListNext = bNext;
      bNext->pListLast = b;
      b = bNext;
    }
  }
  b->pListNext = NULL;
}
開發者ID:BauerBox,項目名稱:hiphop-php,代碼行數:45,代碼來源:zend_array_sort.cpp

示例6: JCLSetGlobalOptions

JILError JCLSetGlobalOptions(JILState* pVM, const JILChar* pOptionString)
{
	JILError err = JIL_No_Exception;
	JCLString* pStr;
	JCLString* pToken;
	JCLOption* pOptions;
	JCLState* _this;

	if( (_this = pVM->vmpCompiler) == NULL )
		return JIL_ERR_No_Compiler;

	pStr = NEW(JCLString);
	pToken = NEW(JCLString);
	JCLSetString(pToken, pOptionString);
	pOptions = GetGlobalOptions(_this);
	while( !JCLAtEnd(pToken) )
	{
		// copy up to separator into pStr
		JCLSpanExcluding(pToken, ",;", pStr);
		// trim any spaces
		JCLTrim(pStr);
		// something left?
		if( JCLGetLength(pStr) )
		{
			// have option object parse it
			err = pOptions->ParseOption(pOptions, pStr, JILHandleRuntimeOptions, pVM);
			// handle warnings and errors
			if( err )
				goto exit;
		}
		// skip the separator(s)
		JCLSpanIncluding(pToken, ",;", pStr);
	}

exit:
	DELETE(pStr);
	DELETE(pToken);
	return err;
}
開發者ID:jewe-1969,項目名稱:jilruntime,代碼行數:39,代碼來源:jilcompiler.c

示例7: rbtree_delete

/* =============================================================================
 * rbtree_delete
 * -- Returns TRUE if key exists
 * =============================================================================
 */
bool_t
rbtree_delete (rbtree_t* r, void* key)
{
    node_t* node = NULL;
    node = LOOKUP(r, key);
    if (node != NULL) {
        node = DELETE(r, node);
    }
    if (node != NULL) {
        releaseNode(node);
    }
    return ((node != NULL) ? TRUE : FALSE);
}
開發者ID:amohtasham,項目名稱:rstm,代碼行數:18,代碼來源:rbtree.c

示例8: DELETE

 RedisDumpFile* Slave::GetNewRedisDumpFile()
 {
     DELETE(m_rdb);
     std::string dump_file_path = m_serv->m_cfg.home + "/repl";
     char tmp[dump_file_path.size() + 100];
     uint32 now = time(NULL);
     sprintf(tmp, "%s/temp-%u-%u.rdb", dump_file_path.c_str(), getpid(), now);
     NEW(m_rdb, RedisDumpFile);
     m_rdb->Init(m_serv->m_db);
     m_rdb->OpenWriteFile(tmp);
     INFO_LOG("[Slave]Create redis dump file:%s", tmp);
     return m_rdb;
 }
開發者ID:yuanshankongmeng,項目名稱:ardb,代碼行數:13,代碼來源:slave.cpp

示例9: sp_devices_length

int sp_devices_length() {
    int length = 0;
    sp_db *th = NEW(sp_db);
    if (th && th->m_DB &&
        SQLITE_OK != sqlite3_exec(th->m_DB,
                                  "SELECT COUNT(id) as length FROM devices",
                                  &sp_devices_length_callback,
                                  (void *)&length, 0)) {
        length = 0;
    }
    DELETE(th);
    return length;
}
開發者ID:sergeygaychuk,項目名稱:Dispatcher,代碼行數:13,代碼來源:sqliteprotocol.c

示例10: LoadOperMOTD

	void LoadOperMOTD()
	{
		ConfigReader* conf = new ConfigReader(ServerInstance);
		std::string filename;
		filename = conf->ReadValue("opermotd","file",0);
		if (opermotd)
		{
			delete opermotd;
			opermotd = NULL;
		}
		opermotd = new FileReader(ServerInstance, filename);
		DELETE(conf);
	}
開發者ID:TuSuNaMi,項目名稱:ircd-sakura,代碼行數:13,代碼來源:m_opermotd.cpp

示例11: DELETE

void ZendArray::onSetEvalScalar() {
  for (Bucket *p = m_pListHead; p; p = p->pListNext) {
    StringData *key = p->skey;
    if (p->hasStrKey() && !key->isStatic()) {
      StringData *skey= StringData::GetStaticString(key);
      if (key && key->decRefCount() == 0) {
        DELETE(StringData)(key);
      }
      p->skey = skey;
    }
    p->data.setEvalScalar();
  }
}
開發者ID:DenisBazhan,項目名稱:hiphop-php,代碼行數:13,代碼來源:zend_array.cpp

示例12: ReadConfig

	void ReadConfig()
	{
		ConfigReader* MyConf = new ConfigReader(ServerInstance);
		allowchans.clear();
		for (int i = 0; i < MyConf->Enumerate("allowchannel"); i++)
		{
			std::string txt;
			txt = MyConf->ReadValue("allowchannel", "name", i);
			irc::string channel = txt.c_str();
			allowchans[channel] = 1;
		}
		DELETE(MyConf);
	}
開發者ID:TuSuNaMi,項目名稱:ircd-sakura,代碼行數:13,代碼來源:m_restrictchans.cpp

示例13: ASSERT

HOT_FUNC_HPHP
void ZendArray::erase(Bucket ** prev, bool updateNext /* = false */) {
  if (prev == NULL)
    return;
  Bucket * p = *prev;
  bool nextElementUnsetInsideForeachByReference = false;
  if (p) {
    *prev = p->pNext;
    if (p->pListLast) {
      p->pListLast->pListNext = p->pListNext;
    } else {
      /* Deleting the head of the list */
      ASSERT(m_pListHead == p);
      m_pListHead = p->pListNext;
    }
    if (p->pListNext) {
      p->pListNext->pListLast = p->pListLast;
    } else {
      ASSERT(m_pListTail == p);
      m_pListTail = p->pListLast;
    }
    if (m_pos == (ssize_t)p) {
      m_pos = (ssize_t)p->pListNext;
    }
    int sz = m_strongIterators.size();
    for (int i = 0; i < sz; ++i) {
      if (m_strongIterators.get(i)->pos == (ssize_t)p) {
        nextElementUnsetInsideForeachByReference = true;
        m_strongIterators.get(i)->pos = (ssize_t)p->pListNext;
        if (!(m_strongIterators.get(i)->pos)) {
          // Record that there is a strong iterator out there
          // that is past the end
          m_flag |= StrongIteratorPastEnd;
        }
      }
    }
    m_size--;
    // Match PHP 5.3.1 semantics
    if ((uint64)p->ikey == (uint64)(m_nNextFreeElement - 1) &&
        (p->ikey == 0x7fffffffffffffffLL || updateNext)) {
      --m_nNextFreeElement;
    }
    DELETE(Bucket)(p);
  }
  if (nextElementUnsetInsideForeachByReference) {
    if (RuntimeOption::EnableHipHopErrors) {
      raise_warning("The next element was unset inside foreach by reference. "
                    "This may lead to unexpeced results.");
    }
  }
}
開發者ID:DenisBazhan,項目名稱:hiphop-php,代碼行數:51,代碼來源:zend_array.cpp

示例14: main

int32 main()
{    
    CTest *p1, *p2, *p3;
    char* pch1;
	CMemMgr* pclMemMgr = TSingleton<CMemMgr>::Instance();
    TSingleton<CMutexMgr>::Instance()->Init();    

    pclMemMgr.Init();
	pclMemMgr.Dump(NULL);
    NEW(p1, CTest, 1, 1);    
    NEW(p2, CTest, 2, 2);
    NEW(p3, CTest, 3, 3);
    p1->print();
    p2->print();
    p3->print();
	pclMemMgr.Dump(NULL);
    
    DELETE(p1);    
    MALLOC(pch1, char, 10);
    p2->print();
    p3->print();
	pclMemMgr.Dump(NULL);

    FREE(pch1);
    DELETE(p2);    
    DELETE(p3);
	pclMemMgr.Dump(NULL);
    
	pthread_t m_resumeThreadId;
    pthread_create(&m_resumeThreadId, 0, ResumeMemTask, 0);
    
	pthread_t m_monitorThreadId;
    pthread_create(&m_monitorThreadId, 0, MonitorMemTask, 0);
	
    while(1) sleep(10);

	return 0;
}
開發者ID:scanerdong,項目名稱:test,代碼行數:38,代碼來源:MemMgr.cpp

示例15: CheckPointOperation

 int LMDBEngine::DiscardBatchWrite()
 {
     LMDBContext& holder = m_ctx_local.GetValue();
     holder.batch_write--;
     if (holder.batch_write == 0)
     {
         CheckPointOperation* ck = new CheckPointOperation(holder.cond);
         m_write_queue.Push(ck);
         NotifyBackgroundThread();
         ck->Wait();
         DELETE(ck);
     }
     return 0;
 }
開發者ID:mrkeng,項目名稱:ardb,代碼行數:14,代碼來源:lmdb_engine.cpp


注:本文中的DELETE函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。