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


C++ Doc::getDocuElements方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
    });


    //containsDerivedPart Tests
    LTest::addTest("containsDerivedPart() 1", [](){
        using Gen = Generator<parts::AutomaticTransmission>;
        LTAssert::False(Gen::containsPart<parts::Engine>());
        LTAssert::True(Gen::containsPart<parts::Transmission>());
        return true;
    });

    LTest::addTest("DSL1", [](){
        using Gen = DSL<EcoLine>;
        Gen test;
        return true;
    });


    LTest::addTest("DSL2", [](){
        using Gen= typename DSL<EcoLine>::Gen<>;
        LTAssert::True(Gen::containsPart<parts::Engine>());
        LTAssert::True(Gen::containsPart<parts::ElectroEngine>());
        LTAssert::False(Gen::containsPart<parts::GasEngine>());
        return true;
    });

    LTest::addTest("DSL3", [](){
        using Gen= typename DSL<EcoLine>::Gen<Generator, parts::GasEngine>;
        LTAssert::True(Gen::containsPart<parts::Engine>());
        LTAssert::True(Gen::containsPart<parts::ElectroEngine>());
        LTAssert::True(Gen::containsPart<parts::GasEngine>());
        return true;
    });

/*
    //must not compile: "Unknown DSLClass handling. The is no DSL specialization for given class"
    LTest::addTest("DSL4", [](){
        using Gen= typename DSL<DEADDSL>::Gen<>;
        return true;
    });
//*/

/*
    //must not compile: "Gas is not Eco"
    LTest::addTest("DSL5", [](){
        using Gen= typename DSL<StrictEcoLine>::Gen<parts::GasEngine>;
        return true;
    });
//*/

    LTest::addTest("DSL6", [](){
        using Gen= typename DSL<StrictEcoLine>::Gen<>;
        LTAssert::True(Gen::containsPart<parts::Engine>());
        LTAssert::True(Gen::containsPart<parts::ElectroEngine>());
        LTAssert::False(Gen::containsPart<parts::GasEngine>());
        return true;
    });

    LTest::addTest("DSL Part Reduce", [](){
        using Gen= typename DSL<StrictEcoLine, EcoLine>::Gen<>;
        LTAssert::True(Gen::containsPart<parts::Engine>());
        LTAssert::True(Gen::containsPart<parts::ElectroEngine>());
        LTAssert::False(Gen::containsPart<parts::GasEngine>());
        return true;
    });

    LTest::addTest("Doku Txt ausgabe", [](){
        using Doc = typename DSL<StrictEcoLine, EcoLine>::Gen<Documentation>;
        Doc docu;
        cout<<docu.getTxtDocu()<<endl;
        return true;
    });

    LTest::addTest("Docu Elements", [](){
        using Doc = typename DSL<StrictEcoLine, EcoLine>::Gen<Documentation>;
        Doc docu;
        auto docucontent = docu.getDocuElements();
        LTAssert::True(get<0>(docucontent.front()) == "ElectroEngine");
        LTAssert::True(get<1>(docucontent.front()) == "a engine driven by electric.");
        return true;
    });

    LTest::addTest("CreateDSLClass Macro", [](){
        using Gen= typename DSL<WoodenLine>::Gen<>;
        LTAssert::True(Gen::containsPart<parts::Engine>());
        LTAssert::True(Gen::containsPart<parts::GasEngine>());
        LTAssert::True(Gen::containsPart<parts::ManuelTransmission>());
        return true;
    });

    LTest::addTest("CreateDocuClass Macro", [](){
        using Doc= typename DSL<GoogleCar>::Gen<Documentation>;
        Doc docu;
        cout<<docu.getTxtDocu()<<endl;
        return true;
    });

    LTest::run();
    return 0;
}
开发者ID:IngoRoessner,项目名称:carGenTest,代码行数:101,代码来源:main.cpp


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