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

C++ GET_DATA函数代码示例

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

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



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

示例1: philos_fsm_save_info

int philos_fsm_save_info(void* entity, void* msg)
{
    if (!entity || !msg) return FSM_FAIL;

    if (!philos_dict){
        philos_dict = fdict_create(MAX_PHILOS_NUM, philos_hash_match, philos_hash_calc);
        if (!philos_dict){
            LOG_NE("create fdict failed");
            return FSM_FAIL;
        }
    }
    
    philosopher* phi = (philosopher*) malloc(sizeof (philosopher));
    if (!phi) return FSM_FAIL;

    memcpy (phi, GET_DATA(msg), sizeof (philosopher));
    if (FDICT_SUCCESS != fdict_insert(philos_dict, &phi->whoami, phi)){
        LOG_NE("insert philosopher to dict failed");
        free(phi);
        return FSM_FAIL;
    }
    CVTTO_PHILOS(phifsm, entity);

    phifsm->philos = phi;
    philos_count += 1;

    // 用于显示
    show_addphilos(phi);

    return  philos_think(entity);
}
开发者ID:yangluoshen,项目名称:FSM,代码行数:31,代码来源:philosfsm.c


示例2: remmina_rdp_cliprdr_request_data

void remmina_rdp_cliprdr_request_data(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, RemminaProtocolWidget* gp)
{
	GdkAtom target;
	gpointer data;
	RDP_CB_DATA_REQUEST_EVENT* event;
	rfContext* rfi = GET_DATA(gp);

	target = gtk_selection_data_get_target(selection_data);
	rfi->format = remmina_rdp_cliprdr_get_format_from_gdkatom(target);
	rfi->clipboard_queue = g_async_queue_new();

	/* Request Clipboard data of the server */
	event = (RDP_CB_DATA_REQUEST_EVENT*)
		freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_DataRequest, NULL, NULL);
	event->format = rfi->format;
	freerdp_channels_send_event(rfi->instance->context->channels, (wMessage*) event);

	data = g_async_queue_timeout_pop(rfi->clipboard_queue, 1000000);
	if (data != NULL)
	{
		if (info == CB_FORMAT_PNG || info == CB_FORMAT_DIB || info == CB_FORMAT_JPEG)
		{
			gtk_selection_data_set_pixbuf(selection_data, data);
			g_object_unref(data);
		}
		else
		{
			gtk_selection_data_set_text(selection_data, data, -1);
		}
	}
}
开发者ID:B0SB05,项目名称:Remmina,代码行数:31,代码来源:rdp_cliprdr.c


示例3: multi_msg_process_squadmsg_packet

// process incoming squadmate messaging info 
void multi_msg_process_squadmsg_packet(unsigned char *data, header *hinfo)
{	
	int command;
	ushort net_sig;
	short source_id;
	int source_index;
	char s_val;
	int offset = HEADER_LENGTH;

	// get all packet data
	GET_INT(command);
	GET_SHORT(source_id);
	GET_USHORT(net_sig);
	GET_DATA(s_val);
	PACKET_SET_SIZE();

	// determine who the order is from
	source_index = find_player_id(source_id);
	if(source_index == -1){
		nprintf(("Network","Received squadmsg order packet from unknown player!!\n"));
		return;
	}

	// display the squadmessage somehow
	multi_msg_show_squadmsg(&Net_players[source_index],command,net_sig,(int)s_val);
}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:27,代码来源:multi_pmsg.cpp


示例4: mrb_fltk_widget_activate_instance_method

// FLTK::Widget#activate
// Activate the widget.
mrb_value mrb_fltk_widget_activate_instance_method( mrb_state *mrb, mrb_value self ) {
  GET_DATA( fl_widget, Fl_Widget, self );

  fl_widget->activate();

  return self;
}
开发者ID:RyanScottLewis,项目名称:mruby-fltk,代码行数:9,代码来源:widget.cpp


示例5: remmina_rdp_call_feature

