本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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 ;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
示例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");
}
示例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;
}
示例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;
}