您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DirectFunctionCall2函数代码示例

51自学网 2021-06-01 20:27:59
  C++
这篇教程C++ DirectFunctionCall2函数代码示例写得很实用,希望能帮到您。

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

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

示例1: to_tsquery

Datumto_tsquery(PG_FUNCTION_ARGS){	text	   *in = PG_GETARG_TEXT_P(0);	Oid			cfgId;	cfgId = getTSCurrentConfig(true);	PG_RETURN_DATUM(DirectFunctionCall2(to_tsquery_byid,										ObjectIdGetDatum(cfgId),										PointerGetDatum(in)));}
开发者ID:Epictetus,项目名称:postgres,代码行数:11,


示例2: similarity_op

Datumsimilarity_op(PG_FUNCTION_ARGS){	float4		res = DatumGetFloat4(DirectFunctionCall2(														 similarity,														 PG_GETARG_DATUM(0),														 PG_GETARG_DATUM(1)														 ));	PG_RETURN_BOOL(res >= trgm_limit);}
开发者ID:Joe-xXx,项目名称:postgres-old-soon-decommissioned,代码行数:11,


示例3: gpupreagg_psum_x2_numeric

Datumgpupreagg_psum_x2_numeric(PG_FUNCTION_ARGS){	Assert(PG_NARGS() == 1);	if (PG_ARGISNULL(0))		PG_RETURN_NULL();	PG_RETURN_NUMERIC(DirectFunctionCall2(numeric_mul,										  PG_GETARG_DATUM(0),										  PG_GETARG_DATUM(0)));}
开发者ID:stalkerg,项目名称:devel,代码行数:11,


示例4: compareNumeric

static intcompareNumeric(Numeric a, Numeric b){	return	DatumGetInt32(				DirectFunctionCall2(					numeric_cmp,					PointerGetDatum(a),					PointerGetDatum(b)				)			);}
开发者ID:kaplun,项目名称:jsquery,代码行数:11,


示例5: _int_different

Datum_int_different(PG_FUNCTION_ARGS){	PG_RETURN_BOOL(!DatumGetBool(								 DirectFunctionCall2(													 _int_same,									   PointerGetDatum(PG_GETARG_POINTER(0)),										PointerGetDatum(PG_GETARG_POINTER(1))													 )								 ));}
开发者ID:50wu,项目名称:gpdb,代码行数:11,


示例6: tsq_mcontained

Datumtsq_mcontained(PG_FUNCTION_ARGS){	PG_RETURN_DATUM(					DirectFunctionCall2(										tsq_mcontains,										PG_GETARG_DATUM(1),										PG_GETARG_DATUM(0)										)		);}
开发者ID:badalex,项目名称:postgresql-scratchpad,代码行数:11,


示例7: tskey_cmp

static inttskey_cmp(const void *a, const void *b){	return DatumGetInt32(						 DirectFunctionCall2(											 timestamp_cmp,			  TimestampGetDatumFast(((TSKEY *) (((RIX *) a)->r))->lower),			   TimestampGetDatumFast(((TSKEY *) (((RIX *) b)->r))->lower)											 )		);}
开发者ID:sunyangkobe,项目名称:cscd43,代码行数:11,


示例8: pg_xlog_location_diff

/* * Compute the difference in bytes between two WAL locations. */Datumpg_xlog_location_diff(PG_FUNCTION_ARGS){	Datum		result;	result = DirectFunctionCall2(pg_lsn_mi,								 PG_GETARG_DATUM(0),								 PG_GETARG_DATUM(1));	PG_RETURN_NUMERIC(result);}
开发者ID:sangli00,项目名称:postgres,代码行数:14,


示例9: gbt_macadkey_cmp

static intgbt_macadkey_cmp(const void *a, const void *b){	return DatumGetInt32(						 DirectFunctionCall2(											 macaddr_cmp,										PointerGetDatum(&((Nsrt *) a)->t[0]),										 PointerGetDatum(&((Nsrt *) b)->t[0])											 )		);}
开发者ID:Khalefa,项目名称:VLDB12Demo,代码行数:11,