static void remmina_rdp_call_feature(RemminaProtocolWidget* gp, const RemminaProtocolFeature* feature)
{
    RemminaFile* remminafile;
    rfContext* rfi;

    rfi = GET_DATA(gp);
    remminafile = remmina_plugin_service->protocol_plugin_get_file(gp);

    switch (feature->id)
    {
    case REMMINA_RDP_FEATURE_UNFOCUS:
        remmina_rdp_event_unfocus(gp);
        break;

    case REMMINA_RDP_FEATURE_SCALE:
        rfi->scale = remmina_plugin_service->file_get_int(remminafile, "scale", FALSE);
        remmina_rdp_event_update_scale(gp);
        break;

    case REMMINA_RDP_FEATURE_TOOL_REFRESH:
        gtk_widget_queue_draw_area(rfi->drawing_area, 0, 0,
                                   remmina_plugin_service->protocol_plugin_get_width(gp),
                                   remmina_plugin_service->protocol_plugin_get_height(gp));
        break;

    default:
        break;
    }
}
开发者ID:posixx,项目名称:Remmina,代码行数:29,代码来源:rdp_plugin.c


示例6: main

int main(){  
  /*--- message ---*/
  printf("*********************************\n");
  printf("*** Use SGESV to solve Ax = B ***\n");
  printf("*********************************\n");
  printf("\n");
    
    
  /*--- open files that store data ---*/
  OPEN_FILE();

  
  /*--- read data ---*/
  GET_DATA();
  
  
  /*--- call lapack subroutine SGESV, note: ---*/  
  /*--- (1) all the arguments must be pointers ---*/ 
  /*--- (2) add an underscore to the routine name ---*/
  /*--- (3) matrices must be transformed into their Fortran vector formats ---*/ 
  SGESV_(&n, &nrhs, AT, &lda, IPIV, BT, &ldb, &info); 

  
  /*--- print the solution ---*/
  PRINT_SOLUTION();
  
  
  /*--- close files ---*/
  fclose(fptA);
  fclose(fptB);

  return 0;
}
开发者ID:kanika901,项目名称:lighthouse,代码行数:33,代码来源:2013111218_36_37.c


示例7: mrb_fltk_widget_redraw_instance_method

// FLTK::Widget#redraw
mrb_value mrb_fltk_widget_redraw_instance_method( mrb_state *mrb, mrb_value self ) {
  GET_DATA( fl_widget, Fl_Widget, self );

  fl_widget->redraw();

  return self;
}
开发者ID:RyanScottLewis,项目名称:mruby-fltk,代码行数:8,代码来源:widget.cpp


示例8: remmina_rdp_event_update_scale

void remmina_rdp_event_update_scale(RemminaProtocolWidget* gp)
{
	gint width, height;
	gint hscale, vscale;
	RemminaFile* remminafile;
	rfContext* rfi;

	rfi = GET_DATA(gp);
	remminafile = remmina_plugin_service->protocol_plugin_get_file(gp);

	width = remmina_plugin_service->protocol_plugin_get_width(gp);
	height = remmina_plugin_service->protocol_plugin_get_height(gp);
	hscale = remmina_plugin_service->file_get_int(remminafile, "hscale", 0);
	vscale = remmina_plugin_service->file_get_int(remminafile, "vscale", 0);

	if (rfi->scale)
	{
		gtk_widget_set_size_request(rfi->drawing_area,
			(hscale > 0 ? width * hscale / 100 : -1),
			(vscale > 0 ? height * vscale / 100 : -1));
	}
	else
	{
		gtk_widget_set_size_request(rfi->drawing_area, width, height);
	}

	remmina_plugin_service->protocol_plugin_emit_signal(gp, "update-align");
}
开发者ID:edvillan15,项目名称:Remmina,代码行数:28,代码来源:rdp_event.c


示例9: obj_get

Object obj_get(Object self, Object k) {
    Object v;
    switch (TM_TYPE(self)) {
    case TYPE_STR: {
        DictNode* node;
        if (TM_TYPE(k) == TYPE_NUM) {
            double d = GET_NUM(k);
            int n = d;
            if (n < 0) {
                n += GET_STR_LEN(self);
            }
            if (n >= GET_STR_LEN(self) || n < 0)
                tm_raise("String_get: index overflow ,len=%d,index=%d, str=%o",
                        GET_STR_LEN(self), n, self);
            return string_chr(0xff & GET_STR(self)[n]);
        } else if ((node = dict_get_node(GET_DICT(tm->str_proto), k)) != NULL) {
            return method_new(node->val, self);
        }
        break;
    }
    case TYPE_LIST:{
        DictNode* node;
        if (TM_TYPE(k) == TYPE_NUM) {
            return list_get(GET_LIST(self), GET_NUM(k));
        } else if ((node = dict_get_node(GET_DICT(tm->list_proto), k))!=NULL) {
            return method_new(node->val, self);
        }
        break;
    }
    case TYPE_DICT:{
        DictNode* node;
        node = dict_get_node(GET_DICT(self), k);
        if (node != NULL) {
            return node->val;
        } else if ((node = dict_get_node(GET_DICT(tm->dict_proto), k))!=NULL) {
            return method_new(node->val, self);
        }
        break;
    }
    case TYPE_FUNCTION:
        return get_func_attr(GET_FUNCTION(self), k);
    case TYPE_DATA:
        return GET_DATA(self)->get(GET_DATA(self), k);
    }
    tm_raise("keyError %o", k);
    return NONE_OBJECT;
}
开发者ID:xupingmao,项目名称:minipy,代码行数:47,代码来源:ops.c


