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


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

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


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

示例1: sectionEnd

void Profiler::sectionEnd(const string &name){
	if(name==currSection->getName()){
		currSection->stop();
		currSection= currSection->getParent();
	}
	else{
		throw std::runtime_error("Profile: Leaving section is not current section: "+name);
	}
}
开发者ID:MoLAoS,项目名称:Mandate,代码行数:9,代码来源:profiler.cpp

示例2: Diag

void
BinOutput::OutputSection(Section& sect, const IntNum& origin)
{
    BytecodeOutput* outputter;

    if (sect.isBSS())
    {
        outputter = &m_no_output;
    }
    else
    {
        IntNum file_start = sect.getLMA();
        file_start -= origin;
        if (file_start.getSign() < 0)
        {
            Diag(SourceLocation(), diag::err_section_before_origin)
                << sect.getName();
            return;
        }
        if (!file_start.isOkSize(sizeof(unsigned long)*8, 0, 0))
        {
            Diag(SourceLocation(), diag::err_start_too_large)
                << sect.getName();
            return;
        }
        m_fd_os.seek(file_start.getUInt());
        if (m_os.has_error())
        {
            Diag(SourceLocation(), diag::err_file_output_seek);
            return;
        }

        outputter = this;
    }

    for (Section::bc_iterator i=sect.bytecodes_begin(),
         end=sect.bytecodes_end(); i != end; ++i)
    {
        i->Output(*outputter);
    }
}
开发者ID:BrianGladman,项目名称:yasm-nextgen,代码行数:41,代码来源:BinObject.cpp

示例3: print

void Section::print(ostream *outStream, int tabLevel){
	float percent = ( parent == NULL || parent->microsElapsed == 0 )
					? 100.0f : 100.0f * microsElapsed / parent->microsElapsed;
	string pname= parent==NULL? "": parent->getName();

	for(int i=0; i<tabLevel; ++i)
		*outStream << "\t";

	*outStream << name << ": ";

	if ( microsElapsed ) {
		*outStream << int(microsElapsed) << " us";
		unsigned int milliseconds = microsElapsed / 1000;
		unsigned int seconds = milliseconds / 1000;
		unsigned int minutes = seconds / 60;
		if ( minutes ) {
			*outStream << " (" << minutes << "min " << seconds % 60 << "sec)";
		}
		else if ( seconds ) {
			*outStream << " (" << seconds << "sec " << milliseconds % 1000 << "ms)";
		}
		else if ( milliseconds ) {
			*outStream << " (" << milliseconds << "ms)";
		}
		outStream->precision(1);
		*outStream << std::fixed << ", " << percent << "%";
	}
	if ( calls ) {
		*outStream << ", " << calls << " calls";
	}
	*outStream << "\n";

	SectionContainer::iterator it;
	for(it= children.begin(); it!=children.end(); ++it){
		it->second->print(outStream, tabLevel+1);
	}
}
开发者ID:MoLAoS,项目名称:Mandate,代码行数:37,代码来源:profiler.cpp


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