• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ set_property函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: systemd_start_unit

int systemd_start_unit(struct container *ct, int pid)
{
	static const char *mode = "fail";
	char *slice = "system.slice";
	char unit_name[PATH_MAX], *name = unit_name;
	char desc[1024], *pdesc = desc;
	dbus_bool_t yes = true;

	DBusConnection *conn;
	DBusMessage *msg, *reply;
	DBusMessageIter args, props, aux;

	if (ct->slice)
		slice = ct->slice;
	snprintf(unit_name, sizeof(unit_name), "%s-%s.scope", slice, ct->name);
	snprintf(desc, sizeof(desc), "docker container %s", ct->name);

	msg = dbus_message_new_method_call("org.freedesktop.systemd1",
					   "/org/freedesktop/systemd1",
					   "org.freedesktop.systemd1.Manager",
					   "StartTransientUnit");
	if (!msg) {
		pr_err("can't allocate new method call");
		return -1;
	}

	dbus_message_append_args(msg, 's', &name, 's', &mode, 0);

	dbus_message_iter_init_append(msg, &args);

	dbus_message_iter_open_container(&args, 'a', "(sv)", &props);
	set_property(&props, "Description", 's', &pdesc);
	set_property(&props, "Slice", 's', &slice);

	set_property(&props, "MemoryAccounting", 'b', &yes);
	set_property(&props, "CPUAccounting", 'b', &yes);
	set_property(&props, "BlockIOAccounting", 'b', &yes);

	set_pid(&props, pid);
	dbus_message_iter_close_container(&args, &props);

	dbus_message_iter_open_container(&args, 'a', "(sa(sv))", &aux);
	dbus_message_iter_close_container(&args, &aux);

	conn = get_connection(DBUS_BUS_SYSTEM);
	if (conn == NULL)
		return -1;

	reply = dbus_send_message(conn, msg);
	dbus_message_unref(msg);
	if (reply == NULL)
		return -1;

	dbus_message_unref(reply);

	return 0;
}
开发者ID:avagin,项目名称:libct,代码行数:57,代码来源:systemd.c


示例2: set_property

void PannerEditor::set_properties(Property *p_pos,Property *p_depth) {
	
	pos=p_pos;
	depth=p_depth;
	
	set_property(PROP_PAN,p_pos);
	set_property(PROP_DEPTH,p_depth);
	
	update();
	
	
}
开发者ID:BackupTheBerlios,项目名称:reshaked-svn,代码行数:12,代码来源:panner_editor.cpp


示例3: powermgt_init

static void
powermgt_init(char *path)
{
	phandle_t ph;
	char buf[64];

        snprintf(buf, sizeof(buf), "%s/power-mgt", path);
	REGISTER_NAMED_NODE(rtc, buf);

	ph = find_dev(buf);
	set_property(ph, "device_type", "power-mgt", 10);
	set_property(ph, "mgt-kind", "min-consumption-pwm-led", strlen("min-consumption-pwm-led") + 1);
	set_property(ph, "compatible", "cuda", strlen("cuda") + 1);
}
开发者ID:AhmadQasim,项目名称:GPU-Virtualization,代码行数:14,代码来源:cuda.c


示例4: create

void create() {
    set_property("light", 2);
    set_property("indoors", 1);
    set_property("no castle", 1);
set("short", "%^YELLOW%^Entry to the Hall of Monks");
set_long("%^YELLOW%^The Quixxiol monastery is a place where monks gather and initiate new believers.  A passage to the east if filled with a shimmering light. <preview> will tell you about becoming a monk.");
    set_items(
	(["candles" : "They are all over the monastery.",
	  "candle" : "It burns brightly and helps light the room.",
	  "passage" : "You sense that only monks may pass that way."]) );
    set_exits( 
(["west" : GCITY "gcity10.c",
"southeast" : "(: southeast :)"]) );
}
开发者ID:ehershey,项目名称:pd,代码行数:14,代码来源:gcity19.c


示例5: chest_shatter_msg

static void
chest_shatter_msg(struct obj *otmp)
{
    const char *disposition;
    const char *thing;
    long save_Blinded;

    if (otmp->oclass == POTION_CLASS) {
        pline(msgc_itemloss, "You %s %s shatter!", Blind ? "hear" : "see",
              an(bottlename()));
        if (!breathless(youmonst.data) || haseyes(youmonst.data))
            potionbreathe(&youmonst, otmp);
        return;
    }
    /* We have functions for distant and singular names, but not one
       which does _both_...
       TODO: fix this blindness kludge (it doesn't even work -- see eoto) */
    save_Blinded = property_timeout(&youmonst, BLINDED);
    set_property(&youmonst, BLINDED, 1, TRUE);
    thing = singular(otmp, xname);
    if (save_Blinded)
        set_property(&youmonst, BLINDED, save_Blinded, TRUE);

    switch (objects[otmp->otyp].oc_material) {
    case PAPER:
        disposition = "is torn to shreds";
        break;
    case WAX:
        disposition = "is crushed";
        break;
    case VEGGY:
        disposition = "is pulped";
        break;
    case FLESH:
        disposition = "is mashed";
        break;
    case GLASS:
        disposition = "shatters";
        break;
    case WOOD:
        disposition = "splinters to fragments";
        break;
    default:
        disposition = "is destroyed";
        break;
    }
    pline(msgc_itemloss, "%s %s!", An(thing), disposition);
}
开发者ID:FredrIQ,项目名称:fiqhack,代码行数:48,代码来源:lock.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ set_ps_display函数代码示例发布时间:2022-05-30
下一篇:
C++ set_prop函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap