本文整理汇总了C++中destruct函数的典型用法代码示例。如果您正苦于以下问题:C++ destruct函数的具体用法?C++ destruct怎么用?C++ destruct使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了destruct函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(object me,string arg)
{
object obj;
seteuid(geteuid(me));
obj=new(arg);
if(!obj) return 0;
dump_prog(obj,1,"dump1");
dump_prog(obj,2,"dump2");
destruct (obj);
return 1;
}
开发者ID:cosin,项目名称:XYJ,代码行数:14,代码来源:dumpprog.c
示例2: on_move
void on_move( object src ) {
::on_move( src );
if( !src ) return;
if( !solid && !environment()->query_container() ) {
object old_targ;
old_targ = query_target();
set_target(this_object());
if( this_player() )
this_player()->msg_local( "~CACT~Subt ~vertdissipate as ~name ~verbpour it out.~CDEF" );
set_target( old_targ );
destruct( this_object() );
}
}
开发者ID:shentino,项目名称:simud,代码行数:14,代码来源:liquid.c
示例3: init
void init()
{
object me;
::init();
if( interactive(me = this_player()) )
{
if( (me->query("family/family_name") != "少林派"
|| me->query("family/generation") > 36
|| me->query_temp("win_times") < 3)
&& me->query( "family/master_name") != "觉心" )
destruct(this_object());
}
}
开发者ID:heypnus,项目名称:xkx2001,代码行数:14,代码来源:jue-xin.c
示例4: while
fasthash_node *fasthash_node_destroy(fasthash_node *node, fasthash_destructor destruct) {
fasthash_node *temp;
while (node) {
temp = node->next;
if (destruct) {
destruct(node->data);
}
free(node->key);
free(node);
node = temp;
}
return 0;
}
开发者ID:VentrueSoftware,项目名称:vconfig,代码行数:14,代码来源:hash.c
示例5: SL_MUTEX
void String::StringImplementation::destructString() {
if (string) {
#if !defined(WITHOUT_THREAD)
ScopedLock<Mutex> SL_MUTEX(&mutex);
#endif
for (SIZE i = 0; i < length; ++i)
destruct(string + i);
deallocate(string);
::operator delete(cstring);
string = 0;
cstring = 0;
length = 0;
}
}
开发者ID:WayStudios,项目名称:WSLibrary,代码行数:14,代码来源:string.cpp
示例6: connect
object connect()
{
object login_ob;
mixed err;
err = catch(login_ob = new(LOGIN_OB));
if (err) {
write("现在有人正在修改使用者连线部份的程式,请待会再来。\n");
write(err);
destruct(this_object());
}
return login_ob;
}
开发者ID:mudchina,项目名称:fy2,代码行数:14,代码来源:master.c
示例7: checking
int checking(object me, object ob)
{
object obj;
if ( !me->is_fighting() ) {
obj = new(__DIR__"buqun");
obj->move(environment(me));
obj->set("eff_qi", me->query("eff_qi"));
obj->set("qi", me->query("qi"));
obj->set("neili", me->query("neili"));
obj->set("eff_jing", me->query("eff_jing"));
obj->set("jing", me->query("jing"));
destruct(me);
}
开发者ID:heypnus,项目名称:xkx2001,代码行数:14,代码来源:buqun2.c
示例8: destroy
static void destroy(
struct hw_ctx_audio **ptr)
{
struct hw_ctx_audio_dce112 *hw_ctx_dce112;
hw_ctx_dce112 = container_of(
*ptr, struct hw_ctx_audio_dce112, base);
destruct(hw_ctx_dce112);
/* release memory allocated for struct hw_ctx_audio_dce112 */
dm_free(hw_ctx_dce112);
*ptr = NULL;
}
开发者ID:RadeonOpenCompute,项目名称:ROCK-Kernel-Driver,代码行数:14,代码来源:hw_ctx_audio_dce112.c
示例9: do_drop
int do_drop(object me, object obj)
{
//if obj is a self-made fabao, save first...
//if( obj->query("series_no") && obj->query("fabao") ) obj->save();
if( obj->query("no_drop") ){
destruct(obj);
return 0;
}
if (obj->move(environment(me))) {
if( obj->is_character() )
message_vision("$N将$n从背上放了下来,躺在地上。\n", me, obj);
else {
message_vision( sprintf("$N丢下一%s$n。\n", obj->query("unit")), me, obj );
if( !obj->query("value") && !obj->value() ) {
tell_object(me,"因为这样东西并不值钱,所以人们并不会注意到它的存在。\n");
destruct(obj);
}
}
return 1;
}
return 0;
}
开发者ID:mudchina,项目名称:sjsh,代码行数:23,代码来源:quit.c
示例10: do_qian
int do_qian (string arg)
{
object me = this_player();
string what;
int amount;
string money;
object ob;
if (! arg ||
sscanf (arg,"%s %d %s",what,amount,money) != 3)
return notify_fail("请使用: qian <押签种类> <数目> <货币>\n");
if (what != "dqq" &&
what != "dkq" &&
what != "xqq" &&
what != "xkq" &&
what != "qq" &&
what != "kq")
return notify_fail("你要押什么签?\n");
ob = present (money+"_money", me);
if (! ob)
return notify_fail("你身上没有这种货币。\n");
if (amount < 1)
return notify_fail("请多押一些钱。\n");
if (amount > ob->query_amount())
return notify_fail("你身上的钱不够押。\n");
if (me->query_temp ("gamble_qian/amount") > 0)
return notify_fail("你已经押过了。\n");
if (room_status > 1)
return notify_fail("现在正在赌呢,稍等片刻。\n");
me->set_temp("gamble_qian/kind",what);
me->set_temp("gamble_qian/amount",amount);
me->set_temp("gamble_qian/money",money);
message_vision (sprintf("$N拿出%s%s%s,押在%s上。\n",
chinese_number(amount),
ob->query("base_unit"),
ob->query("name"),
qians[what]),
me);
if (amount == ob->query_amount())
destruct (ob);
else
ob->add_amount(-amount);
return 1;
}
开发者ID:mudchina,项目名称:fy3,代码行数:50,代码来源:duchang1.c
示例11: destruct
/// clears both stacks
void TextUndoStack::clear()
{
destruct();
lastCoalesceIdStack_.push(0); // always 1 item
// point all the indices to BLANK
changeIndex_ = 0;
setPersistedIndex(-1); // clearing the undo-stack must result in a non-saved state
QMapIterator<TextEditorController*, int> itr(controllerIndexMap_);
while (itr.hasNext()) {
itr.next();
controllerIndexMap_.insert( itr.key(), 0 );
}
}
开发者ID:letmefly,项目名称:edbee-lib,代码行数:15,代码来源:textundostack.cpp
示例12: heart_beat
void heart_beat()
{
int i;
if(!environment())
{
set_heart_beat(0);
destruct(this_object());
return;
}
if(living(environment()))
{
set_heart_beat(0);
destruct(this_object());
return;
}
if (!alter)
tell_room(environment(), "Fuerchterlicher Gestank erfuellt den Raum.\n");
alter++;
if (!random(10))
{
i = random (5);
if (i==0)
tell_room(environment(), furzerWESSEN+" Furz stinkt wirklich grauenerregend.\n");
if (i==1)
tell_room(environment(), "Du haeltst Dir die Nase zu.\n");
if (i==2)
tell_room(environment(), "Widerliche Duenste erfuellen den Raum.\n");
if (i==3)
tell_room(environment(), "Der Furz riecht, als wuerde " + furzerWER +" innerlich verfaulen.\n");
if (i==4)
tell_room(environment(), "Du musst Dich beinah uebergeben, als " + furzerWESSEN + " Furz in Deine Nase kriecht.\n");
}
if (alter==45) {
tell_room(environment(), furzerWESSEN + " widerlicher Furz hat sich endlich verzogen.\n");
destruct(this_object());
}
}
开发者ID:Kebap,项目名称:mg-mudlib,代码行数:37,代码来源:furz.c
示例13: main
int main(object me, string arg)
{
string option, target, msg;
object obj;
if (!arg) return notify_fail("╓╕┴ю╕ё╩╜ : dest <╬я╝■╓о├√│╞╗Є╡╡├√>\n" );
if( sscanf(arg, "-%s %s", option, target)!=2 ) target = arg;
if( option == "-r" && (string)SECURITY_D->get_status(me)=="(admin)" )
seteuid(ROOT_UID);
else
seteuid(geteuid(me));
obj = find_object(target);
if (!obj) obj = present(target, me);
if (!obj) obj = present(target, environment(me));
if (!obj) obj = find_object( resolve_path(me->query("cwd"), target) );
if (!objectp(obj))
return notify_fail("├╗╙╨╒т╤∙╬я╝■....бг\n");
if ( userp(obj) && (string)SECURITY_D->get_status(me)!="(admin)" )
return notify_fail("─у├╗╙╨┤▌╗┘╢╘╖╜╡─╚и╧▐бг\n");
tell_object( me, sprintf("┤▌╗┘╬я╝■г║ %O\n", obj));
msg = "";
if( environment(me)==environment(obj) )
{
if( !stringp(msg = me->query("env/msg_dest")) )
msg = "$N╒┘╗╜│Ў╥╗╕Ў║┌╢┤гм╜л$n═╠├╗┴╦бг\n";
message_vision(msg + "\n", me, obj);
}
else {
msg = "$N╒┘╗╜│Ў╥╗╕Ў║┌╢┤гм░╤╓▄╬з═╠├╗┴╦бг\n";
message_vision(msg + "\n", me);
}
destruct(obj);
if(obj)
write("─у╬▐╖и╜л╒т╕Ў╬я╝■┤▌╗┘бг\n");
else
write("╬я╝■┤▌╗┘│╔╣жбг\n");
return 1;
}
开发者ID:huangleon,项目名称:fy2005,代码行数:49,代码来源:dest.c
示例14: output_finish
/*
* close and free the contents of a struct output
* Note that the output struct is not freed or unlinked here,
* that is taken care of later.
*/
static INLINE void output_finish(struct object *obj)
{
struct output *o, *oi;
struct object *obji;
debug_malloc_touch(obj);
o=(struct output *)(obj->storage);
if (o->obj)
{
if(obj==THIS->firstoutput){
THIS->firstoutput=o->next;
} else
for(obji=THIS->firstoutput;obji;obji=oi->next)
{
oi=(struct output *)(obji->storage);
if(oi->next==obj)
{
oi->next=o->next;
}
}
if(o->obj->prog)
{
#ifdef BLOCKING_CLOSE
apply_low(o->obj,o->set_blocking_offset,0);
pop_stack();
#endif
push_int(0);
apply(o->obj,"set_id",1);
pop_stack();
apply(o->obj,"close",0);
pop_stack();
if(!THISOBJ->prog)
Pike_error("Pipe done callback destructed pipe.\n");
destruct(o->obj);
}
free_object(o->obj);
noutputs--;
o->obj=NULL;
THIS->living_outputs--;
finished_p(); /* Moved by per, one line down.. :) */
/* free_object(THISOBJ); */ /* What? /Hubbe */
}
}
开发者ID:ajinkya007,项目名称:pike-1,代码行数:54,代码来源:pipe.c
示例15: do_sai
int do_sai (string arg)
{
object me = this_player();
string what;
int amount;
string money;
object ob;
if (! arg ||
sscanf (arg,"%s %d %s",what,amount,money) != 3)
return notify_fail("请使用: sai <押龟种类> <数目> <货币>\n");
if (what != "cs" &&
what != "qn" &&
what != "bl")
return notify_fail("你要押什么样的龟?\n");
ob = present (money+"_money", me);
if (! ob)
return notify_fail("你身上没有这种货币。\n");
if (amount < 1)
return notify_fail("请多押一些钱。\n");
if (amount > ob->query_amount())
return notify_fail("你身上的钱不够押。\n");
if (amount * (ob->query("base_value")) > 10000 )
return notify_fail("你想豪赌啊,拜托!官兵就上来了。\n");
if (me->query_temp ("gamble_gui/amount") > 0)
return notify_fail("你已经押过了。\n");
if (room_status > 1)
return notify_fail("现在正在赛龟呢,稍等片刻。\n");
me->set_temp("gamble_gui/kind",what);
me->set_temp("gamble_gui/amount",amount);
me->set_temp("gamble_gui/money",money);
message_vision (sprintf("$N拿出%s%s%s放在紫檀龟台上,押%s。\n",
chinese_number(amount),
ob->query("base_unit"),
ob->query("name"),
guis[what]),
me);
if (amount == ob->query_amount())
destruct (ob);
else
ob->add_amount(-amount);
return 1;
}
开发者ID:aricxu,项目名称:xkx100,代码行数:49,代码来源:duchang4.c
示例16: do_chop
do_chop() {
object vege;
if((int) query("pulled") <= 20)
{
vege = new(__DIR__"obj/tree");
if (!vege->move(this_player()))
{
write("̫��̫���ˣ�û�����ˣ�����\n");
destruct(vege);
return 1;
}
write("�㿳��һ��÷��������ڻ��\n");
add("pulled",1);
return 1;
}
开发者ID:huangleon,项目名称:fy2005,代码行数:15,代码来源:cleft.c
示例17: jump_away
void jump_away ()
{
string s;
object room;
object me = this_object();
s = sprintf ("/d/qujing/maoying/shanpo%d.c",random(10)+1);
room = load_object(s);
message_vision ("ವ�һ����$N������ȥ����\n",me);
me->move(room);
if (present("tu jing 6",environment(me)))
destruct (me);
else
message_vision ("$Nವ�һ�����˹�������\n",me);
}
开发者ID:gongfuPanada,项目名称:mhxy2002,代码行数:15,代码来源:tu.c
示例18: main
int main(object me, string str)
{
object ob, where, *ob_list;
int old_size, i;
if (!str) return notify_fail("指令格式:cleanup <档名>\n");
str = resolve_path(me->query("cwd"), str);
ob_list = children(str);
old_size = sizeof(ob_list);
ob_list->clean_up();
for(i=0; i<sizeof(ob_list); i++)
if( ob_list[i] && clonep(ob_list[i]) && !environment(ob_list[i]) )
destruct(ob_list[i]);
ob_list -= ({ 0 });
开发者ID:aricxu,项目名称:xkx100,代码行数:15,代码来源:cleanup.c
示例19: cancel_quest
// 结束任务的函数
// 直接调用析构函数
void cancel_quest()
{
// 设置结束时间
set("finish_time", time());
// 从QUEST_D中去掉有关这个对象的信息
QUEST_D->remove_all_information(this_object());
// 如果没有析构这个任务,则设置标识,然后析构这个任务
if (! destructing)
{
destructing = 1;
destruct(this_object());
}
}
开发者ID:mudchina,项目名称:nitan3,代码行数:17,代码来源:quest.c
示例20: deep_destruct
void deep_destruct(object o) {
mixed *ancestors;
mixed ancestor;
if (!o) {
return;
}
ancestors = deep_inherit_list(o);
foreach (ancestor in ancestors) {
ancestor = find_object(ancestor);
if (ancestor) {
destruct(ancestor);
}
}
开发者ID:rmanis,项目名称:lil,代码行数:15,代码来源:objects.c
注:本文中的destruct函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论