本文整理汇总了C++中Delete函数的典型用法代码示例。如果您正苦于以下问题:C++ Delete函数的具体用法?C++ Delete怎么用?C++ Delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Delete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Delete
bool
CTaskTrayIcon::Restore()
{
Delete();
return Add();
}
示例2: for_each
index_set::~index_set() {
for_each(constraint_index_sets.begin(), constraint_index_sets.end(), Delete());
}
示例3: DeleteTags
/**
* @brief Immediately deletes all tags attached to an entity (skips all effects).
*/
void DeleteTags( gentity_t *ent )
{
Delete( ent->alienTag );
Delete( ent->humanTag );
}
示例4: operator
void operator()(Ptr ptr) const
{
Delete(ptr);
}
示例5: SwigType_add_memberpointer
void
SwigType_add_memberpointer(SwigType *t, String_or_char *name) {
String *temp = NewStringf("m(%s).", name);
Insert(t,0,temp);
Delete(temp);
}
示例7: ResetProgress
status_t
POP3Protocol::HandleFetchBody(const entry_ref& ref, const BMessenger& replyTo)
{
ResetProgress("Fetch body");
SetTotalItems(1);
status_t error = Connect();
if (error != B_OK)
return error;
error = _RetrieveUniqueIDs();
if (error != B_OK) {
Disconnect();
return error;
}
BFile file(&ref, B_READ_WRITE);
status_t status = file.InitCheck();
if (status != B_OK) {
Disconnect();
return status;
}
char uidString[256];
BNode node(&ref);
if (node.ReadAttr("MAIL:unique_id", B_STRING_TYPE, 0, uidString, 256) < 0) {
Disconnect();
return B_ERROR;
}
int32 toRetrieve = fUniqueIDs.IndexOf(uidString);
if (toRetrieve < 0) {
Disconnect();
return B_NAME_NOT_FOUND;
}
bool leaveOnServer;
if (fSettings.FindBool("leave_mail_on_server", &leaveOnServer) != B_OK)
leaveOnServer = true;
// TODO: get rid of this BMailMessageIO!
BMailMessageIO io(this, &file, toRetrieve);
// read body
status = io.Seek(0, SEEK_END);
if (status < 0) {
Disconnect();
return status;
}
BMessage attributes;
NotifyBodyFetched(ref, file, attributes);
ReplyBodyFetched(replyTo, ref, B_OK);
if (!leaveOnServer)
Delete(toRetrieve);
ReportProgress(1, 0);
ResetProgress();
Disconnect();
return B_OK;
}
示例8: switch
void GameObject::Update(uint32 p_time)
{
if (GUID_HIPART(GetGUID()) == HIGHGUID_TRANSPORT)
{
//((Transport*)this)->Update(p_time);
return;
}
switch (m_lootState)
{
case GO_NOT_READY:
if (GetGoType()==17)
{
// fishing code (bobber ready)
if( time(NULL) > m_respawnTime - FISHING_BOBBER_READY_TIME )
{
// splash bobber (bobber ready now)
Unit* caster = GetOwner();
if(caster && caster->GetTypeId()==TYPEID_PLAYER)
{
SetUInt32Value(GAMEOBJECT_STATE, 0);
SetUInt32Value(GAMEOBJECT_FLAGS, 32);
UpdateData udata;
WorldPacket packet;
BuildValuesUpdateBlockForPlayer(&udata,((Player*)caster));
udata.BuildPacket(&packet);
((Player*)caster)->GetSession()->SendPacket(&packet);
WorldPacket data;
data.Initialize(SMSG_GAMEOBJECT_CUSTOM_ANIM);
data << GetGUID();
data << (uint32)(0);
((Player*)caster)->SendMessageToSet(&data,true);
}
m_lootState = GO_CLOSED; // can be succesfully open with some chance
}
return;
}
m_lootState = GO_CLOSED; // for not bobber is same as GO_CLOSED
// NO BREAK
case GO_CLOSED:
if (m_respawnTime > 0)
// timer on
{
if (m_respawnTime <= time(NULL)) // timer expired
{
m_respawnTime = 0;
m_SkillupList.clear();
switch (GetGoType())
{
case GAMEOBJECT_TYPE_FISHINGNODE: // can't fish now
{
Unit* caster = GetOwner();
if(caster && caster->GetTypeId()==TYPEID_PLAYER)
{
if(caster->m_currentSpell)
{
caster->m_currentSpell->SendChannelUpdate(0);
caster->m_currentSpell->finish(false);
}
WorldPacket data;
data.Initialize(SMSG_FISH_NOT_HOOKED);
((Player*)caster)->GetSession()->SendPacket(&data);
}
m_lootState = GO_LOOTED; // can be delete
return;
}
case GAMEOBJECT_TYPE_DOOR:
SetUInt32Value (GAMEOBJECT_FLAGS, m_flags);
SetUInt32Value (GAMEOBJECT_STATE, 1);
break;
case GAMEOBJECT_TYPE_TRAP:
break;
default:
if(GetOwnerGUID()) // despawn timer
{
m_respawnTime = 0;
Delete();
return;
}
// respawn timer
MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
break;
}
}
}
break;
case GO_OPEN:
break;
case GO_LOOTED:
if(GetOwnerGUID())
{
m_respawnTime = 0;
Delete();
return;
//.........这里部分代码省略.........
示例9: Delete
BOOL CAccountObjectMgr::ReleaseAccountObject( UINT32 dwAccountID )
{
return Delete(dwAccountID);
}
示例10: create_directory
status_t
POP3Protocol::SyncMessages()
{
bool leaveOnServer;
if (fSettings.FindBool("leave_mail_on_server", &leaveOnServer) != B_OK)
leaveOnServer = true;
// create directory if not exist
create_directory(fDestinationDir, 0777);
printf("POP3Protocol::SyncMessages()\n");
_ReadManifest();
SetTotalItems(2);
ReportProgress(1, 0, B_TRANSLATE("Connect to server" B_UTF8_ELLIPSIS));
status_t error = Connect();
if (error != B_OK) {
printf("POP3 could not connect: %s\n", strerror(error));
ResetProgress();
return error;
}
ReportProgress(1, 0, B_TRANSLATE("Getting UniqueIDs" B_UTF8_ELLIPSIS));
error = _RetrieveUniqueIDs();
if (error < B_OK) {
ResetProgress();
Disconnect();
return error;
}
BStringList toDownload;
NotHere(fManifest, fUniqueIDs, &toDownload);
int32 numMessages = toDownload.CountStrings();
if (numMessages == 0) {
CheckForDeletedMessages();
ResetProgress();
Disconnect();
return B_OK;
}
ResetProgress();
SetTotalItems(toDownload.CountStrings());
SetTotalItemsSize(fTotalSize);
printf("POP3: Messages to download: %i\n", (int)toDownload.CountStrings());
for (int32 i = 0; i < toDownload.CountStrings(); i++) {
const char* uid = toDownload.StringAt(i);
int32 toRetrieve = fUniqueIDs.IndexOf(uid);
if (toRetrieve < 0) {
// should not happen!
error = B_NAME_NOT_FOUND;
printf("POP3: uid %s index %i not found in fUniqueIDs!\n", uid,
(int)toRetrieve);
continue;
}
BPath path(fDestinationDir);
BString fileName = "Downloading file... uid: ";
fileName += uid;
fileName.ReplaceAll("/", "_SLASH_");
path.Append(fileName);
BEntry entry(path.Path());
BFile file(&entry, B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
error = file.InitCheck();
if (error != B_OK) {
printf("POP3: Can't create file %s\n ", path.Path());
break;
}
BMailMessageIO mailIO(this, &file, toRetrieve);
BMessage attributes;
entry_ref ref;
entry.GetRef(&ref);
int32 size = MessageSize(toRetrieve);
if (fFetchBodyLimit < 0 || size <= fFetchBodyLimit) {
error = mailIO.Seek(0, SEEK_END);
if (error < 0) {
printf("POP3: Failed to download body %s\n ", uid);
break;
}
ProcessMessageFetched(ref, file, attributes);
if (!leaveOnServer)
Delete(toRetrieve);
} else {
int32 dummy;
error = mailIO.ReadAt(0, &dummy, 1);
if (error < 0) {
printf("POP3: Failed to download header %s\n ", uid);
break;
}
ProcessHeaderFetched(ref, file, attributes);
}
ReportProgress(1, 0);
//.........这里部分代码省略.........
示例11: Delete
void SqlMassInsert::Flush()
{
const uint64 DONE = (uint64)-1;
if(cache.GetCount() == 0)
return;
if(use_transaction)
sql.GetSession().Begin();
SqlBool remove;
bool doremove = false;
for(int ii = 0; ii < cache.GetCount(); ii++) {
SqlBool rm = cache[ii].remove;
if(!rm.IsEmpty()) {
doremove = true;
remove = remove || rm;
}
}
if(doremove)
sql * Delete(table).Where(remove);
String insert;
int dialect = sql.GetDialect();
if(findarg(dialect, MY_SQL, PGSQL, MSSQL) >= 0) {
insert << "insert into " + ~table + '(';
for(int i = 0; i < column.GetCount(); i++) {
if(i)
insert << ", ";
insert << column[i];
}
insert << ") values ";
for(int i = 0; i < cache.GetCount(); i++) {
Row& r = cache[i];
if(r.value.GetCount()) {
if(i)
insert << ", ";
insert << "(";
for(int i = 0; i < r.value.GetCount(); i++) {
if(i)
insert << ", ";
insert << SqlCompile(dialect, SqlFormat(r.value[i]));
}
insert << ")";
}
}
}
else
for(int ii = 0; ii < cache.GetCount(); ii++) {
uint64 nulls = cache[ii].nulls;
if(nulls != DONE) {
insert << "insert into " + ~table + '(';
bool nextcol = false;
for(int i = 0; i < column.GetCount(); i++) {
if(!(nulls & ((uint64)1 << i))) {
if(nextcol)
insert << ", ";
nextcol = true;
insert << column[i];
}
}
insert << ')';
bool nextsel = false;
for(int i = ii; i < cache.GetCount(); i++) {
Row& r = cache[i];
if(r.nulls == nulls && r.value.GetCount()) {
r.nulls = DONE;
if(nextsel)
insert << " union all";
nextsel = true;
insert << " select ";
bool nextval = false;
for(int i = 0; i < r.value.GetCount(); i++)
if(!(nulls & ((uint64)1 << i))) {
if(nextval)
insert << ", ";
nextval = true;
insert << SqlCompile(dialect, SqlFormat(r.value[i]));
}
if(dialect == ORACLE)
insert << " from dual";
}
}
}
}
sql.Execute(insert);
if(sql.WasError()) {
error = true;
if(use_transaction)
sql.GetSession().Rollback();
}
else
if(use_transaction)
sql.GetSession().Commit();
cache.Clear();
column.Clear();
pos = 0;
}
示例12: Delete
IDENTLIST::~IDENTLIST (void)
{
if (m_lIdents)
Delete (m_lIdents);
m_lIdents = NULL;
}
示例13: Delete
bool CSfxModel::_nextFrame()
{
bool ret = false;
m_currentFrame += m_perSlerp;
const ushort frame = (ushort)m_currentFrame;
ushort startFrame, endFrame;
CPtrArray<Particle>* particles;
Particle* particle;
int j;
for (int i = 0; i < m_particles.GetSize(); i++)
{
if (m_particles[i])
{
const CSfxPartParticle* part = (CSfxPartParticle*)m_sfx->m_parts[i];
particles = m_particles[i];
for (j = 0; j < particles->GetSize(); j++)
{
particle = particles->GetAt(j);
particle->pos += particle->speed;
particle->speed += part->m_particleAccel;
if (!part->m_repeatScal)
particle->scale += part->m_scaleSpeed;
particle->frame++;
if (particle->frame >= part->m_particleFrameDisappear)
{
Delete(particle);
particles->RemoveAt(j);
j--;
}
}
startFrame = 0;
endFrame = 0;
if (part->GetFirstKey())
{
startFrame = part->GetFirstKey()->frame;
endFrame = part->GetLastKey()->frame;
}
if (frame >= startFrame && frame <= endFrame - part->m_particleFrameDisappear)
{
if ((part->m_particleCreate == 0 && frame == startFrame) ||
(part->m_particleCreate != 0 && (frame - startFrame) % part->m_particleCreate == 0)
)
{
const float rand1 = (rand() % 50000) / 50000.0f;
const float rand2 = (rand() % 50000) / 50000.0f;
const float rand3 = (rand() % 50000) / 50000.0f;
for (j = 0; j < part->m_particleCreateNum; j++)
{
particle = new Particle();
particle->frame = 0;
const float angle = ((rand() % 50000) / 50000.0f) * 360.0f;
particle->pos =
D3DXVECTOR3(
sin(angle) * part->m_particleStartPosVar,
rand1 * part->m_particleStartPosVarY,
cos(angle) * part->m_particleStartPosVar
);
const float factor = part->m_particleXZLow + rand2 * (part->m_particleXZHigh - part->m_particleXZLow);
particle->speed =
D3DXVECTOR3(
sin(angle) * factor,
part->m_particleYLow + rand2 * (part->m_particleYHigh - part->m_particleYLow),
cos(angle) * factor
);
particle->scaleStart = particle->scale = part->m_scale;
particle->rotation = D3DXVECTOR3(part->m_rotationLow.x + rand1 *
(part->m_rotationHigh.x - part->m_rotationLow.x),
part->m_rotationLow.y + rand3 *
(part->m_rotationHigh.y - part->m_rotationLow.y),
part->m_rotationLow.z + rand2 *
(part->m_rotationHigh.z - part->m_rotationLow.z));
particle->swScal = false;
particle->scaleEnd = part->m_scaleEnd;
particle->scaleSpeed = D3DXVECTOR3(part->m_scalSpeedXLow + rand3 *
(part->m_scalSpeedXHigh - part->m_scalSpeedXLow),
part->m_scalSpeedYLow + rand2 *
(part->m_scalSpeedYHigh - part->m_scalSpeedYLow),
part->m_scalSpeedZLow + rand1 *
(part->m_scalSpeedZHigh - part->m_scalSpeedZLow));
particles->Append(particle);
}
}
}
if (particles->GetSize() > 0 || frame < startFrame)
ret = true;
#ifndef SFX_EDITOR
if (part->m_repeat)
{
if (endFrame >= 0)
{
const float f = m_currentFrame / (float)endFrame;
//.........这里部分代码省略.........
示例14: while
void C4PacketList::Clear()
{
while (pFirst)
Delete(pFirst);
}
示例15: ADDTOCALLSTACK
//.........这里部分代码省略.........
case PC_GO:
pTargPrompt = g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_TARG_GO);
bTargAllowGround = true;
break;
case PC_GUARD:
pTargPrompt = g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_TARG_GUARD);
bCheckCrime = true;
break;
case PC_GUARD_ME:
NPC_OnHearPetCmdTarg(PC_GUARD, pSrc, pSrc, NULL, NULL);
break;
case PC_STAY:
case PC_STOP:
Skill_Start(NPCACT_STAY);
break;
case PC_TRANSFER:
if ( IsStatFlag(STATF_Conjured) )
{
pSrc->SysMessage(g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_TARG_TRANSFER_SUMMONED));
return true;
}
pTargPrompt = g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_TARG_TRANSFER);
break;
case PC_RELEASE:
if ( IsStatFlag(STATF_Conjured) || (m_pNPC->m_bonded && IsStatFlag(STATF_DEAD)) )
{
Effect(EFFECT_XYZ, ITEMID_FX_TELE_VANISH, this, 10, 15);
Sound(SOUND_TELEPORT);
Delete();
return true;
}
SoundChar(CRESND_NOTICE);
Skill_Start(SKILL_NONE);
NPC_PetClearOwners();
ResendTooltip();
break;
case PC_DROP:
{
// Drop backpack items on ground
// NOTE: This is also called on pet release
CItemContainer *pPack = GetContainer(LAYER_PACK);
if ( pPack )
{
pPack->ContentsDump(GetTopPoint(), ATTR_OWNED);
break;
}
if ( NPC_CanSpeak() )
Speak(g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_CARRYNOTHING));
return true;
}
case PC_DROP_ALL:
DropAll(NULL, ATTR_OWNED);
break;
case PC_SPEAK:
NPC_PetConfirmCommand(true, pSrc);
return true;
case PC_EQUIP: