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


C++ Flag::get_double方法代码示例

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


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

示例1: doubleAt

Flag::Error CommandLineFlags::doubleAt(const char* name, size_t len, double* value, bool allow_locked, bool return_flag) {
  Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
  if (result == NULL) return Flag::INVALID_FLAG;
  if (!result->is_double()) return Flag::WRONG_FORMAT;
  *value = result->get_double();
  return Flag::SUCCESS;
}
开发者ID:gaoxiaojun,项目名称:dync,代码行数:7,代码来源:globals.cpp

示例2: doubleAtPut

void CommandLineFlagsEx::doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin) {
  Flag* faddr = address_of_flag(flag);
  guarantee(faddr != NULL && faddr->is_double(), "wrong flag type");
  trace_flag_changed<EventDoubleFlagChanged, double>(faddr->_name, faddr->get_double(), value, origin);
  faddr->set_double(value);
  faddr->set_origin(origin);
}
开发者ID:mengna152173,项目名称:openjdk8u20-profiling,代码行数:7,代码来源:globals.cpp

示例3: check_ranges

bool CommandLineFlagRangeList::check_ranges() {
    // Check ranges.
    bool status = true;
    for (int i=0; i<length(); i++) {
        CommandLineFlagRange* range = at(i);
        const char* name = range->name();
        Flag* flag = Flag::find_flag(name, strlen(name), true, true);
        // We must check for NULL here as lp64_product flags on 32 bit architecture
        // can generate range check (despite that they are declared as constants),
        // but they will not be returned by Flag::find_flag()
        if (flag != NULL) {
            if (flag->is_int()) {
                int value = flag->get_int();
                if (range->check_int(value, true) != Flag::SUCCESS) status = false;
            } else if (flag->is_uint()) {
                uint value = flag->get_uint();
                if (range->check_uint(value, true) != Flag::SUCCESS) status = false;
            } else if (flag->is_intx()) {
                intx value = flag->get_intx();
                if (range->check_intx(value, true) != Flag::SUCCESS) status = false;
            } else if (flag->is_uintx()) {
                uintx value = flag->get_uintx();
                if (range->check_uintx(value, true) != Flag::SUCCESS) status = false;
            } else if (flag->is_uint64_t()) {
                uint64_t value = flag->get_uint64_t();
                if (range->check_uint64_t(value, true) != Flag::SUCCESS) status = false;
            } else if (flag->is_size_t()) {
                size_t value = flag->get_size_t();
                if (range->check_size_t(value, true) != Flag::SUCCESS) status = false;
            } else if (flag->is_double()) {
                double value = flag->get_double();
                if (range->check_double(value, true) != Flag::SUCCESS) status = false;
            }
        }
    }
    return status;
}
开发者ID:gaoxiaojun,项目名称:dync,代码行数:37,代码来源:commandLineFlagRangeList.cpp


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