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


C++ Manifest::begin方法代码示例

本文整理汇总了C++中Manifest::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Manifest::begin方法的具体用法?C++ Manifest::begin怎么用?C++ Manifest::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manifest的用法示例。


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

示例1: testManifest

void ManifestTest::testManifest()
{
    Manifest<MfTestBase> manifest;
    assert (manifest.empty());
    assert (manifest.size() == 0);
    assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject1")));
    assert (!manifest.empty());
    assert (manifest.size() == 1);
    assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject2")));
    MetaObject<MfTestObject, MfTestBase>* pMeta = new MetaObject<MfTestObject, MfTestBase>("MfTestObject2");
    assert (!manifest.insert(pMeta));
    delete pMeta;
    assert (!manifest.empty());
    assert (manifest.size() == 2);
    assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject3")));
    assert (manifest.size() == 3);

    assert (manifest.find("MfTestObject1") != manifest.end());
    assert (manifest.find("MfTestObject2") != manifest.end());
    assert (manifest.find("MfTestObject3") != manifest.end());
    assert (manifest.find("MfTestObject4") == manifest.end());

    std::set<std::string> classes;

    Manifest<MfTestBase>::Iterator it = manifest.begin();
    assert (it != manifest.end());
    classes.insert(it->name());
    ++it;
    assert (it != manifest.end());
    classes.insert(it->name());
    ++it;
    assert (it != manifest.end());
    classes.insert(it->name());
    it++;
    assert (it == manifest.end());

    assert (classes.find("MfTestObject1") != classes.end());
    assert (classes.find("MfTestObject2") != classes.end());
    assert (classes.find("MfTestObject3") != classes.end());

    manifest.clear();
    assert (manifest.empty());
    assert (manifest.size() == 0);
    assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject4")));
    assert (!manifest.empty());
    assert (manifest.size() == 1);
    it = manifest.begin();
    assert (it != manifest.end());
    assert (std::string(it->name()) == "MfTestObject4");
    ++it;
    assert (it == manifest.end());
}
开发者ID:ConfusedReality,项目名称:pkg_network_poco,代码行数:52,代码来源:ManifestTest.cpp

示例2:

void
write_manifest(ostream& os)
{
	os << "@prefix lv2: <http://lv2plug.in/ns/lv2core#> ." << endl;
	os << "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> ." << endl;
	os << "@prefix uiext: <http://lv2plug.in/ns/extensions/ui#> ." << endl << endl;
	for (Manifest::iterator i = manifest.begin(); i != manifest.end(); ++i) {
		Record& r = i->second;
		os << "<" << i->first << ">\n\ta lv2:Plugin ;" << endl;
		os << "\trdfs:seeAlso <" << r.base_name << ".ttl> ;" << endl;
		os << "\tlv2:binary <" << r.base_name << ".so> ";
		for (Record::UIs::iterator j = r.uis.begin(); j != r.uis.end(); ++j)
			os << ";" << endl << "\tuiext:ui <" << *j << "> ";
		os << "." << endl << endl;
	}
}
开发者ID:moddevices,项目名称:mda-lv2,代码行数:16,代码来源:gendata.cpp


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