예제 #1
0
			const AST::Type* resolveAliasType(AST::Alias& alias) {
				if (alias.type() != nullptr) {
					return alias.type();
				}
				
				assert(resolveMap_.find(&alias) != resolveMap_.end());
				
				auto& resolveInfo = resolveMap_.at(&alias);
				
				if (resolveInfo.isResolving()) {
					context_.issueDiag(AliasDependsOnItselfDiag(alias.fullName().copy()),
					                   alias.location());
					const auto voidType = context_.typeBuilder().getVoidType();
					alias.setType(voidType);
					return voidType;
				}
				
				resolveInfo.setIsResolving();
				
				SwapScopeStack swapScopeStack(context_.scopeStack(), resolveInfo.scopeStack());
				
				alias.setValue(ConvertValue(context_, alias.valueDecl()));
				
				return alias.type();
			}
예제 #2
0
void SerialController::SetMaxSpeed(float value)
{
  if (_port)
  {
    _port->print("M");
    _port->print(String(ConvertValue(value)));
    _port->print(EOT);
  }
}
예제 #3
0
void SerialController::SetDamping(float value)
{
   // check to make sure that the serial port is ready
  if (_port)
  {
    _port->print("D");
    _port->print(String(ConvertValue(value)));
    _port->print(EOT);
  }
}
예제 #4
0
파일: bson.c 프로젝트: CDC/mongolite
SEXP ConvertArray(bson_iter_t* iter, bson_iter_t* counter){
  SEXP ret;
  int count = 0;
  while(bson_iter_next(counter)){
    count++;
  }
  PROTECT(ret = allocVector(VECSXP, count));
  for (int i = 0; bson_iter_next(iter); i++) {
    SET_VECTOR_ELT(ret, i, ConvertValue(iter));
  }
  UNPROTECT(1);
  return ret;
}
예제 #5
0
const char *ConfigItem::StringValue() const
{
  if ( !accessed )
    ConvertValue();

  if ( cfg_type != CFG_STRING )
  {
    Error( "Attempt to fetch string value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type );
    exit( -1 );
  }

  return( cfg_value.string_value );
}
예제 #6
0
int ConfigItem::IntegerValue() const
{
  if ( !accessed )
    ConvertValue();

  if ( cfg_type != CFG_INTEGER )
  {
    Error( "Attempt to fetch integer value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type );
    exit( -1 );
  }

  return( cfg_value.integer_value );
}
예제 #7
0
double ConfigItem::DecimalValue() const
{
  if ( !accessed )
    ConvertValue();

  if ( cfg_type != CFG_DECIMAL )
  {
    Error( "Attempt to fetch decimal value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type );
    exit( -1 );
  }

  return( cfg_value.decimal_value );
}
예제 #8
0
bool ConfigItem::BooleanValue() const
{
  if ( !accessed )
    ConvertValue();

  if ( cfg_type != CFG_BOOLEAN )
  {
    Error( "Attempt to fetch boolean value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type );
    exit( -1 );
  }

  return( cfg_value.boolean_value );
}
예제 #9
0
void
FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntSize &aValue)
{
  UINT32 widthProp, heightProp;

  if (!GetD2D1PropsForIntSize(mType, aIndex, &widthProp, &heightProp)) {
    return;
  }

  IntSize value = aValue;
  ConvertValue(mType, aIndex, value);

  mEffect->SetValue(widthProp, (UINT)value.width);
  mEffect->SetValue(heightProp, (UINT)value.height);
}
예제 #10
0
void
FilterNodeD2D1::SetAttribute(uint32_t aIndex, uint32_t aValue)
{
  UINT32 input = GetD2D1PropForAttribute(mType, aIndex);
  MOZ_ASSERT(input < mEffect->GetPropertyCount());

  if (mType == FilterType::TURBULENCE && aIndex == ATT_TURBULENCE_BASE_FREQUENCY) {
    mEffect->SetValue(input, D2D1::Vector2F(FLOAT(aValue), FLOAT(aValue)));
    return;
  } else if (mType == FilterType::DIRECTIONAL_BLUR && aIndex == ATT_DIRECTIONAL_BLUR_DIRECTION) {
    mEffect->SetValue(input, aValue == BLUR_DIRECTION_X ? 0 : 90.0f);
    return;
  }

  mEffect->SetValue(input, ConvertValue(mType, aIndex, aValue));
}
예제 #11
0
static void ConvertDeclaration(css_node declaration, StyleBuffer sb)
{
    int property_type;

    if (declaration && 
        (declaration->node_id == NODE_DECLARATION_PROPERTY_EXPR ||
         declaration->node_id == NODE_DECLARATION_PROPERTY_EXPR_PRIO)) {
        StyleBufferWrite(".", 1, sb);
        ConvertProperty(declaration->left->string, sb, &property_type);
        ConvertValue(declaration->right, sb, property_type);
#if ALLOW_PRIORITY
        if (declaration->node_id == NODE_DECLARATION_PROPERTY_EXPR_PRIO)
            StyleBufferWrite(" !important", 11, sb);
#endif
        StyleBufferWrite("\n", 1, sb);
    }
}
예제 #12
0
파일: bson.c 프로젝트: CDC/mongolite
SEXP ConvertObject(bson_iter_t* iter, bson_iter_t* counter){
  SEXP names;
  SEXP ret;
  int count = 0;
  while(bson_iter_next(counter)){
    count++;
  }
  PROTECT(ret = allocVector(VECSXP, count));
  PROTECT(names = allocVector(STRSXP, count));
  for (int i = 0; bson_iter_next(iter); i++) {
    SET_STRING_ELT(names, i, mkChar(bson_iter_key(iter)));
    SET_VECTOR_ELT(ret, i, ConvertValue(iter));
  }
  setAttrib(ret, R_NamesSymbol, names);
  UNPROTECT(2);
  return ret;
}
예제 #13
0
void Value_Raw::Assign( const I_Value& inValue )  
{
	if( inValue.get_IsNull() )
	{
		put_IsNull( true );
	}
	else
	{
		if( get_Type() == inValue.get_Type() )
		{
			vuint32 Len = static_cast<vuint32>(inValue.end() - inValue.begin());
			put_Data( (vuint8*)inValue.begin(), Len );
		}
		else
		{
			ConvertValue( &inValue,	this );
		}
	}
}
예제 #14
0
long SerialController::ReadPosition()
{
  int value = 0;
  
//  if (_port)
//  {
//    _port->print("P");
//    _port->print("\n\r");
//    
//    while(!_port->available())
//    { delay(10); }
//    
//    while (_port->available())
//    { Serial.print( _port->read()); Serial.print("  "); }   
//    //value = _port->read();
//  }
  
  return ConvertValue(value);
}
예제 #15
0
float SerialController::ReadDamping()
{
  int value = 0;
  
//  if (_port)
//  {
//    _port->print("D");
//    _port->print("\n\r");
//    _port->flush();
//    
//    while(!_port->available())
//    { delay(10); }
//    
//    while (_port->available())
//    { Serial.Set( _port->read()); Serial.print("  "); }   
//  }
  
  return ConvertValue(value);
}
예제 #16
0
		void AddNamespaceDataAliasValues(Context& context, const AST::Node<AST::NamespaceData>& astNamespaceDataNode) {
			const auto semNamespace = context.scopeStack().back().nameSpace();
			
			for (const auto& astAliasNode: astNamespaceDataNode->aliases) {
				auto& semAlias = semNamespace->items().at(astAliasNode->name).alias();
				PushScopeElement pushScopeElement(context.scopeStack(), ScopeElement::Alias(&semAlias));
				semAlias.setValue(ConvertValue(context, astAliasNode->value));
			}
			
			for (const auto& astChildNamespaceNode: astNamespaceDataNode->namespaces) {
				auto& semChildNamespace = semNamespace->items().at(astChildNamespaceNode->name).nameSpace();
				
				PushScopeElement pushScopeElement(context.scopeStack(), ScopeElement::Namespace(&semChildNamespace));
				AddNamespaceDataAliasValues(context, astChildNamespaceNode->data);
			}
			
			for (const auto& astModuleScopeNode: astNamespaceDataNode->moduleScopes) {
				AddNamespaceDataAliasValues(context, astModuleScopeNode->data);
			}
		}
예제 #17
0
float SerialController::ReadMaxSpeed()
{
  int value = 0;
  
//  if (_port)
//  {
//    _port->print("M");
//    _port->print("\n\r");
//    
//    while(!_port->available())
//    { delay(10); }
//    
//    while (_port->available())
//    { Serial.print( _port->read());}
//   
//    Serial.println("");   
//  }
  
  return ConvertValue(value);
}
예제 #18
0
void copy_metadata(std::unique_ptr<DracoMesh>& draco_mesh, Mesh::Ptr mesh) {
    const auto metadata = draco_mesh->GetMetadata();
    if (metadata == nullptr) return;
    const auto& attr_metadatas = metadata->attribute_metadatas();
    for (const auto& attr_metadata : attr_metadatas) {
        std::string name="";
        attr_metadata->GetEntryString("name", &name);
        if (name == "") continue;
        auto uid = attr_metadata->att_unique_id();

        const auto attr = draco_mesh->GetAttributeByUniqueId(uid);
        const auto num_rows = attr->size();
        const auto num_cols = attr->num_components();

        VectorF data(num_rows * num_cols);
        for (size_t i=0; i<num_rows; i++) {
            attr->ConvertValue(draco::AttributeValueIndex(i),
                    data.data() + i*num_cols);
        }
        mesh->add_empty_attribute(name);
        mesh->set_attribute(name, data);
    }
}
예제 #19
0
파일: db_key.cpp 프로젝트: mdvx/fastonosql
value_t NValue::GetValue(const std::string& delimiter) const {
  return ConvertValue(get(), delimiter);
}