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


C++ set_t函数代码示例

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


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

示例1: faked_env

/*if msg is set -> it will fake the env. vars conforming with the msg; if NULL
 * the env. will be restore to original */
static inline void faked_env( struct cell *t,struct sip_msg *msg)
{
	static struct cell *backup_t;
	static struct usr_avp **backup_list;
	static struct socket_info* backup_si;
	static int backup_route_type;

	if (msg) {
		swap_route_type( backup_route_type, FAILURE_ROUTE);
		/* tm actions look in beginning whether transaction is
		 * set -- whether we are called from a reply-processing 
		 * or a timer process, we need to set current transaction;
		 * otherwise the actions would attempt to look the transaction
		 * up (unnecessary overhead, refcounting)
		 */
		/* backup */
		backup_t = get_t();
		/* fake transaction */
		set_t(t);
		/* make available the avp list from transaction */
		backup_list = set_avp_list( &t->user_avps );
		/* set default send address to the saved value */
		backup_si = bind_address;
		bind_address = t->uac[0].request.dst.send_sock;
	} else {
		/* restore original environment */
		set_t(backup_t);
		set_route_type( backup_route_type );
		/* restore original avp list */
		set_avp_list( backup_list );
		bind_address = backup_si;
	}
}
开发者ID:iamroger,项目名称:voip,代码行数:35,代码来源:t_reply.c

示例2: t_lookup_ident

int t_lookup_ident(struct cell ** trans, unsigned int hash_index, unsigned int label)
{
    struct cell* p_cell;

    if(hash_index >= TABLE_ENTRIES){
		LOG(L_ERR,"ERROR: t_lookup_ident: invalid hash_index=%u\n",hash_index);
		return -1;
    }

    LOCK_HASH(hash_index);

    /* all the transactions from the entry are compared */
    for ( p_cell = get_tm_table()->entrys[hash_index].first_cell;
	  p_cell; p_cell = p_cell->next_cell ) 
    {
		if(p_cell->label == label){
			REF_UNSAFE(p_cell);
    			UNLOCK_HASH(hash_index);
			set_t(p_cell);
			*trans=p_cell;
			DBG("DEBUG: t_lookup_ident: transaction found\n");
			return 1;
		}
    }
	
	UNLOCK_HASH(hash_index);
	set_t(0);
	*trans=p_cell;

	DBG("DEBUG: t_lookup_ident: transaction not found\n");
    
    return -1;
}
开发者ID:winer632,项目名称:openimscore-code,代码行数:33,代码来源:t_lookup.c

示例3: cond_t

static inline void cond_t(int cond)
{
    if (cond)
        set_t();
    else
        clr_t();
}
开发者ID:kleberwilliam,项目名称:virtuoso,代码行数:7,代码来源:op.c

示例4: Model

 ParamPolicy_3<P1, P2, P3>::ParamPolicy_3(const ParamPolicy_3 &rhs)
     : Model(rhs),
       prm1_(rhs.prm1_->clone()),
       prm2_(rhs.prm2_->clone()),
       prm3_(rhs.prm3_->clone()) {
   set_t();
 }
开发者ID:cran,项目名称:Boom,代码行数:7,代码来源:ParamPolicy_3.hpp

示例5: new_t

static inline int new_t(struct sip_msg *p_msg)
{
	struct cell *new_cell;

	/* for ACK-dlw-wise matching, we want From-tags */
	if (p_msg->REQ_METHOD==METHOD_INVITE && parse_from_header(p_msg)<0) {
			LOG(L_ERR, "ERROR: new_t: no valid From in INVITE\n");
			return E_BAD_REQ;
	}
	/* make sure uri will be parsed before cloning */
	if (parse_sip_msg_uri(p_msg)<0) {
		LOG(L_ERR, "ERROR: new_t: uri invalid\n");
		return E_BAD_REQ;
	}
			
	/* add new transaction */
	new_cell = build_cell( p_msg ) ;
	if  ( !new_cell ){
		LOG(L_ERR, "ERROR: new_t: out of mem:\n");
		return E_OUT_OF_MEM;
	} 

	insert_into_hash_table_unsafe( new_cell, p_msg->hash_index );
	set_t(new_cell);
	INIT_REF_UNSAFE(T);
	/* init pointers to headers needed to construct local
	   requests such as CANCEL/ACK
	*/
	init_new_t(new_cell, p_msg);
	return 1;
}
开发者ID:winer632,项目名称:openimscore-code,代码行数:31,代码来源:t_lookup.c

示例6: set_t

 ParamPolicy_1<P> & ParamPolicy_1<P>::operator=
 (const ParamPolicy_1 &rhs){
   if(&rhs != this){
     prm_ = rhs.prm_->clone();
     set_t();
   }
   return *this;
 }
开发者ID:MarkEdmondson1234,项目名称:Boom,代码行数:8,代码来源:ParamPolicy_1.hpp

示例7: prm1_

 ParamPolicy_4<P1, P2, P3, P4>::ParamPolicy_4()
   : prm1_(),
     prm2_(),
     prm3_(),
     prm4_()
   {
     set_t();
   }
开发者ID:Hkey1,项目名称:boom,代码行数:8,代码来源:ParamPolicy_4.hpp

示例8: Model

 ParamPolicy_4<P1, P2, P3, P4>::ParamPolicy_4(const ParamPolicy_4 &rhs)
   : Model(rhs),
     prm1_(rhs.prm1_->clone()),
     prm2_(rhs.prm2_->clone()),
     prm3_(rhs.prm3_->clone()),
     prm4_(rhs.prm4_->clone())
   {
     set_t();
   }
开发者ID:Hkey1,项目名称:boom,代码行数:9,代码来源:ParamPolicy_4.hpp

示例9: retransmission_handler

inline static void retransmission_handler( struct timer_link *retr_tl )
{
	struct retr_buf* r_buf ;
	enum lists id;

	r_buf = get_retr_timer_payload(retr_tl);
#ifdef EXTRA_DEBUG
	if (r_buf->my_T->damocles) {
		LM_ERR("transaction %p scheduled for deletion and"
			" called from RETR timer\n",r_buf->my_T);
		abort();
	}
#endif

	/* the transaction is already removed from RETRANSMISSION_LIST by timer*/
	/* re-transmission */
	if ( r_buf->activ_type==TYPE_LOCAL_CANCEL
		|| r_buf->activ_type==TYPE_REQUEST ) {
			LM_DBG("retransmission_handler : request resending"
				" (t=%p, %.9s ... )\n", r_buf->my_T, r_buf->buffer.s);
			set_t(r_buf->my_T);
			SEND_BUFFER( r_buf );
			/*if (SEND_BUFFER( r_buf )==-1) {
				reset_timer( &r_buf->fr_timer );
				fake_reply(r_buf->my_T, r_buf->branch, 503 );
				return;
			}*/
			set_t(T_UNDEFINED);
	} else {
			LM_DBG("retransmission_handler : reply resending "
				"(t=%p, %.9s ... )\n", r_buf->my_T, r_buf->buffer.s);
			set_t(r_buf->my_T);
			t_retransmit_reply(r_buf->my_T);
			set_t(T_UNDEFINED);
	}

	id = r_buf->retr_list;
	r_buf->retr_list = id < RT_T2 ? id + 1 : RT_T2;

	retr_tl->timer_list= NULL; /* set to NULL so that set_timer will work */
	set_timer( retr_tl, id < RT_T2 ? id + 1 : RT_T2, 0 );

	LM_DBG("retransmission_handler : done\n");
}
开发者ID:AndreiPlesa,项目名称:opensips,代码行数:44,代码来源:timer.c

示例10: crossings

int crossings(int x0, int y0, struct coef ray)
{
	int i, x3, y3, w3, n0;
	int d1, d2;
	double t, t1;
	
	n0 = 0;
	
	for (i = 0 ; i < num_points ; ++i) {
		x3 = coefs[i].b * ray.c - coefs[i].c * ray.b;
		y3 = -coefs[i].a * ray.c + coefs[i].c * ray.a;
		w3 = coefs[i].a * ray.b - coefs[i].b * ray.a;

		if (w3 == 0)
			continue;

		x3 /= w3;
		y3 /= w3;

		t = set_t(x0, y0, x0 + 1, y0, x3, y3);

		if (t < 0)
			continue;
		
		t1 = t;
		t = set_t(points[i].x, points[i].y, points[i+1].x, points[i+1].y, x3, y3);
			
		if (t <= 0 || t > 1)
			continue;

		if (t == 1) {
			d1 = ray.a * points[i].x + ray.b * points[i].y + ray.c;
			d2 = ray.a * points[i+2].x + ray.b * points[i+2].y + ray.c;
		
			if ((((d1 > 0) && (d2 > 0)) || ((d1 < 0) && (d2 < 0))))
				continue;
		}

		s[n0++] = t1;
	}

	return n0;
}
开发者ID:ipozgaj,项目名称:playground_sources,代码行数:43,代码来源:poly2.c

示例11: w_t_lookup_cancel

inline static int w_t_lookup_cancel(struct sip_msg* msg, char* str, char* str2)
{
	struct cell *ret;
	if (msg->REQ_METHOD==METHOD_CANCEL) {
		ret = t_lookupOriginalT( msg );
		DBG("lookup_original: t_lookupOriginalT returned: %p\n", ret);
		if (ret != T_NULL_CELL) {
			/* The cell is reffed by t_lookupOriginalT, but T is not set.
			So we must unref it before returning. */
			UNREF(ret);
			set_t(T_UNDEFINED);
			return 1;
		}
		set_t(T_UNDEFINED);
	} else {
		LOG(L_WARN, "WARNING: script error t_lookup_cancel() called for non-CANCEL request\n");
	}
	return -1;
}
开发者ID:Gaoithe,项目名称:openimscore_ims,代码行数:19,代码来源:tm.c

示例12: set_t

 ParamPolicy_3<P1, P2, P3> &ParamPolicy_3<P1, P2, P3>::operator=(
     const ParamPolicy_3 &rhs) {
   if (&rhs != this) {
     prm1_ = rhs.prm1_->clone();
     prm2_ = rhs.prm2_->clone();
     prm3_ = rhs.prm3_->clone();
     set_t();
   }
   return *this;
 }
开发者ID:cran,项目名称:Boom,代码行数:10,代码来源:ParamPolicy_3.hpp

示例13: helper_fcmp_gt_FT

void helper_fcmp_gt_FT(uint32_t t0, uint32_t t1)
{
    CPU_FloatU f0, f1;
    f0.l = t0;
    f1.l = t1;

    if (float32_compare(f0.f, f1.f, &env->fp_status) == 1)
	set_t();
    else
	clr_t();
}
开发者ID:Leecheolhee,项目名称:VSSIM,代码行数:11,代码来源:op_helper.c

示例14: helper_fcmp_gt_DT

void helper_fcmp_gt_DT(uint64_t t0, uint64_t t1)
{
    CPU_DoubleU d0, d1;
    d0.ll = t0;
    d1.ll = t1;

    if (float64_compare(d0.d, d1.d, &env->fp_status) == 1)
	set_t();
    else
	clr_t();
}
开发者ID:Leecheolhee,项目名称:VSSIM,代码行数:11,代码来源:op_helper.c

示例15: helper_fcmp_gt_DT

void helper_fcmp_gt_DT(CPUSH4State *env, float64 t0, float64 t1)
{
    int relation;

    set_float_exception_flags(0, &env->fp_status);
    relation = float64_compare(t0, t1, &env->fp_status);
    if (unlikely(relation == float_relation_unordered)) {
        update_fpscr(env, GETPC());
    } else if (relation == float_relation_greater) {
        set_t(env);
    } else {
        clr_t(env);
    }
}
开发者ID:Flyalay,项目名称:kernel-qemu-pci,代码行数:14,代码来源:op_helper.c


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