示例10: remmina_rdp_event_update_cursor

static void remmina_rdp_event_update_cursor(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
	rfContext* rfi;

	rfi = GET_DATA(gp);

	gdk_window_set_cursor(gtk_widget_get_window(rfi->drawing_area), ui->cursor.cursor);
}
开发者ID:edvillan15,项目名称:Remmina,代码行数:8,代码来源:rdp_event.c


示例11: rb_outcome

VALUE rb_outcome(VALUE rb_obj)
{
	randvar_t *rv = NULL;
	
	GET_DATA(rb_obj, rv);

	return (*(outcome_func[RANDVAR_TYPE(rv)]))(rv);
}
开发者ID:m-rinaldi,项目名称:random_variable,代码行数:8,代码来源:random_variable.c


示例12: remmina_rdp_close_connection

static gboolean remmina_rdp_close_connection(RemminaProtocolWidget* gp)
{
	rfContext* rfi;
	freerdp* instance;


	rfi = GET_DATA(gp);
	instance = rfi->instance;

	if (rfi->thread)
	{
		pthread_cancel(rfi->thread);

		if (rfi->thread)
			pthread_join(rfi->thread, NULL);
	}

	pthread_mutex_destroy(&rfi->mutex);

	g_mutex_free(rfi->gmutex);
	g_cond_free(rfi->gcond);

	remmina_rdp_event_uninit(gp);
	remmina_plugin_service->protocol_plugin_emit_signal(gp, "disconnect");

	if (instance)
	{
		if ( rfi->connected ) {
			if (instance->context->channels)
				freerdp_channels_close(instance->context->channels, instance);
			freerdp_disconnect(instance);
			rfi->connected = False;
		}
	}

	if (rfi->rfx_context)
	{
		rfx_context_free(rfi->rfx_context);
		rfi->rfx_context = NULL;
	}

	if (instance)
	{
		/* Remove instance->context from gp object data to avoid double free */
		g_object_steal_data(G_OBJECT(gp), "plugin-data");

		if (instance->context->channels) {
			freerdp_channels_free(instance->context->channels);
			instance->context->channels = NULL;
		}

		freerdp_context_free(instance); /* context is rfContext* rfi */
		freerdp_free(instance);
		rfi->instance = NULL;
	}

	return FALSE;
}
开发者ID:Distrotech,项目名称:Remmina,代码行数:58,代码来源:rdp_plugin.c


示例13: testSendingResponse

		void testSendingResponse()
		{
			JsonQt::JsonRpc t;
			QSignalSpy spy(&t, SIGNAL(sendJson(const QString&)));
			t.sendResponse(QVariant(123), "foo");
			GET_DATA();
			QCOMPARE(data.value("result").toString(), QString("foo"));
			QCOMPARE(data.value("id").toInt(), 123);
		}
开发者ID:Eyepea,项目名称:xivo-gallifrey,代码行数:9,代码来源:JsonRpc.cpp


示例14: makeit

/*
 * Open the named file for read, create the cluster chain, return the
 * directory structure or NULL on error.
 */