示例10: gbt_time_penalty

Datumgbt_time_penalty(PG_FUNCTION_ARGS){	timeKEY    *origentry = (timeKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);	timeKEY    *newentry = (timeKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(1))->key);	float	   *result = (float *) PG_GETARG_POINTER(2);	Interval   *intr;	double		res;	double		res2;	intr = DatumGetIntervalP(DirectFunctionCall2(												 time_mi_time,										  P_TimeADTGetDatum(newentry->upper),									   P_TimeADTGetDatum(origentry->upper)));	res = INTERVAL_TO_SEC(intr);	res = Max(res, 0);	intr = DatumGetIntervalP(DirectFunctionCall2(												 time_mi_time,										 P_TimeADTGetDatum(origentry->lower),										P_TimeADTGetDatum(newentry->lower)));	res2 = INTERVAL_TO_SEC(intr);	res2 = Max(res2, 0);	res += res2;	*result = 0.0;	if (res > 0)	{		intr = DatumGetIntervalP(DirectFunctionCall2(													 time_mi_time,										 P_TimeADTGetDatum(origentry->upper),									   P_TimeADTGetDatum(origentry->lower)));		*result += FLT_MIN;		*result += (float) (res / (res + INTERVAL_TO_SEC(intr)));		*result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1));	}	PG_RETURN_POINTER(result);}
开发者ID:CraigBryan,项目名称:PostgresqlFun,代码行数:41,


示例11: gbt_time_dist

static float8gbt_time_dist(const void *a, const void *b){	const TimeADT *aa = (const TimeADT *) a;	const TimeADT *bb = (const TimeADT *) b;	Interval	  *i;	i = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,											  TimeADTGetDatumFast(*aa),											  TimeADTGetDatumFast(*bb)));	return (float8) Abs(INTERVAL_TO_SEC(i));}
开发者ID:LittleForker,项目名称:postgres,代码行数:12,


示例12: gist_box_penalty

/* * The GiST Penalty method for boxes (also used for points) * * As in the R-tree paper, we use change in area as our penalty metric */Datumgist_box_penalty(PG_FUNCTION_ARGS){	GISTENTRY  *origentry = (GISTENTRY *) PG_GETARG_POINTER(0);	GISTENTRY  *newentry = (GISTENTRY *) PG_GETARG_POINTER(1);	float	   *result = (float *) PG_GETARG_POINTER(2);	Datum		ud;	ud = DirectFunctionCall2(rt_box_union, origentry->key, newentry->key);	*result = (float) (size_box(ud) - size_box(origentry->key));	PG_RETURN_POINTER(result);}
开发者ID:reith2004,项目名称:postgres,代码行数:17,


示例13: tsa_plainto_tsquery_name

/* plainto_tsquery(text, text) */Datumtsa_plainto_tsquery_name(PG_FUNCTION_ARGS){	text	   *cfgname = PG_GETARG_TEXT_P(0);	Datum		arg1 = PG_GETARG_DATUM(1);	Oid			config_oid;	config_oid = TextGetObjectId(regconfigin, cfgname);	return DirectFunctionCall2(plainto_tsquery_byid,							   ObjectIdGetDatum(config_oid), arg1);}
开发者ID:50wu,项目名称:gpdb,代码行数:13,


示例14: spheretrans_point_inverse

Datumspheretrans_point_inverse(PG_FUNCTION_ARGS){	Datum		sp = PG_GETARG_DATUM(0);	SEuler	   *se = (SEuler *) PG_GETARG_POINTER(1);	SEuler		tmp;	Datum		ret;	spheretrans_inverse(&tmp, se);	ret = DirectFunctionCall2(spheretrans_point,							  sp, PointerGetDatum(&tmp));	PG_RETURN_DATUM(ret);}
开发者ID:akorotkov,项目名称:pgsphere,代码行数:13,


示例15: abs_interval

