本文整理汇总了C++中Components::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Components::size方法的具体用法?C++ Components::size怎么用?C++ Components::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Components
的用法示例。
在下文中一共展示了Components::size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testLcidFilters
void ComponentsUnitTests::testLcidFilters()
{
Components components;
ComponentPtr component_currentlcid(new MsiComponent());
component_currentlcid->os_filter_lcid = L"1040";
ComponentPtr component_anotherlcid(new MsiComponent());
component_anotherlcid->os_filter_lcid = L"!1040";
components.add(component_currentlcid);
components.add(component_anotherlcid);
Assert::IsTrue(components.size() == 2);
Assert::IsTrue(components.GetSupportedComponents(LcidUser, SequenceInstall).size() == 1);
}
示例2: testPAFilters
void ComponentsUnitTests::testPAFilters()
{
Components components;
ComponentPtr component_currentpa(new MsiComponent());
component_currentpa->processor_architecture_filter = L"mips";
ComponentPtr component_anotherpa(new MsiComponent());
component_anotherpa->processor_architecture_filter = L"x86,x64";
components.add(component_currentpa);
components.add(component_anotherpa);
Assert::IsTrue(components.size() == 2);
Assert::IsTrue(components.GetSupportedComponents(LcidUser, SequenceInstall).size() == 1);
Assert::IsTrue(get(components.GetSupportedComponents(LcidUser, SequenceInstall)[0]) == get(component_anotherpa));
}
示例3: testAdd
void ComponentsUnitTests::testAdd()
{
Components components;
ComponentPtr component1(new CmdComponent());
component1->id = DVLib::GenerateGUIDStringW();
ComponentPtr component2(new CmdComponent());
component2->id = DVLib::GenerateGUIDStringW();
components.add(component1);
components.add(component2);
Assert::IsTrue(components.size() == 2);
Assert::IsTrue(components.contains(component1->id));
Assert::IsTrue(components.contains(component2->id));
Assert::IsTrue(! components.contains(DVLib::GenerateGUIDStringW()));
}
示例4: SM
TagWriter::TagWriter(const c2lang::SourceManager& SM_, const Components& components)
: SM(SM_)
, currentFile(0)
{
for (unsigned c=0; c<components.size(); c++) {
const ModuleList& mods = components[c]->getModules();
for (unsigned m=0; m<mods.size(); m++) {
const AstList& modFiles = mods[m]->getFiles();
for (unsigned i=0; i<modFiles.size(); i++) {
analyse(*modFiles[i]);
}
}
}
}
示例5: testOsFilters
void ComponentsUnitTests::testOsFilters()
{
Components components;
ComponentPtr component1(new MsiComponent());
component1->os_filter = L"!winXP";
ComponentPtr component2(new MsiComponent());
component2->os_filter = L"winXPsp1";
ComponentPtr component3(new MsiComponent());
component3->os_filter = L"winXP";
ComponentPtr component4(new MsiComponent());
components.add(component1);
components.add(component2);
components.add(component3);
components.add(component4);
Assert::IsTrue(components.size() == 4);
Assert::IsTrue(components.GetSupportedComponents(LcidUser, SequenceInstall).size() == 2);
}
示例6: testOsFiltersGreaterSmaller
void ComponentsUnitTests::testOsFiltersGreaterSmaller()
{
Components components;
ComponentPtr component1(new MsiComponent());
component1->os_filter_min = winNone;
component1->os_filter_max = winXPMax;
ComponentPtr component2(new MsiComponent());
component2->os_filter_min = winXP;
component2->os_filter_max = winServer2003Max;
ComponentPtr component3(new MsiComponent());
component3->os_filter_min = winXP;
component3->os_filter_max = winNone;
components.add(component1);
components.add(component2);
components.add(component3);
Assert::IsTrue(components.size() == 3);
Assert::IsTrue(components.GetSupportedComponents(LcidUser, SequenceInstall).size() == 1);
}
示例7: search
auto search(uint32_t limit, const PrimeNumbers &primes) {
const size_t iteration_limit = 10000;
auto initial = initial_candidate(limit, primes);
Components components = {initial, initial};
for(size_t i=0;components.size() && i<iteration_limit;++i,components=next(components,initial,limit,primes)) {
auto fraction = quotient(components);
if(is_permuted_pair(fraction.p(),fraction.q())) {
if(!util::test_mode()) {
fmt::print("[{}] {}x{} -> {} ({})\n",i,
*components[0],
*components[1],
fraction,
static_cast<double>(fraction));
}
return std::make_tuple(true,fraction);
};
}
return std::make_tuple(false,quotient(Components{}));
}