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


C++ FilterManager::getFilterChainIDs方法代码示例

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


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

示例1: T_replaceFilter

int FilterManagerTEST::T_replaceFilter() {
    int fail = 0;
    logger->trace("==============================");

    logger->trace("Testing replaceFilter():");
    logger->trace(" Test under custom ID mode...");
    FilterManager* fm = new FilterManager("fm");
    logger->trace("  Using factory, making 4 general filters...");
    Filter* f1,*f2,*f3,*f4,*f5,*f6,*f7,*f8;
    f1 = FilterFactory::createFilter();
    f2 = FilterFactory::createFilter();
    f3 = FilterFactory::createFilter();
    f4 = FilterFactory::createFilter();
    f5 = FilterFactory::createNullImgFilter();
    f6 = FilterFactory::createNullFPGAFilter();
    f7 = FilterFactory::createFilter();
    f8 = FilterFactory::createFilter();
    logger->trace("  Inserting f1 as \"task 3\" to FRONT...");
    fm->insertFilter("task 3",f1,"FRONT");
    logger->trace("  Inserting f2 as \"task 1\"...");
    fm->insertFilter("task 1",f2,"task 3");
    logger->trace("  Inserting f3 as \"task 2\" between f1,f2...");
    fm->insertFilter("task 2",f3,"task 3");
    logger->trace("  Inserting f4 as \"task 4\" to REAR...");
    fm->insertFilter("task 4",f4);
    logger->trace("  Replacing \"task 3\" with f5 under key \"task 5\"...");
    fm->replaceFilter("task 5",f5,"task 3");
    logger->trace("  Replacing \"FRONT\" with f2 under key \"task 6\"...");
    fm->replaceFilter("task 6",f6,"FRONT");
    logger->trace("  Using getFilterChainIDs()...");
    std::vector<std::string> list = fm->getFilterChainIDs();
    std::string res;
    for (std::vector<std::string>::iterator it = list.begin(); it != list.end(); it++)
        res += " "+*it;
    logger->trace("   "+res);
    if (res == " task 6 task 2 task 5 task 4")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, list unexpected");
        fail += 1;
    }
    logger->trace("  Try replacing w/ non unique ID...");
    res = std::to_string(fm->replaceFilter("task 5",f7,"task 5"));
    logger->trace("    error code: "+res);
    if (res == "2")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
    }
    logger->trace("  Try replacing out of range...");
    res = std::to_string(fm->replaceFilter("task 8",f8,"what task?"));
    logger->trace("    error code: "+res);
    if (res == "1")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
    }
    logger->trace("  Try replacing using auto ID mode...");
    res = std::to_string(fm->replaceFilter(f8,"task 2"));
    logger->trace("    error code: "+res);
    if (res == "4")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
    }
    delete fm;
    delete f7;
    delete f8;

    logger->trace(" Test under auto ID mode...");
    fm = new FilterManager("fm",1);
    logger->trace("  Using factory...");
//	Filter* f1,*f2,*f3,*f4,*f5,*f6,*f7,*f8;
    f1 = FilterFactory::createFilter();
    f2 = FilterFactory::createFilter();
    f3 = FilterFactory::createFilter();
    f4 = FilterFactory::createFilter();
    f5 = FilterFactory::createNullImgFilter();
    f6 = FilterFactory::createNullFPGAFilter();
    f7 = FilterFactory::createFilter();
    f8 = FilterFactory::createFilter();
    logger->trace("  Inserting f1 to FRONT...");
    fm->insertFilter(f1,"FRONT");
    logger->trace("  Inserting f2...");
    fm->insertFilter(f2);
    logger->trace("  Inserting f3 between f1,f2...");
    fm->insertFilter(f3,"2 GenericFilter");
    logger->trace("  Inserting f4 to REAR...");
    fm->insertFilter(f4,"REAR");
    logger->trace("  Replacing \"2 GenericFilter\" with f5...");
    fm->replaceFilter(f5,"2 GenericFilter");
    logger->trace("  Replacing \"FRONT\" with f6...");
    fm->replaceFilter(f6,"FRONT");
    logger->trace("  Using getFilterChainIDs()...");
    list = fm->getFilterChainIDs();
    res = "";
    for (std::vector<std::string>::iterator it = list.begin(); it != list.end(); it++)