Interval *abs_interval(Interval *a){	static Interval zero = {0, 0, 0};	if (DatumGetBool(DirectFunctionCall2(interval_lt,										 IntervalPGetDatum(a),										 IntervalPGetDatum(&zero))))		a = DatumGetIntervalP(DirectFunctionCall1(interval_um,												  IntervalPGetDatum(a)));	return a;}
开发者ID:GisKook,项目名称:Gis,代码行数:13,


示例16: gbox_same

/*** Equality method*/Datumgbox_same(PG_FUNCTION_ARGS){	BOX		   *b1 = (BOX *) PG_GETARG_POINTER(0);	BOX		   *b2 = (BOX *) PG_GETARG_POINTER(1);	bool	   *result = (bool *) PG_GETARG_POINTER(2);	if (b1 && b2)		*result = DatumGetBool(DirectFunctionCall2(box_same, PointerGetDatum(b1), PointerGetDatum(b2)));	else		*result = (b1 == NULL && b2 == NULL) ? TRUE : FALSE;	PG_RETURN_POINTER(result);}
开发者ID:sunyangkobe,项目名称:cscd43,代码行数:16,


示例17: pt_in_widget

Datumpt_in_widget(PG_FUNCTION_ARGS){	Point	   *point = PG_GETARG_POINT_P(0);	WIDGET	   *widget = (WIDGET *) PG_GETARG_POINTER(1);	float8		distance;	distance = DatumGetFloat8(DirectFunctionCall2(point_distance,												  PointPGetDatum(point),											PointPGetDatum(&widget->center)));	PG_RETURN_BOOL(distance < widget->radius);}
开发者ID:MasahikoSawada,项目名称:postgresql,代码行数:13,


示例18: interpt_pp

Datuminterpt_pp(PG_FUNCTION_ARGS){	PATH	   *p1 = PG_GETARG_PATH_P(0);	PATH	   *p2 = PG_GETARG_PATH_P(1);	int			i,				j;	LSEG		seg1,				seg2;	bool		found;			/* We've found the intersection */	found = false;				/* Haven't found it yet */	for (i = 0; i < p1->npts - 1 && !found; i++)	{		regress_lseg_construct(&seg1, &p1->p[i], &p1->p[i + 1]);		for (j = 0; j < p2->npts - 1 && !found; j++)		{			regress_lseg_construct(&seg2, &p2->p[j], &p2->p[j + 1]);			if (DatumGetBool(DirectFunctionCall2(lseg_intersect,												 LsegPGetDatum(&seg1),												 LsegPGetDatum(&seg2))))				found = true;		}	}	if (!found)		PG_RETURN_NULL();	/*	 * Note: DirectFunctionCall2 will kick out an error if lseg_interpt()	 * returns NULL, but that should be impossible since we know the two	 * segments intersect.	 */	PG_RETURN_DATUM(DirectFunctionCall2(lseg_interpt,										LsegPGetDatum(&seg1),										LsegPGetDatum(&seg2)));}
开发者ID:MasahikoSawada,项目名称:postgresql,代码行数:38,


示例19: gbt_date_penalty

Datumgbt_date_penalty(PG_FUNCTION_ARGS){	dateKEY    *origentry = (dateKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);	dateKEY    *newentry = (dateKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(1))->key);	float	   *result = (float *) PG_GETARG_POINTER(2);	int32		diff,				res;	diff = DatumGetInt32(DirectFunctionCall2(											 date_mi,											 DateADTGetDatum(newentry->upper),										 DateADTGetDatum(origentry->upper)));	res = Max(diff, 0);	diff = DatumGetInt32(DirectFunctionCall2(											 date_mi,										   DateADTGetDatum(origentry->lower),										  DateADTGetDatum(newentry->lower)));	res += Max(diff, 0);	*result = 0.0;	if (res > 0)	{		diff = DatumGetInt32(DirectFunctionCall2(												 date_mi,										   DateADTGetDatum(origentry->upper),										 DateADTGetDatum(origentry->lower)));		*result += FLT_MIN;		*result += (float) (res / ((double) (res + diff)));		*result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1));	}	PG_RETURN_POINTER(result);}
开发者ID:CraigBryan,项目名称:PostgresqlFun,代码行数:38,