int makeit(char *dosname,
	    char *longname,
	    void *arg0,
	    direntry_t *targetEntry)
{
	Stream_t *Target;
	CreateArg_t *arg = (CreateArg_t *) arg0;
	int fat;
	direntry_t subEntry;	

	/* will it fit? At least one cluster must be free */
	if (!getfreeMinClusters(targetEntry->Dir, 1))
		return -1;
	
	mk_entry(dosname, ATTR_DIR, 1, 0, arg->mtime, &targetEntry->dir);
	Target = OpenFileByDirentry(targetEntry);
	if(!Target){
		fprintf(stderr,"Could not open Target\n");
		return -1;
	}

	/* this allocates the first cluster for our directory */

	initializeDirentry(&subEntry, Target);

	subEntry.entry = 1;
	GET_DATA(targetEntry->Dir, 0, 0, 0, &fat);
	if (fat == fat32RootCluster(targetEntry->Dir)) {
	    fat = 0;
	}
	mk_entry("..         ", ATTR_DIR, fat, 0, arg->mtime, &subEntry.dir);
	dir_write(&subEntry);

	FLUSH((Stream_t *) Target);
	subEntry.entry = 0;
	GET_DATA(Target, 0, 0, 0, &fat);
	mk_entry(".          ", ATTR_DIR, fat, 0, arg->mtime, &subEntry.dir);
	dir_write(&subEntry);

	mk_entry(dosname, ATTR_DIR | arg->attr, fat, 0, arg->mtime, 
		 &targetEntry->dir);
	arg->NewDir = Target;
	return 0;
}
开发者ID:BiancoZandbergen,项目名称:RTMINIX3,代码行数:48,代码来源:mmd.c


示例15: sftp_get_uint32

int
sftp_get_uint32(struct sftp_input *i, uint32_t *value)
{
  uint8_t buf[4];
  if (!GET_DATA(i, buf))
    return 0;

  *value = READ_UINT32(buf);
  return 1;
}
开发者ID:jeremyfrench,项目名称:lsh,代码行数:10,代码来源:buffer.c


示例16: mrb_fltk_widget_box_setter_instance_method

// FLTK::Widget#box=(value)
// Sets the box type.
// TODO: Tried to use IMPLEMENT_FIXNUM_ATTRIBUTE_ACCESSOR but got this:
//       candidate function not viable: no known conversion from 'int' to 'Fl_Boxtype' for 1st argument
mrb_value mrb_fltk_widget_box_setter_instance_method( mrb_state *mrb, mrb_value self ) {
  GET_DATA( fl_widget, Fl_Widget, self );

  mrb_value value;
  mrb_get_args( mrb, "i", &value );

  fl_widget->box( (Fl_Boxtype)mrb_fixnum( value ) );

  return value;
}
开发者ID:RyanScottLewis,项目名称:mruby-fltk,代码行数:14,代码来源:widget.cpp


示例17: sftp_get_uint64

int
sftp_get_uint64(struct sftp_input *i, off_t *value)
{
  uint8_t buf[8];
  if (!GET_DATA(i, buf))
    return 0;

  *value = READ_UINT64(buf);
  return 1;
}
开发者ID:jeremyfrench,项目名称:lsh,代码行数:10,代码来源:buffer.c


示例18: mrb_fltk_widget_x_setter_instance_method

// FLTK::Widget#x=(value)
mrb_value mrb_fltk_widget_x_setter_instance_method( mrb_state *mrb, mrb_value self ) {
  GET_DATA( fl_widget, Fl_Widget, self );

  mrb_value x;
  mrb_get_args( mrb, "i", &x );

  fl_widget->position( mrb_fixnum( x ), fl_widget->y() );

  return x;
}
开发者ID:RyanScottLewis,项目名称:mruby-fltk,代码行数:11,代码来源:widget.cpp


示例19: mrb_fltk_widget_y_setter_instance_method

// FLTK::Widget#y=(value)
mrb_value mrb_fltk_widget_y_setter_instance_method( mrb_state *mrb, mrb_value self ) {
  GET_DATA( fl_widget, Fl_Widget, self );

  mrb_value y;
  mrb_get_args( mrb, "i", &y );

  fl_widget->position( fl_widget->x(), mrb_fixnum( y ) );

  return y;
}
开发者ID:RyanScottLewis,项目名称:mruby-fltk,代码行数:11,代码来源:widget.cpp


示例20: testSendingSimpleRequest

		void testSendingSimpleRequest()
		{
			JsonQt::JsonRpc t;
			QSignalSpy spy(&t, SIGNAL(sendJson(const QString&)));
			t.sendRequest(QVariant(123), "foo");
			GET_DATA();
			QCOMPARE(data.value("method").toString(), QString("foo"));
			QCOMPARE(data.value("id").toInt(), 123);
			QVERIFY(!data.contains("params"));
		}
开发者ID:Eyepea,项目名称:xivo-gallifrey,代码行数:10,代码来源:JsonRpc.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GET_DATA_BIT函数代码示例发布时间:2022-05-30
下一篇:
C++ GET_CODE函数代码示例发布时间: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