• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ValueType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ValueType的典型用法代码示例。如果您正苦于以下问题:C++ ValueType类的具体用法?C++ ValueType怎么用?C++ ValueType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: gException

const GurlsOption* GurlsOptionsList::getOpt(std::string key) const
{
    if(key.empty())
        throw gException(Exception_Parameter_Not_Definied_Yet + "( )");

    std::vector<std::string> names;
    boost::split(names, key, boost::is_any_of("."));

    const GurlsOption* gout = this;
    ValueType *tab;

    for(std::vector<std::string>::iterator n_it = names.begin(); n_it != names.end(); ++n_it)
    {
        tab = GurlsOptionsList::dynacast(gout)->table;

        std::map<std::string, GurlsOption* >::iterator it = tab->find(*n_it);

        if(it == tab->end())
            throw gException(Exception_Parameter_Not_Definied_Yet + "( " + *n_it + " )");

        gout = it->second;
    }

    return gout;
}
开发者ID:BRKMYR,项目名称:GURLS,代码行数:25,代码来源:optlist.cpp


示例2: operator

	int operator()(const InputType &x, ValueType& fvec) const {
		m_decoder.Decode(m_rots, x);

		Vector3 v = sik.endPosition(m_rots);
		v -= m_goal;
		fvec.setZero();
		fvec.head<3>() = Eigen::Vector3f::Map(&v.x);

		// limit-exceed panelaty
		auto limpanl = fvec.tail(x.size());
		for (int i = 0; i < x.size(); i++)
		{
			if (x[i] < m_min[i])
				limpanl[i] = m_limitPanalty*(x[i] - m_min[i])*(x[i] - m_min[i]);
			else if (x[i] > m_max[i])
				limpanl[i] = m_limitPanalty*(x[i] - m_max[i])*(x[i] - m_max[i]);
		}

		if (m_useRef)
		{
			limpanl += m_refWeights *(x - m_ref);
		}

		return 0;
	}
开发者ID:flair2005,项目名称:OpenAvataring,代码行数:25,代码来源:StylizedIK+-+Copy.cpp


示例3: valueType

void
SwitchIRBuilder::SetProfiledInstruction(IR::Instr * instr, Js::ProfileId profileId)
{
    m_profiledSwitchInstr = instr;
    m_switchOptBuildBail = true;

    //don't optimize if the switch expression is not an Integer (obtained via dynamic profiling data of the BeginSwitch opcode)

    bool hasProfile = m_profiledSwitchInstr->IsProfiledInstr() && m_profiledSwitchInstr->m_func->HasProfileInfo();

    if (hasProfile)
    {
        const ValueType valueType(m_profiledSwitchInstr->m_func->GetReadOnlyProfileInfo()->GetSwitchProfileInfo(profileId));
        instr->AsProfiledInstr()->u.FldInfo().valueType = valueType;
        m_switchIntDynProfile = valueType.IsLikelyTaggedInt();
        m_switchStrDynProfile = valueType.IsLikelyString();

        if (PHASE_TESTTRACE1(Js::SwitchOptPhase))
        {
            char valueTypeStr[VALUE_TYPE_MAX_STRING_SIZE];
            valueType.ToString(valueTypeStr);
#if ENABLE_DEBUG_CONFIG_OPTIONS
            char16 debugStringBuffer[MAX_FUNCTION_BODY_DEBUG_STRING_SIZE];
#endif
            PHASE_PRINT_TESTTRACE1(Js::SwitchOptPhase, _u("Func %s, Switch %d: Expression Type : %S\n"),
                m_profiledSwitchInstr->m_func->GetDebugNumberSet(debugStringBuffer),
                m_profiledSwitchInstr->AsProfiledInstr()->u.profileId, valueTypeStr);
        }
    }
}
开发者ID:sankha93,项目名称:ChakraCore,代码行数:30,代码来源:SwitchIRBuilder.cpp


示例4: switch