示例20: size_box

static floatsize_box(Datum box){	if (DatumGetPointer(box) != NULL)	{		float		size;		DirectFunctionCall2(rt_box_size,							box, PointerGetDatum(&size));		return size;	}	else		return 0.0;}
开发者ID:sunyangkobe,项目名称:cscd43,代码行数:14,


示例21: to_tsquery_name

Datumto_tsquery_name(PG_FUNCTION_ARGS){	text	   *name = PG_GETARG_TEXT_P(0);	Datum		res;	SET_FUNCOID();	res = DirectFunctionCall2(to_tsquery,							  Int32GetDatum(name2id_cfg(name)),							  PG_GETARG_DATUM(1));	PG_FREE_IF_COPY(name, 0);	PG_RETURN_DATUM(res);}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:14,


示例22: ipaddr_cmp

Datumipaddr_cmp(PG_FUNCTION_ARGS){    IP_P ipp1 = PG_GETARG_IP_P(0);	IP_P ipp2 = PG_GETARG_IP_P(1);	IP ip1;	IP ip2;	int af1 = ip_unpack(ipp1, &ip1);	int af2 = ip_unpack(ipp2, &ip2);	int32 retval;	if (af1 != af2)	{		retval = (af1 > af2) ? 1 : -1;	}	else	{		switch (af1)		{			case PGSQL_AF_INET:				retval = DatumGetInt32(DirectFunctionCall2(ip4_cmp, IP4GetDatum(ip1.ip4), IP4GetDatum(ip2.ip4)));				break;			case PGSQL_AF_INET6:				retval = DatumGetInt32(DirectFunctionCall2(ip6_cmp, IP6PGetDatum(&ip1.ip6), IP6PGetDatum(&ip2.ip6)));				break;			default:				ipaddr_internal_error();		}	}	PG_FREE_IF_COPY(ipp1,0);	PG_FREE_IF_COPY(ipp2,1);    PG_RETURN_INT32(retval);}
开发者ID:RhodiumToad,项目名称:ip4r-historical,代码行数:37,


示例23: jnumber_op

static Jsonb *jnumber_op(PGFunction f, Jsonb *l, Jsonb *r){	FunctionCallInfoData fcinfo;	JsonbValue *jv;	Datum		n;	AssertArg(r != NULL);	if (!((l == NULL || JB_ROOT_IS_SCALAR(l)) && JB_ROOT_IS_SCALAR(r)))		ereport_op(f, l, r);	InitFunctionCallInfoData(fcinfo, NULL, 0, InvalidOid, NULL, NULL);	if (l != NULL)	{		jv = getIthJsonbValueFromContainer(&l->root, 0);		if (jv->type != jbvNumeric)			ereport_op(f, l, r);		fcinfo.arg[fcinfo.nargs] = NumericGetDatum(jv->val.numeric);		fcinfo.argnull[fcinfo.nargs] = false;		fcinfo.nargs++;	}	jv = getIthJsonbValueFromContainer(&r->root, 0);	if (jv->type != jbvNumeric)		ereport_op(f, l, r);	fcinfo.arg[fcinfo.nargs] = NumericGetDatum(jv->val.numeric);	fcinfo.argnull[fcinfo.nargs] = false;	fcinfo.nargs++;	n = (*f) (&fcinfo);	if (fcinfo.isnull)		elog(ERROR, "function %p returned NULL", (void *) f);	if (f == numeric_power || f == numeric_div)	{		int			s;		s = DatumGetInt32(DirectFunctionCall1(numeric_scale, fcinfo.arg[0])) +			DatumGetInt32(DirectFunctionCall1(numeric_scale, fcinfo.arg[1]));		if (s == 0)			n = DirectFunctionCall2(numeric_trunc, n, 0);	}	return numeric_to_jnumber(DatumGetNumeric(n));}
开发者ID:protodef,项目名称:agens-graph,代码行数:49,


