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


C++ Number::getInt方法代码示例

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


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

示例1: Number

Number Number::operator+ (const Number& other)
{
	return Number(getInt() + other.getInt());
}
开发者ID:vk-eipi,项目名称:MathParser,代码行数:4,代码来源:expression.cpp

示例2: getInt

bool Number::operator== (const Number& other) const
{
	return getInt() == other.getInt();
}
开发者ID:vk-eipi,项目名称:MathParser,代码行数:4,代码来源:expression.cpp

示例3: getFormName

//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Component::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        //indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    // List of components
    const PairStream* subcomponents = getComponents();
    if (subcomponents != 0) {
        indent(sout,i+j);
        sout << "components: {" << std::endl;
        subcomponents->serialize(sout,i+j+4,slotsOnly);
        indent(sout,i+j);
        sout << "}" << std::endl;
        subcomponents->unref();
        subcomponents = 0;
    }

    // Selected component
    if (selection != 0) {
        indent(sout,i+j);
        sout << "select: ";
        String* str = dynamic_cast<String*>(selection);
        if (str != 0) {
            sout << *str;
        }
        else {
            Number* num = dynamic_cast<Number*>(selection);
            if (num != 0) sout << num->getInt();
        }
        sout << std::endl;
    }

    // Event logger
    if (elog0 != 0) {
        indent(sout,i+j);
        sout << "logger: " << std::endl;
        elog0->serialize(sout,i+j,slotsOnly);
    }

    // enableTimingStats
    if (isTimingStatsEnabled()) {
        indent(sout,i+j);
        sout << "enableTimingStats: " << isTimingStatsEnabled() << std::endl;
    }

    // printTimingStats
    if (isTimingStatsPrintEnabled()) {
        indent(sout,i+j);
        sout << "printTimingStats: " << isTimingStatsPrintEnabled() << std::endl;
    }

    // Freeze
    if (isFrozen()) {
        indent(sout,i+j);
        sout << "freeze: " << isFrozen() << std::endl;
    }

    {
      unsigned short bits = getMessageEnableBits();

      // Message enable bits (only if anything other than just ERROR is set)
      if (bits != MSG_ERROR) {

         // Standard 
         if ( (bits & MSG_WARNING) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  WARNING" << std::endl;
         }
         if ( (bits & MSG_INFO) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  INFO" << std::endl;
         }
         if ( (bits & MSG_DEBUG) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  DEBUG" << std::endl;
         }
         if ( (bits & MSG_DATA) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  DATA" << std::endl;
         }
         if ( (bits & MSG_USER) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  USER" << std::endl;
         }

         // Non-standard
         if ( (bits & ~MSG_STD_ALL) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType: " << std::hex << (bits & ~MSG_STD_ALL) << std::dec << std::endl;
         }
      }
    }

//.........这里部分代码省略.........
开发者ID:subrrc,项目名称:OpenEaagles,代码行数:101,代码来源:Component.cpp


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