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

C++ condition函数代码示例

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

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



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

示例1: while

Node* List::search(bool (*condition)(const void* el)) {
	Node *tmp = head, *result = 0;
	while(tmp){
		if (condition(tmp)) {
			result = tmp;
			break;
		}
		tmp = tmp->next;
	}
	return result;
}
开发者ID:jakwuh,项目名称:bsu,代码行数:11,代码来源:list.cpp


示例2: FXArray_Find_Unsafe

_Use_decl_annotations_
OVS_FXARRAY_ITEM* FXArray_Find_Unsafe(const OVS_FIXED_SIZED_ARRAY* pArray, FXArrayCondition condition, const VOID* pCondData)
{
    OVS_FXARRAY_ITEM* pOutItem = NULL;

    OVS_FXARRAY_FOR_EACH(pArray, pCurItem, /*if*/ condition(pCurItem, (UINT_PTR)pCondData),
        pOutItem = OVS_REFCOUNT_REFERENCE(pCurItem)
        );

    return pOutItem;
}
开发者ID:cloudbase,项目名称:openvswitch-hyperv-kernel,代码行数:11,代码来源:FixedSizedArray.c


示例3: ISOCPP_REPORT_STACK_DELEGATE_BEGIN

dds::core::cond::TCondition<org::opensplice::core::cond::ConditionDelegate>
org::opensplice::core::cond::ConditionDelegate::wrapper()
{
    ISOCPP_REPORT_STACK_DELEGATE_BEGIN(this);

    org::opensplice::core::cond::ConditionDelegate::ref_type ref =
            OSPL_CXX11_STD_MODULE::dynamic_pointer_cast<ConditionDelegate>(this->get_strong_ref());
    dds::core::cond::TCondition<org::opensplice::core::cond::ConditionDelegate> condition(ref);

    return condition;
}
开发者ID:osrf,项目名称:opensplice,代码行数:11,代码来源:ConditionDelegate.cpp


示例4: condition

void condition(int a, int b){
	
		 int i;
    if(x[a][b]==0){
		 for(i=1;i<=9;i++){
		 	if(check_legal(a,b,i)){
		 		x[a][b] = i;
		 		if(a==8 && b==8){
		 			print_x();
		 			total++;
                    return;
		 		}
		 		else{
		 			if(b==8){
		 				condition(a+1,0);
		 			}
		 			else{
		 				condition(a,b+1);
		 			}
		 		}
		 		x[a][b]=0;
		 	}
		 }
	}
	else{
		if(a==8&&b==8){
			print_x();
			total++;
			return;
		}
		else if(b==8){
		 	condition(a+1,0);
		}
		else{
		 	condition(a,b+1);
		}
	}

    return ;
	
}
开发者ID:jerryzj,项目名称:EE231002,代码行数:41,代码来源:006.c


示例5: int32_t

void *r_cmemcpy(int8_t *dest, int8_t *src, size_t n, int32_t (*condition)(void *))
{
	int32_t i;
        int32_t j = 0;
        for(i = 0; i <= n; i ++) {
                if(condition(src)) {
                        dest[j ++] = src[i];
                }
        }
        dest[j ++] = 0;
	return dest;
}
开发者ID:yangshh,项目名称:livenode,代码行数:12,代码来源:reach_os.c


示例6: backtrack

void backtrack(int *weight,int *value,int *answer,int step){
	if(step==N)
		display_outcome(answer,weight,value);
	else{
		int i;
		for(i=0;i<2;i++)
			if(condition(weight,answer,step,i)){
				answer[step]=i;
				backtrack(weight,value,answer,step+1);
			}
	}
}
开发者ID:BinVul,项目名称:data_struct_and_algorithms_using_C,代码行数:12,代码来源:01背包问题_递归.c


示例7: if