示例24: _numeric_weighted_mean_final

Datum_numeric_weighted_mean_final(PG_FUNCTION_ARGS){	WeightedMeanInternalState *state;	Datum		total;	Datum		zero = make_numeric(0);	state = PG_ARGISNULL(0)			? NULL			: (WeightedMeanInternalState *) PG_GETARG_POINTER(0);	/* No row has ever been processed. */	if (state == NULL)		return zero;	if (DatumGetBool(DirectFunctionCall2(numeric_eq,										 zero, state->running_weight)))		total = zero;	else		total = DirectFunctionCall2(numeric_div,									state->running_sum, state->running_weight);	PG_RETURN_NUMERIC(total);}
开发者ID:cbrichford,项目名称:weighted_stats,代码行数:24,


示例25: ipaddr_transform_2d

static inlineIP_Pipaddr_transform_2d(Datum d1, Datum d2, PGFunction ip4func, PGFunction ip6func){    IP_P ipp = DatumGetIP_P(d1);	IP ip;	int af = ip_unpack(ipp, &ip);	switch (af)	{		case PGSQL_AF_INET:			ip.ip4 = DatumGetIP4(DirectFunctionCall2(ip4func, IP4GetDatum(ip.ip4), d2));			break;		case PGSQL_AF_INET6:			ip.ip6 = *(DatumGetIP6P(DirectFunctionCall2(ip6func, IP6PGetDatum(&ip.ip6), d2)));			break;		default:			ipaddr_internal_error();	}    return ip_pack(af, &ip);}
开发者ID:RhodiumToad,项目名称:ip4r-historical,代码行数:24,


示例26: ipaddr_minus_ipaddr

Datumipaddr_minus_ipaddr(PG_FUNCTION_ARGS){    Datum minuend = PG_GETARG_DATUM(0);    Datum subtrahend = PG_GETARG_DATUM(1);    Datum res;	IP ip1;	IP ip2;	int af1 = ip_unpack(DatumGetIP_P(minuend), &ip1);	int af2 = ip_unpack(DatumGetIP_P(subtrahend), &ip2);	if (af1 != af2)		ereport(ERROR,				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),				 errmsg("invalid mixing of IP address families")));					switch (af1)	{		case PGSQL_AF_INET:			res = DirectFunctionCall2(numeric_sub,									  DirectFunctionCall1(ip4_cast_to_numeric,IP4GetDatum(ip1.ip4)),									  DirectFunctionCall1(ip4_cast_to_numeric,IP4GetDatum(ip2.ip4)));			break;		case PGSQL_AF_INET6:			res = DirectFunctionCall2(numeric_sub,									  DirectFunctionCall1(ip6_cast_to_numeric,IP6PGetDatum(&ip1.ip6)),									  DirectFunctionCall1(ip6_cast_to_numeric,IP6PGetDatum(&ip2.ip6)));			break;		default:			ipaddr_internal_error();	}    PG_RETURN_DATUM(res);}
开发者ID:RhodiumToad,项目名称:ip4r-historical,代码行数:36,


示例27: gbt_ts_dist

static float8gbt_ts_dist(const void *a, const void *b){	const Timestamp *aa = (const Timestamp *) a;	const Timestamp *bb = (const Timestamp *) b;	Interval   *i;	if (TIMESTAMP_NOT_FINITE(*aa) || TIMESTAMP_NOT_FINITE(*bb))		return get_float8_infinity();	i = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,											  TimestampGetDatumFast(*aa),											  TimestampGetDatumFast(*bb)));	return (float8) Abs(INTERVAL_TO_SEC(i));}
开发者ID:42penguins,项目名称:postgres,代码行数:15,



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


C++ DirectFunctionCall3函数代码示例
C++ DirectFunctionCall1函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。