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


C++ condition函数代码示例

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


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


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