string BreakPoint::symbol() const
{
    char c;
    if (!enabled())
	c = '_';
    else if (!condition().empty() || ignore_count() != 0)
	c = '?';
    else
	c = '#';

    return c + itostring(number()) + c;
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:12,代码来源:BreakPoint.C


示例8: main

int main()
{
	f = fopen("s1.dat","r");
	int row, column;
					
	scan();	
	int i,j;


	condition(0,0);
	printf("\n\n total = %d\n\n",total);
	return 0;
}
开发者ID:jerryzj,项目名称:EE231002,代码行数:13,代码来源:006.c


示例9: condition

void MiscThreadTestCase::TestThreadConditions()
{
    wxMutex mutex;
    wxCondition condition(mutex);

    // otherwise its difficult to understand which log messages pertain to
    // which condition
    //wxLogTrace(wxT("thread"), wxT("Local condition var is %08x, gs_cond = %08x"),
    //           condition.GetId(), gs_cond.GetId());

    // create and launch threads
    MyWaitingThread *threads[10];

    size_t n;
    for ( n = 0; n < WXSIZEOF(threads); n++ )
    {
        threads[n] = new MyWaitingThread( &mutex, &condition );
    }

    for ( n = 0; n < WXSIZEOF(threads); n++ )
    {
        CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, threads[n]->Run() );
    }

    // wait until all threads run
    // NOTE: main thread is waiting for the other threads to start
    size_t nRunning = 0;
    while ( nRunning < WXSIZEOF(threads) )
    {
        CPPUNIT_ASSERT_EQUAL( wxSEMA_NO_ERROR, gs_cond.Wait() );

        nRunning++;

        // note that main thread is already running
    }

    wxMilliSleep(500);

#if 1
    // now wake one of them up
    CPPUNIT_ASSERT_EQUAL( wxCOND_NO_ERROR, condition.Signal() );
#endif

    wxMilliSleep(200);

    // wake all the (remaining) threads up, so that they can exit
    CPPUNIT_ASSERT_EQUAL( wxCOND_NO_ERROR, condition.Broadcast() );

    // give them time to terminate (dirty!)
    wxMilliSleep(500);
}
开发者ID:beanhome,项目名称:dev,代码行数:51,代码来源:misc.cpp


示例10: LOGD

void ExMysqlColumn::add_condition(const char* type,
                                  const char* operation,
                                  const int value)
{
    if(type == NULL)
    {
        LOGD("[GWJ] %s: [condition type] NULL ERROR!! ", __FUNCTION__);
        return;
    }

    WhereCondition condition(type, operation);
    condition.set_value(value);
    this->where_condition.push_back(condition);
}
开发者ID:zhengxiexie,项目名称:m,代码行数:14,代码来源:extend_column.cpp


示例11: doRepeat

/* analisa e traduz um REPEAT-UNTIL*/
void doRepeat()
{
	int l1, l2;

	match('r');
	l1 = newLabel();
        l2 = newLabel();
	postLabel(l1);
	block(l2);
	match('u');
	condition();
	emit("JZ L%d", l1);
	postLabel(l2);
}
开发者ID:rodrigoaustincascao,项目名称:ProjetoCompilador,代码行数:15,代码来源:EC_carac.c


示例12: backtrack

void backtrack(int *set,int *answer,int target,int step){
	if(step==N){
		if(getsizeok(answer,target))
			display_outcome(answer,set);
	}else{
		int i;
		for(i=0;i<2;i++){
			if(condition(answer,target,step,i)<=target){
				answer[step]=i;
				backtrack(set,answer,target,step+1);
			}
		}
	}
}
开发者ID:BinVul,项目名称:data_struct_and_algorithms_using_C,代码行数:14,代码来源:集合的K元子集_递归.c


示例13: base