void Canonicalizer::do_ShiftOp        (ShiftOp*         x) {
  ValueType* t = x->x()->type();
  ValueType* t2 = x->y()->type();
  if (t->is_constant()) {
    switch (t->tag()) {
    case intTag   : if (t->as_IntConstant()->value() == 0)         { set_constant(0); return; } break;
    case longTag  : if (t->as_LongConstant()->value() == (jlong)0) { set_constant(jlong_cast(0)); return; } break;
    default       : ShouldNotReachHere();
    }
    if (t2->is_constant()) {
      if (t->tag() == intTag) {
        int value = t->as_IntConstant()->value();
        int shift = t2->as_IntConstant()->value() & 31;
        jint mask = ~(~0 << (32 - shift));
        if (shift == 0) mask = ~0;
        switch (x->op()) {
          case Bytecodes::_ishl:  set_constant(value << shift); return;
          case Bytecodes::_ishr:  set_constant(value >> shift); return;
          case Bytecodes::_iushr: set_constant((value >> shift) & mask); return;
        }
      } else if (t->tag() == longTag) {
        jlong value = t->as_LongConstant()->value();
        int shift = t2->as_IntConstant()->value() & 63;
        jlong mask = ~(~jlong_cast(0) << (64 - shift));
        if (shift == 0) mask = ~jlong_cast(0);
        switch (x->op()) {
          case Bytecodes::_lshl:  set_constant(value << shift); return;
          case Bytecodes::_lshr:  set_constant(value >> shift); return;
          case Bytecodes::_lushr: set_constant((value >> shift) & mask); return;
        }
      }
开发者ID:lizhekang,项目名称:TCJDK,代码行数:31,代码来源:c1_Canonicalizer.cpp


示例5: print_object

void InstructionPrinter::print_object(Value obj) {
  ValueType* type = obj->type();
  if (type->as_ObjectConstant() != NULL) {
    ciObject* value = type->as_ObjectConstant()->value();
    if (value->is_null_object()) {
      output()->print("null");
    } else if (!value->is_loaded()) {
output()->print("<unloaded object %p>",value);
    } else if (value->is_method()) {
      ciMethod* m = (ciMethod*)value;
      output()->print("<method %s.%s>", m->holder()->name()->as_utf8(), m->name()->as_utf8());
    } else {
output()->print("<object %p>",value->encoding());
    }
  } else if (type->as_InstanceConstant() != NULL) {
output()->print("<instance %p>",type->as_InstanceConstant()->value()->encoding());
  } else if (type->as_ArrayConstant() != NULL) {
output()->print("<array %p>",type->as_ArrayConstant()->value()->encoding());
  } else if (type->as_ClassConstant() != NULL) {
    ciInstanceKlass* klass = type->as_ClassConstant()->value();
    if (!klass->is_loaded()) {
      output()->print("<unloaded> ");
    }
    output()->print("class "); 
    print_klass(klass);
  } else {
    output()->print("???");
  }
}
开发者ID:GregBowyer,项目名称:ManagedRuntimeInitiative,代码行数:29,代码来源:c1_InstructionPrinter.cpp


示例6: print_object

void InstructionPrinter::print_object(Value obj) {
  ValueType* type = obj->type();
  if (type->as_ObjectConstant() != NULL) {
    ciObject* value = type->as_ObjectConstant()->value();
    if (value->is_null_object()) {
      tty->print("null");
    } else if (!value->is_loaded()) {
      tty->print("<unloaded object 0x%x>", value);
    } else {
      tty->print("<object 0x%x>", value->encoding());
    }
  } else if (type->as_InstanceConstant() != NULL) {
    tty->print("<instance 0x%x>", type->as_InstanceConstant()->value()->encoding());
  } else if (type->as_ArrayConstant() != NULL) {
    tty->print("<array 0x%x>", type->as_ArrayConstant()->value()->encoding());
  } else if (type->as_ClassConstant() != NULL) {
    ciInstanceKlass* klass = type->as_ClassConstant()->value();
    if (!klass->is_loaded()) {
      tty->print("<unloaded class>");
    } else {
      tty->print("<class 0x%x>", klass->encoding());
    }
  } else {
    tty->print("???");
  }
}
开发者ID:subxiang,项目名称:jdk-source-code,代码行数:26,代码来源:c1_InstructionPrinter.cpp


示例7:

bool
NormalizedConstraintSet::StringRange::Intersects(const StringRange& aOther) const
{
  if (!mExact.size() || !aOther.mExact.size()) {
    return true;
  }

  ValueType intersection;
  set_intersection(mExact.begin(), mExact.end(),
                   aOther.mExact.begin(), aOther.mExact.end(),
                   std::inserter(intersection, intersection.begin()));
  return !!intersection.size();
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:13,代码来源:MediaTrackConstraints.cpp


示例8: is

 int DataValue::read(const std::string& buf)
 {
     std::istringstream is(buf);
     int tmp;
     ValueType val;
     while (!(is.eof())) {
         is >> tmp;
         if (is.fail()) return 1;
         val.push_back(static_cast<byte>(tmp));
     }
     value_.swap(val);
     return 0;
 }
开发者ID:IAmTheOneTheyCallNeo,项目名称:android_external_Focal,代码行数:13,代码来源:value.cpp


示例9: Intersect

bool
NormalizedConstraintSet::StringRange::Merge(const StringRange& aOther)
{
  if (!Intersects(aOther)) {
    return false;
  }
  Intersect(aOther);

  ValueType unioned;
  set_union(mIdeal.begin(), mIdeal.end(),
            aOther.mIdeal.begin(), aOther.mIdeal.end(),
            std::inserter(unioned, unioned.begin()));
  mIdeal = unioned;
  return true;
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:15,代码来源:MediaTrackConstraints.cpp


示例10: Assert

bool
JITTimeWorkItem::TryGetValueType(uint symId, ValueType * valueType) const
{
    Assert(IsLoopBody());
    uint index = symId - m_jitBody.GetConstCount();
    if (symId >= m_jitBody.GetConstCount() && index < m_workItemData->symIdToValueTypeMapCount)
    {
        ValueType type = ((ValueType*)m_workItemData->symIdToValueTypeMap)[index];
        if (type.GetRawData() != 0)
        {
            *valueType = type;
            return true;
        }
    }
    return false;
}
开发者ID:litian2025,项目名称:ChakraCore,代码行数:16,代码来源:JITTimeWorkItem.cpp


示例11: Assert

int
GlobOpt::GetBoundCheckOffsetForSimd(ValueType arrValueType, const IR::Instr *instr, const int oldOffset /* = -1 */)
{
#ifdef ENABLE_SIMDJS
    if (!(Js::IsSimd128LoadStore(instr->m_opcode)))
    {
        return oldOffset;
    }

    if (!arrValueType.IsTypedArray())
    {
        // no need to adjust for other array types, we will not type-spec (see Simd128DoTypeSpecLoadStore)
        return oldOffset;
    }

    Assert(instr->dataWidth == 4 || instr->dataWidth == 8 || instr->dataWidth == 12 || instr->dataWidth == 16);

    int numOfElems = Lowerer::SimdGetElementCountFromBytes(arrValueType, instr->dataWidth);

    // we want to make bound checks more conservative. We compute how many extra elements we need to add to the bound check
    // e.g. if original bound check is value <= Length + offset, and dataWidth is 16 bytes on Float32 array, then we need room for 4 elements. The bound check guarantees room for 1 element.
    // Hence, we need to ensure 3 more: value <= Length + offset - 3
    // We round up since dataWidth may span a partial lane (e.g. dataWidth = 12, bpe = 8 bytes)

    int offsetBias = -(numOfElems - 1);
    // we should always make an existing bound-check more conservative.
    Assert(offsetBias <= 0);
    return oldOffset + offsetBias;
#else
    return oldOffset;
#endif
}
开发者ID:280185386,项目名称:ChakraCore,代码行数:32,代码来源:GlobOptSimd128.cpp


示例12: switch

void Canonicalizer::do_ShiftOp        (ShiftOp*         x) {
  ValueType* t = x->x()->type();
  if (t->is_constant()) {
    switch (t->tag()) {
      case intTag   : if (t->as_IntConstant()->value() == 0)  set_constant(0); return;
      case longTag  : if (t->as_LongConstant()->value() == (jlong)0) set_constant(jlong_cast(0)); return;
      default       : ShouldNotReachHere();
    }
  }
  ValueType* t2 = x->y()->type();
  if (t2->is_constant()) {
    switch (t2->tag()) {
      case intTag   : if (t2->as_IntConstant()->value() == 0)  set_canonical(x->x()); return;
      default       : ShouldNotReachHere();
    }
  }
}
开发者ID:MuniyappanV,项目名称:jdk-source-code,代码行数:17,代码来源:c1_Canonicalizer.cpp


示例13: do_Constant

void InstructionPrinter::do_Constant(Constant* x) {
    ValueType* t = x->type();
    switch (t->tag()) {
    case intTag    :
        output()->print("%d"  , t->as_IntConstant   ()->value());
        break;
    case longTag   :
        output()->print(os::jlong_format_specifier(), t->as_LongConstant()->value());
        output()->print("L");
        break;
    case floatTag  :
        output()->print("%g"  , t->as_FloatConstant ()->value());
        break;
    case doubleTag :
        output()->print("%gD" , t->as_DoubleConstant()->value());
        break;
    case objectTag :
        print_object(x);
        break;
    case addressTag:
        output()->print("bci:%d", t->as_AddressConstant()->value());
        break;
    default        :
        output()->print("???");
        break;
    }
}
开发者ID:,项目名称:,代码行数:27,代码来源:


示例14: GetIRTypeFromValueType

IRType GlobOpt::GetIRTypeFromValueType(const ValueType &valueType)
{
    if (valueType.IsFloat())
    {
        return TyFloat64;
    }
    else if (valueType.IsInt())
    {
        return TyInt32;
    }
    else if (valueType.IsSimd128Float32x4())
    {
        return TySimd128F4;
    }
    else
    {
        Assert(valueType.IsSimd128Int32x4());
        return TySimd128I4;
    }
}
开发者ID:280185386,项目名称:ChakraCore,代码行数:20,代码来源:GlobOptSimd128.cpp


示例15: print_fields

void print_fields( const ValueType& t ) {
  t.visit( to_json_visitor(std::cout) );
/*
  slog( "printing fields: %1%", t.size() );
  boost::reflect::const_iterator itr = t.begin();
  while( itr != t.end() ) {
    slog( "%3% %1% = %2%", itr.key(), itr.value().as<std::string>(), itr.value().type() );
    ++itr;
  }
  */
}
开发者ID:fast01,项目名称:boost_reflect,代码行数:11,代码来源:value_test.cpp


示例16: GetBailOutKindFromValueType

IR::BailOutKind GlobOpt::GetBailOutKindFromValueType(const ValueType &valueType)
{
    if (valueType.IsFloat())
    {
        // if required valueType is Float, then allow coercion from any primitive except String.
        return IR::BailOutPrimitiveButString;
    }
    else if (valueType.IsInt())
    {
        return IR::BailOutIntOnly;
    }
    else if (valueType.IsSimd128Float32x4())
    {
        return IR::BailOutSimd128F4Only;
    }
    else
    {
        Assert(valueType.IsSimd128Int32x4());
        return IR::BailOutSimd128I4Only;
    }
}
开发者ID:280185386,项目名称:ChakraCore,代码行数:21,代码来源:GlobOptSimd128.cpp


示例17: do_NegateOp

void Canonicalizer::do_NegateOp(NegateOp* x) {
  ValueType* t = x->x()->type();
  if (t->is_constant()) {
    switch (t->tag()) {
      case intTag   : set_constant(-t->as_IntConstant   ()->value()); return;
      case longTag  : set_constant(-t->as_LongConstant  ()->value()); return;
      case floatTag : set_constant(-t->as_FloatConstant ()->value()); return;
      case doubleTag: set_constant(-t->as_DoubleConstant()->value()); return;
      default       : ShouldNotReachHere();
    }
  }
}
开发者ID:lizhekang,项目名称:TCJDK,代码行数:12,代码来源:c1_Canonicalizer.cpp


示例18: ValueType

int Gear_OscInput::configuredOscHandler(const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data)
{
	Gear_OscInput *gearOscInput = (Gear_OscInput*)user_data;
	std::cout << "Osc message received : " << std::endl;
	std::cout << "path: " << path << std::endl;
	
	OscMessageType message;
	ListType list;
	
	message.setPath(std::string(path));

	for (int i=0; i<argc; i++) 
	{
		std::cout << "arg " << i << " " << types[i] << std::endl;
		if (types[i]==LO_FLOAT) 
		{	
			ValueType *valuet = new ValueType();
			valuet->setValue((float)argv[i]->f);
			list.push_back(valuet);
		} else if (types[i]==LO_INT32) 
		{
			ValueType *valuet = new ValueType();
			valuet->setValue((float)argv[i]->i32);
			list.push_back(valuet);			
		} else if (types[i]==LO_DOUBLE)
		{
			ValueType *valuet = new ValueType();
			valuet->setValue((float)argv[i]->d);
			list.push_back(valuet);			
		} else if (types[i]==LO_STRING)
		{
			StringType *stringt = new StringType();
			stringt->setValue(argv[i]->s);
			list.push_back(stringt);			
		}	
	}	
	
	message.setArgs(list);

	ScopedLock scopedLock(gearOscInput->_mutex);
	gearOscInput->_messages.push_back(message);	
	
	return 0;
}
开发者ID:foogywoo,项目名称:drone,代码行数:44,代码来源:Gear_OscInput.cpp


示例19:

bool GlobOpt::Simd128CanTypeSpecOpnd(const ValueType opndType, ValueType expectedType)
{
    if (!opndType.IsSimd128() && !expectedType.IsSimd128())
    {
        // Non-Simd types can be coerced or we bailout by a FromVar.
        return true;
    }

    // Simd type
    if (opndType.HasBeenNull() || opndType.HasBeenUndefined())
    {
        return false;
    }

    if (
            (opndType.IsLikelyObject() && opndType.ToDefiniteObject() == expectedType) ||
            (opndType.IsLikelyObject() && opndType.GetObjectType() == ObjectType::Object)
       )
    {
        return true;
    }
    return false;
}
开发者ID:280185386,项目名称:ChakraCore,代码行数:23,代码来源:GlobOptSimd128.cpp


示例20: Serialize

void Serialize(ArchiveType &archive, ValueType &value) {
  value.Serialize(archive);
}
开发者ID:otaviog,项目名称:UdToolkit,代码行数:3,代码来源:archive.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ValueVector类代码示例发布时间:2022-05-31
下一篇:
C++ ValueTreeWrapper类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap