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


C++ DirectFunctionCall2函数代码示例

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


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

示例1: to_tsquery

Datum
to_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,代码来源:to_tsany.c

示例2: similarity_op

Datum
similarity_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,代码来源:trgm_op.c

示例3: gpupreagg_psum_x2_numeric

Datum
gpupreagg_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,代码来源:aggfuncs.c

示例4: compareNumeric

static int
compareNumeric(Numeric a, Numeric b)
{
	return	DatumGetInt32(
				DirectFunctionCall2(
					numeric_cmp,
					PointerGetDatum(a),
					PointerGetDatum(b)
				)
			);
}
开发者ID:kaplun,项目名称:jsquery,代码行数:11,代码来源:jsquery_op.c

示例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,代码来源:_int_op.c

示例6: tsq_mcontained

Datum
tsq_mcontained(PG_FUNCTION_ARGS)
{
	PG_RETURN_DATUM(
					DirectFunctionCall2(
										tsq_mcontains,
										PG_GETARG_DATUM(1),
										PG_GETARG_DATUM(0)
										)
		);
}
开发者ID:badalex,项目名称:postgresql-scratchpad,代码行数:11,代码来源:tsquery_op.c

示例7: tskey_cmp

static int
tskey_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,代码来源:btree_ts.c

示例8: pg_xlog_location_diff

/*
 * Compute the difference in bytes between two WAL locations.
 */
Datum
pg_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,代码来源:xlogfuncs.c

示例9: gbt_macadkey_cmp

static int
gbt_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,代码来源:btree_macaddr.c

示例10: gbt_time_penalty

Datum
gbt_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,代码来源:btree_time.c

示例11: gbt_time_dist

static float8
gbt_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,代码来源:btree_time.c

示例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
 */
Datum
gist_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,代码来源:gistproc.c

示例13: tsa_plainto_tsquery_name

/* plainto_tsquery(text, text) */
Datum
tsa_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,代码来源:tsearch2.c

示例14: spheretrans_point_inverse

Datum
spheretrans_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,代码来源:euler.c

示例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,代码来源:btree_interval.c


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