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


C++ ConfigurationType::getAttributeValue方法代码示例

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


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

示例1: initialize

void IFrameSrv::initialize()
{
    // find gui configuration
    std::vector < ConfigurationType > vectGui    = m_configuration->find("gui");
    std::vector < ConfigurationType > vectWindow = m_configuration->find("window");

    if(!vectGui.empty())
    {
        // find LayoutManager configuration
        std::vector < ConfigurationType > vectLayoutMng = vectGui.at(0)->find("frame");
        SLM_ASSERT("<frame> xml element must exist", !vectLayoutMng.empty());
        m_frameConfig = vectLayoutMng.at(0);
        this->initializeLayoutManager(m_frameConfig);

        // find menuBarBuilder configuration
        std::vector < ConfigurationType > vectMBBuilder = vectGui.at(0)->find("menuBar");
        if(!vectMBBuilder.empty())
        {
            m_menuBarConfig = vectMBBuilder.at(0);
            this->initializeMenuBarBuilder(m_menuBarConfig);

            m_hasMenuBar = true;
        }

        // find toolBarBuilder configuration
        std::vector < ConfigurationType > vectTBBuilder = vectGui.at(0)->find("toolBar");
        if(!vectTBBuilder.empty())
        {
            m_toolBarConfig = vectTBBuilder.at(0);
            this->initializeToolBarBuilder(m_toolBarConfig);

            m_hasToolBar = true;
        }
    }

    if(!vectWindow.empty())
    {
        ConfigurationType window = vectWindow.at(0);
        std::string onclose      = window->getAttributeValue("onclose");
        if ( !onclose.empty() )
        {
            m_closePolicy = onclose;
        }
        SLM_ASSERT("Invalid onclose value : " << m_closePolicy << ". Should be 'exit', 'notify' or 'message'",
                   m_closePolicy == CLOSE_POLICY_NOTIFY || m_closePolicy == CLOSE_POLICY_EXIT
                   || m_closePolicy == CLOSE_POLICY_MESSAGE);
    }

    m_viewRegistrar = ::fwGui::registrar::ViewRegistrar::New(this->getID());
    // find ViewRegistryManager configuration
    std::vector < ConfigurationType > vectRegistrar = m_configuration->find("registry");
    if(!vectRegistrar.empty())
    {
        m_registrarConfig = vectRegistrar.at(0);
        m_viewRegistrar->initialize(m_registrarConfig);
    }
}
开发者ID:fw4spl-org,项目名称:fw4spl,代码行数:57,代码来源:IFrameSrv.cpp

示例2: attribute

 BOOST_FOREACH( ConfigurationType menu, vectMenus)
 {
     SLM_ASSERT("<menu> tag must have sid attribute", menu->hasAttribute("sid"));
     if(menu->hasAttribute("sid"))
     {
         bool start = false;
         if(menu->hasAttribute("start"))
         {
             std::string startValue = menu->getAttributeValue("start");
             SLM_ASSERT("Wrong value '"<< startValue <<"' for 'start' attribute (require yes or no)",
                     startValue == "yes" || startValue == "no");
             start = (startValue=="yes");
         }
         std::string sid = menu->getAttributeValue("sid");
         OSLM_ASSERT("Action " << sid << " already exists for this toolBar", m_menuSids.find(sid) == m_menuSids.end());
         m_menuSids[sid] = SIDToolBarMapType::mapped_type(index, start);
     }
     index++;
 }
开发者ID:corentindesfarges,项目名称:fw4spl,代码行数:19,代码来源:ToolBarRegistrar.cpp

示例3: initializeLayoutManager

void IGuiContainerSrv::initializeLayoutManager(ConfigurationType layoutConfig)
{
    OSLM_ASSERT("Bad configuration name "<<layoutConfig->getName()<< ", must be layout",
            layoutConfig->getName() == "layout");
    SLM_ASSERT("<layout> tag must have type attribute", layoutConfig->hasAttribute("type"));
    const std::string layoutManagerClassName = layoutConfig->getAttributeValue("type");

    ::fwGui::GuiBaseObject::sptr guiObj = ::fwGui::factory::New(layoutManagerClassName);
    m_viewLayoutManager = ::fwGui::layoutManager::IViewLayoutManager::dynamicCast(guiObj);
    OSLM_ASSERT("ClassFactoryRegistry failed for class "<< layoutManagerClassName, m_viewLayoutManager);

    m_viewLayoutManager->initialize(layoutConfig);
}
开发者ID:corentindesfarges,项目名称:fw4spl,代码行数:13,代码来源:IGuiContainerSrv.cpp

示例4: configuring

void Code::configuring()
{
    SLM_TRACE_FUNC();
    this->::fwGui::IGuiContainerSrv::initialize();
    std::vector < ConfigurationType > vectConfig = m_configuration->find("config");
    if(!vectConfig.empty())
    {
        std::vector < ConfigurationType > vectLanguage = vectConfig.at(0)->find("language");
        if(!vectLanguage.empty())
        {
            ConfigurationType configLanguage = vectLanguage.at(0);
            SLM_ASSERT("missing 'name' attribute in language tag", configLanguage->hasAttribute("name"));
            m_language = configLanguage->getAttributeValue("name");
        }
    }
}
开发者ID:fw4spl-org,项目名称:fw4spl,代码行数:16,代码来源:Code.cpp


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