这篇教程C++ Bar函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Bar函数的典型用法代码示例。如果您正苦于以下问题:C++ Bar函数的具体用法?C++ Bar怎么用?C++ Bar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Bar函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main() { Foo F; Foo *F2 = new Foo(); new Foo(); Foo(); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: creating a temporary object of type 'Foo' is prohibited Foo F3 = Foo(); // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: creating a temporary object of type 'Foo' is prohibited Bar(); NS::Bar();// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: creating a temporary object of type 'NS::Bar' is prohibited int A = func(Foo()); // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: creating a temporary object of type 'Foo' is prohibited Foo F4(0); Foo *F5 = new Foo(0); new Foo(0); Foo(0); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: creating a temporary object of type 'Foo' is prohibited Foo F6 = Foo(0); // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: creating a temporary object of type 'Foo' is prohibited Bar(0); NS::Bar(0);// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: creating a temporary object of type 'NS::Bar' is prohibited int B = func(Foo(0)); // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: creating a temporary object of type 'Foo' is prohibited}
开发者ID:ingowald,项目名称:llvm-project,代码行数:31,
示例2: decodeint64_t decode(void *buffer, size_t size, int64_t sum){ unsigned int i; C(table_t) foobarcontainer; FooBar(vec_t) list; FooBar(table_t) foobar; Bar(struct_t) bar; Foo(struct_t) foo; foobarcontainer = C(as_root(buffer)); sum += C(initialized(foobarcontainer)); sum += StringLen(C(location(foobarcontainer))); sum += C(fruit(foobarcontainer)); list = C(list(foobarcontainer)); for (i = 0; i < FooBar(vec_len(list)); ++i) { foobar = FooBar(vec_at(list, i)); sum += StringLen(FooBar(name(foobar))); sum += FooBar(postfix(foobar)); sum += (int64_t)FooBar(rating(foobar)); bar = FooBar(sibling(foobar)); sum += (int64_t)Bar(ratio(bar)); sum += Bar(size(bar)); sum += Bar(time(bar)); foo = Bar(parent(bar)); sum += Foo(count(foo)); sum += Foo(id(foo)); sum += Foo(length(foo)); sum += Foo(prefix(foo)); } return sum + 2 * sum;}
开发者ID:heibao,项目名称:flatcc,代码行数:31,
示例3: listIteratorvoid Data::parsePrices(QString page) { bool isPriceUpdated = false; // prices in the feed are from newest to oldest so we want the first Data::ctime = QDateTime::fromString(page.section("<latest_timestamp>",1,1).left(14), "yyyyMMddhhmmss"); if(cstyle%Constants::getStyle()->size() == 1) { dataBars = new QList<Bar>(); QStringListIterator listIterator(page.split("<bar>")); if(listIterator.hasNext()) { listIterator.next(); // skip the "0" index xmin = 999999; xmax = 0; ymin = 99999999; ymax = 0; } while(listIterator.hasNext()) { QString nextBar = listIterator.next(); QString lowStr = nextBar.section("<low>",1,1).section("</low>",0,0); QString highStr = nextBar.section("<high>",1,1).section("</high>",0,0); QString closeStr = nextBar.section("<close>",1,1).section("</close>",0,0); if(closeStr != "") { if(lowStr.toDouble() < ymin) ymin = lowStr.toDouble(); if(highStr.toDouble() > ymax) ymax = highStr.toDouble(); dataBars->prepend(Bar(lowStr.toDouble(), highStr.toDouble(), closeStr.toDouble())); } else { dataBars->prepend(Bar()); } if(!isPriceUpdated && closeStr.toDouble() > 0) { isPriceUpdated = true; lastChartPrice = closeStr.toDouble(); } } xmax = dataBars->size()+1.5; } else if(cstyle%Constants::getStyle()->size() == 0) { dataPoints = new QList<double>(); QStringListIterator listIterator(page.split("<point>")); if(listIterator.hasNext()) { listIterator.next(); // skip the "0" index xmin = 999999; xmax = 0; ymin = 999999; ymax = 0; } while(listIterator.hasNext()) { QString nextPoint = listIterator.next(); QString priceStr = nextPoint.section("<price>",1,1).section("</price>",0,0); if(priceStr != "") { if(priceStr.toDouble() < ymin) ymin = priceStr.toDouble(); if(priceStr.toDouble() > ymax) ymax = priceStr.toDouble(); dataPoints->prepend(priceStr.toDouble()); } else { dataPoints->prepend(-1); } if(!isPriceUpdated && priceStr.toDouble() > 0) { isPriceUpdated = true; lastChartPrice = priceStr.toDouble(); } } xmax = dataPoints->size()+1.5; } xmin = 0; double ydiff = ymax - ymin; ymin = ymin-ydiff/20; ymax = ymax+ydiff/20; // 'callback' to chart to update once the data is parsed chart->update();}
开发者ID:szymonwartak,项目名称:NokiaBV,代码行数:60,
示例4: mainint main(){ My my; Bar(my); // OK My2 my2; Bar(my2); // Compile error: no type named ‘foo’ in ‘struct My2’ return 0;}
开发者ID:CCJY,项目名称:coliru,代码行数:8,
示例5: barvoid bar(){ std::cout << "========== Bar ==============/n"; Bar b = Bar() + Bar(); std::cout << "=============================/n";}
开发者ID:gary109,项目名称:cppblog,代码行数:9,
示例6: TESTTEST(MatchingContainers, Foo){ MockFoo foo; EXPECT_CALL(foo, Bar(ElementsAre(1, Gt(0), _, 5))); EXPECT_CALL(foo, Bar(UnorderedElementsAre(2, 3))); const vector<int> a{1, 2, 3, 5}; foo.Bar(a); const vector<int> b{3, 2}; foo.Bar(b);}
开发者ID:Junch,项目名称:StudyCppUTest,代码行数:12,
示例7: mainint main(){ Bar bar = Bar(); bar.Bartender(); return 0;}
开发者ID:matanl,项目名称:Study-Books,代码行数:7,
示例8: Barvoid tst_QHash::dont_need_default_constructor(){ QHash<int, Bar> hash1; for (int i = 0; i < 100; ++i) { hash1.insert(i, Bar(2 * i)); QVERIFY(hash1.value(i, Bar(-1)).j == 2 * i); QVERIFY(hash1.size() == i + 1); } QHash<QString, Bar> hash2; for (int i = 0; i < 100; ++i) { hash2.insert(QString::number(i), Bar(2 * i)); QVERIFY(hash2.value(QString::number(i), Bar(-1)).j == 2 * i); QVERIFY(hash2.size() == i + 1); }}
开发者ID:husninazer,项目名称:qt,代码行数:16,
示例9: LoadDatabasevoid LoadDatabase(QueryResult * pResult){ pResult = SD2Database.PQuery( "SELECT flag, data0, data1, CatId, C.name, destid " "FROM sd2p_npc_tele_category C, sd2p_npc_tele_association A " "WHERE C.id = CatId ORDER BY C.name, CatId"); VCategorie.clear(); if (pResult) { outstring_log("SD2P: Chargement /"sd2p_npc_tele_category/" et /"sd2p_npc_tele_association/"..."); barGoLink Bar(pResult->GetRowCount()); uint32 CatId = 0; uint32 NbDest = 0; bool IsValidCat = true; bool FirstTime = true; do { Bar.step(); Field * pFields = pResult->Fetch(); if (!GetDestination(pFields[5].GetUInt32())) { outstring_log("SD2P >> Destination introuvable (DestID: %u).", pFields[5].GetUInt32()); continue; } if (!IsValidCat && CatId == pFields[3].GetUInt32() && !FirstTime) continue; IsValidCat = true; FirstTime = false; if (!IsValidData(pFields[3].GetUInt32(), (Flag_t)pFields[0].GetUInt8(), pFields[1].GetUInt64(), pFields[2].GetUInt32())) { IsValidCat = false; CatId = pFields[3].GetUInt32(); continue; } if (CatId != pFields[3].GetUInt32()) { CatId = pFields[3].GetUInt32(); Categorie Cat (CatId, pFields[4].GetCppString(), (Flag_t)pFields[0].GetUInt8(), pFields[1].GetUInt64(), pFields[2].GetUInt32()); VCategorie.push_back(Cat); } VCategorie.back().AddDest(pFields[5].GetUInt32()); ++NbDest; } while (pResult->NextRow()); delete pResult; outstring_log(""); outstring_log(">> %u npc_teleport charge(s).", NbDest); } else outstring_log("WARNING >> 0 npc_teleport charge.");}
开发者ID:benoit934,项目名称:scriptdev2,代码行数:60,
示例10: mainint main(){ Bar Bar(1); class Bar Bar2(2); // elaborated type printf("hello");}
开发者ID:CCJY,项目名称:coliru,代码行数:7,
示例11: mainint main(){ union union_64 param1, param2; param1._uint8[0]=0xde; param1._uint8[1]=0xad; param1._uint8[2]=0xbe; param1._uint8[3]=0xef; param1._uint8[4]=0xde; param1._uint8[5]=0xad; param1._uint8[6]=0xbe; param1._uint8[7]=0xef; param2._uint8[0]=0xde; param2._uint8[1]=0xad; param2._uint8[2]=0xbe; param2._uint8[3]=0xef; param2._uint8[4]=0xde; param2._uint8[5]=0xad; param2._uint8[6]=0xbe; param2._uint8[7]=0x7f; Bar(param1.i64, param2.i64); return 0;}
开发者ID:alugupta,项目名称:resilient-systems,代码行数:26,
示例12: CcDraw/********************************************************************** Function: WORD CcDraw(CUSTOM *pCc)** PreCondition: object must be created before this is called** Input: pCc - pointer to struct CUSTOM with data** Output: returns the status of the drawing* 0 - not complete* 1 - done** Overview: draws control** Note: THIS FUNCTION CALL SHOULD BE ADDED INTO GOLDraw() FUNCTION IN* GOL.C FILE*********************************************************************/WORD CcDraw(CUSTOM *pCc){ typedef enum { REMOVE, BOX_DRAW, RUN_DRAW } CC_DRAW_STATES; static CC_DRAW_STATES state = REMOVE; switch(state) { case REMOVE: if(GetState(pCc, CC_HIDE)) { SetColor(pCc->pGolScheme->CommonBkColor); if(!Bar(pCc->left, pCc->top, pCc->right, pCc->bottom)) return (0); return (1); } state = BOX_DRAW; case BOX_DRAW: if(GetState(pCc, CC_DRAW)) { GOLPanelDraw ( pCc->left, pCc->top, pCc->right, pCc->bottom, pCc->pGolScheme->Color0, pCc->pGolScheme->EmbossDkColor, pCc->pGolScheme->EmbossLtColor, NULL, GOL_EMBOSS_SIZE ); } else { state = BAR_DRAW; goto bar_draw; } state = RUN_DRAW; case RUN_DRAW: if(!GOLPanelDrawTsk()) { return (0); } // DRAWING IS DONE state = REMOVE; return (1); }}
开发者ID:WilliamAvila,项目名称:PIC32MX460F512L_Examples,代码行数:76,
示例13: Footemplate<int I> void Foo () { const int cst = global; auto lam0 = [&]() -> void { auto lam1 = [&]() -> void { cst; }; Bar (cst); };}
开发者ID:MaxKellermann,项目名称:gcc,代码行数:8,
示例14: Bazint Baz (int const *ptr, int *ptr2){ Baz (ptr2); // { dg-error "ambiguous" } Bar (ptr2); // { dg-error "ambiguous" } Foo (ptr2); // { dg-error "ambiguous" } Qux (ptr2); // { dg-error "ambiguous" } return 0;}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:8,
示例15: Foovoid Foo(int number) { Bar(); if (::testing::Test::HasFatalFailure()) return FailTest(); ASSERT_TRUE(number != 3);}
开发者ID:czerniecki-wojciech,项目名称:cmake_magisterka,代码行数:8,
示例16: Foovoid Foo( int a, int b, int c, int d){ printf( "Foo: calling Bar.../n"); Bar( a ); printf( "Foo: %d, %d, %d, %d/n", a,b,c,d );}
开发者ID:alagenchev,项目名称:school_code,代码行数:8,
示例17: mainint main(){ int i = 1; i = 1; while(i < 0) i++; i = Foo(Bar()) + 5; return 0;}
开发者ID:8l,项目名称:rose,代码行数:8,
示例18: mainint main(){ std::vector<Bar> v; v.push_back(Bar()); Bar b = fcn3(v.begin(), v.end()); ; ;}
开发者ID:GlennPallad,项目名称:Cpp-Primer,代码行数:8,
示例19: mainint main() { // Foo foo = anotherWay(); // foo's pointer now points to something on the stack that is not there any more. // foo.print(); // Bar bar = anotherBar(); Bar bar = Bar("Hundeprute"); bar.print();}
开发者ID:BJDev95,项目名称:ardupilot-cellular-extension,代码行数:9,
示例20: Backgroundvoid VScroller::Redraw(IntCoord x1, IntCoord y1, IntCoord x2, IntCoord y2) { IntCoord bot; int height; Background(x1, y1, x2, y2); GetBarInfo(shown, bot, height); Bar(bot, height); Outline(bot, height);}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:9,
示例21: CreateAnimation/************************************************************************ Function: void CreateAnimation(void) Overview: Creates the animation screen. Input: none Output: none************************************************************************/void CreateAnimation(void){ SHORT j, height, endPoint; // free memory for the objects in the previous linked list and start new list GOLFree(); SetColor(SCREEN_BACKGROUND_COLOR); ClearDevice(); // draw the band of lines with increasing thickness background of the demo height = 13; endPoint = GetMaxY() - 35; SetColor(RGB565CONVERT(0x4C, 0x8E, 0xFF)); for(j = 2; j <= endPoint; j += (height + 6)) { WAIT_UNTIL_FINISH(Bar(0, j, GetMaxX(), j + height)); if(height <= 0) height = 0; else height -= 1; } pPicture = PictCreate ( ID_PICTURE1, // ID PICTURE_XINDENT, PICTURE_YINDENT, PICTURE_XINDENT + PICTURE_WIDTH - 1, PICTURE_YINDENT + PICTURE_HEIGHT - 1, PICT_DRAW, // will be dislayed, has frame 2, // scale factor is x1 (void *) &Engine1, // bitmap altScheme ); // default GOL scheme pMeter = MtrCreate ( ID_METER2, (2 * PICTURE_XINDENT + PICTURE_WIDTH), PICTURE_YINDENT - 20, (2 * (PICTURE_XINDENT + PICTURE_WIDTH)), PICTURE_YINDENT + PICTURE_HEIGHT + 20, MTR_DRAW | MTR_RING | MTR_ACCURACY, // draw normal meter object MAX_METER_VALUE, // set initial value 0, MAX_METER_VALUE, // set range (void *) &GOLFontDefault, // Title font to be used (void *) &GOLMediumFont, // Value font to be used MeterStr, // meterScheme ); // alternative GOL scheme //pMeter->pTitleFont = (void*)&GOLFontDefault; //pMeter->pValueFont = (void*)&GOLMediumFont; // create the demo navigation/control buttons CreateCtrlButtons(ExitStr, ScaleStr, LeftArrowStr, RightArrowStr);}
开发者ID:huleg,项目名称:Microchip,代码行数:66,
示例22: Barvoid Bar( int a, int b, int c, int d ){ if ( done == 0 ) { done = 1; Bar(a+20, b+20, c+20, d+20); } printf( "Bar: %d, %d, %d, %d/n", a,b,c,d );}
开发者ID:alugupta,项目名称:resilient-systems,代码行数:10,
示例23: mainint main(){ unsigned long sp; sp = getSP(); printf( "Application stack pointer = 0x%lx/n", sp ); Bar(); return 0;}
开发者ID:alagenchev,项目名称:school_code,代码行数:11,
示例24: GetBarInfovoid VScroller::Update() { IntCoord oldbottom, oldtop, newbottom, newtop; int oldheight, newheight; Perspective* p; if (canvas == nil) { return; } p = view; GetBarInfo(shown, oldbottom, oldheight); GetBarInfo(p, newbottom, newheight); if (oldbottom != newbottom || oldheight != newheight) { oldtop = oldbottom+oldheight-1; newtop = newbottom+newheight-1; if (oldtop >= newbottom && newtop >= oldbottom) { if (oldtop > newtop) { Background(inset, newtop+1, xmax-inset, oldtop); Border(newtop); } else if (oldtop < newtop) { Bar(oldtop, newtop-oldtop); Sides(oldtop, newtop); Border(newtop); } if (oldbottom > newbottom) { Bar(newbottom+1, oldbottom-newbottom); Sides(newbottom, oldbottom); Border(newbottom); } else if (oldbottom < newbottom) { Background(inset, oldbottom, xmax-inset, newbottom-1); Border(newbottom); } } else { Background(inset, oldbottom, xmax-inset, oldtop); Bar(newbottom, newheight); Outline(newbottom, newheight); } } *shown = *p;}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:39,
示例25: g// CHECK: define void @_Z1g3Foo(%struct.Foo* %foo)void g(Foo foo) { // CHECK: call void @_ZN3BarC1Ev // CHECK: @_ZNK3BarcvRK3FooEv // CHECK: call void @_Z1f3Foo f(Bar()); // CHECK: call void @_ZN3FooC1Ev // CHECK: call void @_Z1f3Foo f(Foo()); // CHECK: call void @_ZN3FooC1ERKS_ // CHECK: call void @_Z1f3Foo f(foo); // CHECK: ret}
开发者ID:FrOSt-Foundation,项目名称:clang,代码行数:14,
示例26: PrepareDemoPage/***************************************** * void PrepareDemoPage(XCHAR *pText) *****************************************/void PrepareDemoPage(XCHAR *pText){ SetColor(WHITE); Bar(26, 40, GetMaxX()-26, GetMaxY()-1); if ( pText ) { WINDOW * pMainWin = (WINDOW*)GOLFindObject(ID_WINDOW1); WndSetText(pMainWin, pText); SetState(pMainWin, WND_DRAW_TITLE); WndDraw(pMainWin); } }
开发者ID:Athuli7,项目名称:Microchip,代码行数:16,
示例27: updateBarsvoid Spectrograph::updateBars(){ m_bars.fill(Bar()); FrequencySpectrum::const_iterator i = m_spectrum.begin(); const FrequencySpectrum::const_iterator end = m_spectrum.end(); for ( ; i != end; ++i) { const FrequencySpectrum::Element e = *i; if (e.frequency >= m_lowFreq && e.frequency < m_highFreq) { Bar &bar = m_bars[barIndex(e.frequency)]; bar.value = qMax(bar.value, e.amplitude); bar.clipped |= e.clipped; } } update();}
开发者ID:InfernalAd,项目名称:infernalad-lipsync,代码行数:15,
示例28: updateBars//刷新频谱barvoid Spectrograph::updateBars(){ m_bars.fill(Bar()); //遍历频谱参数 for (FrequencySpectrum::const_iterator iter = m_spectrum.begin(); iter != m_spectrum.end(); ++iter) { const FrequencySpectrum::Element element = *iter; //如果进过快速傅里叶过的频谱参数大于等于频谱下界小于频谱上界则进行以下操作 if (element.frequency >= m_lowFreq && element.frequency < m_highFreq) { Bar &bar = m_bars[barIndex(element.frequency)]; bar.value = qMax(bar.value, element.amplitude); //频谱bar振幅范围 bar.clipped |= element.clipped; } } update();}
开发者ID:Beenking,项目名称:CZPlayer2.0,代码行数:19,
注:本文中的Bar函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BarUiMsg函数代码示例 C++ Banner函数代码示例 |