当前位置: 首页>>代码示例>>C++>>正文


C++ destruct函数代码示例

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


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


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