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


C++ Section::GetSectionType方法代码示例

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


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

示例1:

void BinaryWriter<ElemType>::SaveMapping(std::wstring saveId, const std::map<typename BinaryWriter<ElemType>::LabelIdType, typename BinaryWriter<ElemType>::LabelType>& labelMapping)
{
    Section* section = m_sections[saveId];
    if (section->GetSectionType() == sectionTypeLabelMapping)
    {
        auto sectionString = (SectionString*) section;
        sectionString->SetLabelMapping(labelMapping);
    }
}
开发者ID:AllanYiin,项目名称:CNTK,代码行数:9,代码来源:BinaryWriter.cpp

示例2: selectionChanged

void SectionPopup::selectionChanged(Section* _section, std::vector<Section*> _sections)
{
	selections_->clear();
	for(std::vector<Section*>::iterator it = _sections.begin(); it != _sections.end(); ++it)
	{
		std::string name = boost::lexical_cast<std::string, int>((*it)->GetSectionID()) + " :" + (*it)->GetSectionType();
		QAction* select_action = new QAction(name.c_str(), this);
		select_action->setCheckable(true);
		select_action->setData((*it)->GetSectionID());
		if(*it == _section)
			select_action->setChecked(true);

		QObject::connect(select_action, SIGNAL(triggered()), this, SLOT(selection_item_triggered()));
		selections_->addAction(select_action);
	}
	if(!_section->IsCore())
	{
		Section* parent = _section->GetParent();

		std::string name = std::string("Parent: ") + parent->GetSectionType();
		QAction* select_action = new QAction(name.c_str(), this);
		select_action->setCheckable(true);
		select_action->setData(parent->GetSectionID());

		QObject::connect(select_action, SIGNAL(triggered()), this, SLOT(selection_item_triggered()));
		selections_->addSeparator();
		selections_->addAction(select_action);
	}
	std::vector<Section*>& subsections = _section->GetSubsections();
	if(subsections.size())
	{
		selections_->addSeparator();
	}
	for(std::vector<Section*>::iterator it = subsections.begin(); it != subsections.end(); ++it)
	{
		std::string name = std::string("Child: ") + (*it)->GetSectionType();
		QAction* select_action = new QAction(name.c_str(), this);
		select_action->setCheckable(true);
		select_action->setData((*it)->GetSectionID());

		QObject::connect(select_action, SIGNAL(triggered()), this, SLOT(selection_item_triggered()));
		selections_->addAction(select_action);
	}

}
开发者ID:danishcake,项目名称:FusionForever,代码行数:45,代码来源:sectionpopup.cpp


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