//.........这里部分代码省略.........
开发者ID:James534,项目名称:Tempest,代码行数:101,代码来源:FilterManagerTEST.cpp

示例2: T_insertFilter

int FilterManagerTEST::T_insertFilter() {
    int fail = 0;
    logger->trace("==============================");

    logger->trace("Testing insertFilter():");
    logger->trace(" Test under custom ID mode...");
    FilterManager* fm = new FilterManager("fm");
    logger->trace("  Using factory, making 4 general filters...");
    Filter* f1,*f2,*f3,*f4,*f5;
    f1 = FilterFactory::createFilter();
    f2 = FilterFactory::createFilter();
    f3 = FilterFactory::createFilter();
    f4 = FilterFactory::createFilter();
    f5 = FilterFactory::createFilter();
    logger->trace("  Inserting f1 as \"task 3\" to FRONT...");
    fm->insertFilter("task 3",f1,"FRONT");
    logger->trace("  Inserting f2 as \"task 1\"...");
    fm->insertFilter("task 1",f2,"task 3");
    logger->trace("  Inserting f3 as \"task 2\" between f1,f2...");
    fm->insertFilter("task 2",f3,"task 3");
    logger->trace("  Inserting f4 as \"task 4\" to REAR...");
    fm->insertFilter("task 4",f4);
    logger->trace("  Using getFilterChainIDs()...");
    std::vector<std::string> list = fm->getFilterChainIDs();
    std::string res;
    for (std::vector<std::string>::iterator it = list.begin(); it != list.end(); it++)
        res += " "+*it;
    logger->trace("   "+res);
    if (res == " task 1 task 2 task 3 task 4")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, list unexpected");
        fail += 1;
    }
    logger->trace("  Try inserting w/ non unique ID...");
    res = std::to_string(fm->insertFilter("task 2",f5));
    logger->trace("    error code: "+res);
    if (res == "2")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
    }
    logger->trace("  Try inserting out of range...");
    res = std::to_string(fm->insertFilter("task 2",f5,"what task?"));
    logger->trace("    error code: "+res);
    if (res == "1")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
    }
    logger->trace("  Try inserting with no filterID arg...");
    res = std::to_string(fm->insertFilter(f5,"Task 2"));
    logger->trace("    error code: "+res);
    if (res == "4")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
    }
    delete f5;
    delete fm;

    logger->trace(" Test under auto ID mode...");
    fm = new FilterManager("fm",1);
    logger->trace("  Using factory, making 4 general filters...");
    f1 = FilterFactory::createFilter();
    f2 = FilterFactory::createFilter();
    f3 = FilterFactory::createFilter();
    f4 = FilterFactory::createFilter();
    f5 = FilterFactory::createFilter();
    logger->trace("  Inserting f1 to FRONT...");
    fm->insertFilter(f1,"FRONT");
    logger->trace("  Inserting f2...");
    fm->insertFilter(f2);
    logger->trace("  Inserting f3 between f1,f2...");
    fm->insertFilter(f3,"2 GenericFilter");
    logger->trace("  Inserting f4 to REAR...");
    fm->insertFilter(f4,"REAR");
    res = "";
    logger->trace("  Using getFilterChainIDs()...");
    list = fm->getFilterChainIDs();
    for (std::vector<std::string>::iterator it = list.begin(); it != list.end(); it++)
        res += " "+*it;
    logger->trace("   "+res);
    if (res == " 1 GenericFilter 3 GenericFilter 2 GenericFilter 4 GenericFilter")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, list unexpected");
        fail += 1;
    }
    logger->trace("  Try inserting w/ custom ID...");
    res = std::to_string(fm->insertFilter("task 2",f5));
    logger->trace("    error code: "+res);
    if (res == "0")
        logger->trace("    ok");
    else {
        logger->warn("    NOT ok, incorrect error");
        fail += 1;
//.........这里部分代码省略.........
开发者ID:James534,项目名称:Tempest,代码行数:101,代码来源:FilterManagerTEST.cpp


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