本文整理汇总了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);
}
}
示例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++;
}
示例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);
}
示例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");
}
}
}