void CachedNode::Debug::print() const
{
    CachedNode* b = base();
    char scratch[256];
    size_t index = snprintf(scratch, sizeof(scratch), "// char* mExport=\"");
    const UChar* ch = b->mExport.characters();
    while (ch && *ch && index < sizeof(scratch)) {
        UChar c = *ch++;
        if (c < ' ' || c >= 0x7f) c = ' ';
        scratch[index++] = c;
    }
    DUMP_NAV_LOGD("%.*s\"\n", index, scratch);
    DEBUG_PRINT_RECT(mBounds);
    DEBUG_PRINT_RECT(mHitBounds);
    DEBUG_PRINT_RECT(mOriginalAbsoluteBounds);
    const WTF::Vector<WebCore::IntRect>* rects = &b->mCursorRing;
    size_t size = rects->size();
    DUMP_NAV_LOGD("// IntRect cursorRings={ // size=%d\n", size);
    for (size_t i = 0; i < size; i++) {
        const WebCore::IntRect& rect = (*rects)[i];
        DUMP_NAV_LOGD("    // {%d, %d, %d, %d}, // %d\n", rect.x(), rect.y(),
            rect.width(), rect.height(), i);
    }
    DUMP_NAV_LOGD("// };\n");
    DUMP_NAV_LOGD("// void* mNode=%p; // (%d) \n", b->mNode, mNodeIndex);
    DUMP_NAV_LOGD("// void* mParentGroup=%p; // (%d) \n", b->mParentGroup, mParentGroupIndex);
    DUMP_NAV_LOGD("// int mDataIndex=%d;\n", b->mDataIndex);
    DUMP_NAV_LOGD("// int mIndex=%d;\n", b->mIndex);
    DUMP_NAV_LOGD("// int mNavableRects=%d;\n", b->mNavableRects);
    DUMP_NAV_LOGD("// int mParentIndex=%d;\n", b->mParentIndex);
    DUMP_NAV_LOGD("// int mTabIndex=%d;\n", b->mTabIndex);
    DUMP_NAV_LOGD("// Condition mCondition=%s;\n", condition(b->mCondition));
    DUMP_NAV_LOGD("// Type mType=%s;\n", type(b->mType));
    DEBUG_PRINT_BOOL(mClippedOut);
    DEBUG_PRINT_BOOL(mDisabled);
    DEBUG_PRINT_BOOL(mFixedUpCursorRects);
    DEBUG_PRINT_BOOL(mHasCursorRing);
    DEBUG_PRINT_BOOL(mHasMouseOver);
    DEBUG_PRINT_BOOL(mIsCursor);
    DEBUG_PRINT_BOOL(mIsFocus);
    DEBUG_PRINT_BOOL(mIsHidden);
    DEBUG_PRINT_BOOL(mIsInLayer);
    DEBUG_PRINT_BOOL(mIsParentAnchor);
    DEBUG_PRINT_BOOL(mIsTransparent);
    DEBUG_PRINT_BOOL(mIsUnclipped);
    DEBUG_PRINT_BOOL(mLast);
    DEBUG_PRINT_BOOL(mUseBounds);
    DEBUG_PRINT_BOOL(mUseHitBounds);
    DUMP_NAV_LOGD("\n");
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:50,代码来源:CachedNode.cpp


示例14: Moore_ngbh

int Moore_ngbh(generation_t *net, int i, int j) {
	int a, b, result = 0;
	for (a = i - 1; a <= i + 1; a++) {
		if (a < 0 || a >= net->rows)
			continue;
		for (b = j - 1; b <= j + 1; b++) {
			if ((a == i && b == j) || b < 0 || b >= net->cols)
				continue;
			if (condition(cell(net,a,b)) == ALIVE)
				result++;
		}
	}
	return result;
}
开发者ID:piotter121,项目名称:Life,代码行数:14,代码来源:sasiedztwo.c


示例15: condition

template<class HitTestCondition> TextureMapperLayer* TextureMapperLayer::hitTest(const FloatPoint& point, HitTestCondition condition)
{
    if (!m_state.visible || !m_state.contentsVisible)
        return 0;

    TextureMapperLayer* result = 0;
    for (int i = m_children.size() - 1; !result && i >= 0; --i)
        result = m_children[i]->hitTest(point, condition);

    if (result)
        return result;

    return condition(this, point) ? this : 0;
}
开发者ID:reaven15,项目名称:webkit,代码行数:14,代码来源:TextureMapperLayer.cpp


示例16: stack

ssize_t SharedBufferClient::numOfAvailableBuffer(bool lock)
{
    SharedBufferStack& stack( *mSharedStack );  
    
    if(lock)
    {
        BufferAllFreeCondition condition(this);
        status_t err = waitForCondition(condition);
        if (err != NO_ERROR)
            return 0;    
    }
     
    return stack.numofbuffer;
}
开发者ID:qingyue,项目名称:platform_frameworks,代码行数:14,代码来源:SharedBufferStack.cpp


示例17: get_ast_manager

 relation_mutator_fn * external_relation_plugin::mk_filter_equal_fn(const relation_base & r, 
     const relation_element & value, unsigned col) {
     if(!check_kind(r)) {
         return 0;
     }
     ast_manager& m = get_ast_manager();
     app_ref condition(m);
     expr_ref var(m);
     sort* relation_sort = get(r).get_sort();
     sort* column_sort = get_column_sort(col, relation_sort);
     var = m.mk_var(col, column_sort);
     condition = m.mk_eq(var, value);
     return mk_filter_interpreted_fn(r, condition);
 }
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:14,代码来源:dl_external_relation.cpp


示例18: conditionbox

pcl::ConditionOr<pcl::PointXYZ>::Ptr conditionbox(line linen){
    // Checks available: GT, GE, LT, LE, EQ.
pcl::ConditionOr<pcl::PointXYZ>::Ptr condition(new pcl::ConditionOr<pcl::PointXYZ>());
float xmin = std::min(linen.x0,linen.x1)-pose.x.stddev*a-b-pose.x.mean-pose.theta.stddev*c;
float xmax = std::max(linen.x0,linen.x1)+pose.x.stddev*a+b-pose.x.mean+pose.theta.stddev*c;
float ymin = std::min(-linen.y0,-linen.y1)-pose.y.stddev*a-b+pose.y.mean-pose.theta.stddev*c;
float ymax = std::max(-linen.y0,-linen.y1)+pose.y.stddev*a+b+pose.y.mean+pose.theta.stddev*c;
condition->addComparison(pcl::FieldComparison<pcl::PointXYZ>::ConstPtr(new pcl::FieldComparison<pcl::PointXYZ>("z", pcl::ComparisonOps::LT, xmin)));
condition->addComparison(pcl::FieldComparison<pcl::PointXYZ>::ConstPtr(new pcl::FieldComparison<pcl::PointXYZ>("z", pcl::ComparisonOps::GT, xmax)));
condition->addComparison(pcl::FieldComparison<pcl::PointXYZ>::ConstPtr(new pcl::FieldComparison<pcl::PointXYZ>("x", pcl::ComparisonOps::LT, ymin)));
condition->addComparison(pcl::FieldComparison<pcl::PointXYZ>::ConstPtr(new pcl::FieldComparison<pcl::PointXYZ>("x", pcl::ComparisonOps::GT, ymax)));
//std::cout << xmin << " " << xmax << " " << ymin << " " << ymax << std::endl;
 return condition;
}
开发者ID:nordic-robotics,项目名称:nord_pointcloud,代码行数:14,代码来源:evenmorecleverwallremoval.cpp


示例19: list_find_by_id_char

//Redefinición de método para buscar dentro de una lista por nombre
t_link_element* list_find_by_id_char(t_list *self, char* ID, bool(*condition)(void*, int), int* index) {
	t_link_element *element = self->head;
	int position = 0;

	while (element != NULL && !condition(element->data, ID)) {
		element = element->next;
		position++;
	}

	if (index != NULL) {
		*index = position;
	}

	return element;
}
开发者ID:NicolasGabrielPerez,项目名称:tpAprobado,代码行数:16,代码来源:nucleo-structs.c


示例20: condition_term

Ast::Condition* Parser::condition()
{
    Ast::Condition* left = condition_term();
    ++current;
    if(current->type != TokenType::Operator) {
        --current;
        return left;
    }
    const char op = current->getValue<char>();
    if(op != '&' && op != '|') {
        --current;
        return left;
    }
    return new Ast::Condition(left, condition(), op);
}
开发者ID:AnotherTest,项目名称:-English,代码行数:15,代码来源:TokenHandler.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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