コード例 #1
0
Types SimpleBinaryOperation::allowedTypes(int _index) const
{
	if (_index == FirstOperand || _index == SecondOperand)
	{
		if (!m_symbolCache)
			return Types();
//		mDebug() << prototypeOf(FirstOperand)->code() << prototypeOf(SecondOperand)->code() << " " << _index << " " << typeOf(FirstOperand)->code();
		if (_index == SecondOperand && prototypeOf(SecondOperand).isUltimatelyNull() && !typeOf(FirstOperand).isNull())
			return typeOf(FirstOperand).strippedTo(prototypeOf(SecondOperand));
		if (_index == SecondOperand && prototypeOf(SecondOperand).isUltimatelyNull())
			return Types();
		AssertNR(!prototypeOf(_index).isNull());
		return prototypeOf(_index);
	}
	return Super::allowedTypes(_index);
}
コード例 #2
0
ファイル: soem_SGDV.cpp プロジェクト: joseparnau/rosjac
   soem_SGDV::soem_SGDV(std::string const& name): soem_slave(name),
   configmyDC("configmyDC"),useDC(true),
   SYNC0TIME(1000000),SHIFT(125000),SHIFTMASTER(1000000),PDOerrorsTolerance(9)
    {
	this->addProperty("useDC",useDC).doc("To configure the slave to use DC");
	this->addProperty("SYNC0TIME",SYNC0TIME).doc("The period of the sync0 events expressed [ns]");
	this->addProperty("SHIFT",SHIFT).doc("The shift of the outputs in the slave [ns]");
	this->addProperty("SHIFTMASTER",SHIFTMASTER).doc("The shift of the master [ns]");
	this->addProperty("PDOerrorsTolerance",PDOerrorsTolerance).doc("Tolerance of not received PDO when DCsync0active");

	this->requires()->addOperationCaller(configmyDC);
	
	
	Types()->addType(new PDOportTypeInfo());
    
	target.Speed=0;
	target.Torque=0;
	
	
	this->getProvider<Marshalling>("marshalling");
	
    
	this->addPort("actualPDO", actualPDO).doc("The actual values from the drivers");
	this->addPort("targetPDO", targetPDO).doc("The targets from platform");
	
        Logger::log(Logger::Info) << soem_SGDV::getName()<<" Constructed" <<endlog();
    }
コード例 #3
0
ファイル: Source.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_id,"id");
  createAttribute(attrib_name,"name");

  /** children**/
  buildChildren(Types());

  /** other **/
  Bool_array* bool_array =0;
  Float_array* float_array =0;
  IDREF_array* idref_array =0;
  Int_array* int_array =0;
  Name_array* name_array =0;
  SIDREF_array* sidref_array =0;
  Token_array* token_array =0;

  if(queryElement(bool_array)){type = BOOL_ARRAY;}
  if(queryElement(float_array)){type = FLOAT_ARRAY;}
  if(queryElement(idref_array)){type = IDREF_ARRAY;}
  if(queryElement(int_array)){type = INT_ARRAY;}
  if(queryElement(name_array)){type = NAME_ARRAY;}
  if(queryElement(sidref_array)){type = SIDREF_ARRAY;}
  if(queryElement(token_array)){type = TOKEN_ARRAY;}

}
コード例 #4
0
ファイル: DataTransfer.cpp プロジェクト: dzbarsky/gecko-dev
NS_IMETHODIMP
DataTransfer::GetTypes(nsISupports** aTypes)
{
  *aTypes = Types().get();

  return NS_OK;
}
コード例 #5
0
ファイル: Scene.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h) {

    /* children */
    buildChildren(Types());

    /* attributes */

}
コード例 #6
0
ファイル: DataTransfer.cpp プロジェクト: Mardak/tiles-dev
NS_IMETHODIMP
DataTransfer::GetTypes(nsISupports** aTypes)
{
  nsRefPtr<DOMStringList> types = Types();
  types.forget(aTypes);

  return NS_OK;
}
コード例 #7
0
ファイル: enum_type_test.cpp プロジェクト: fengzhuye/rtt
    EnumTypeTest()
    {

        a = new ValueDataSource<TheEnum>( A );
        b = new ValueDataSource<TheEnum>( B );

        Types()->addType( new EnumTypeInfo<TheEnum>("TheEnum") );
    }
コード例 #8
0
ファイル: Evaluate_scene.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_enable,"enable");
  createAttribute(attrib_sid,"sid");
  createAttribute(attrib_name,"name");

  /* children */
  buildChildren(Types());
}
コード例 #9
0
ファイル: Vertex_weights.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */

  createAttribute(attrib_count,"count");

  /** children**/
  buildChildren(Types());

}
コード例 #10
0
ファイル: Controller.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h) {

    /* attributes */
    createAttribute(attrib_id,"id");
    createAttribute(attrib_name,"name");

    /** children**/
    buildChildren(Types());

}
コード例 #11
0
ファイル: Frame_tip.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_link,"link");

  /* children */
  buildChildren(Types());

  /* data */

}
コード例 #12
0
ファイル: Lines.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_name ,"name");
  createAttribute(attrib_count,"count");
  createAttribute(attrib_material,"material");

  /* children */
  buildChildren(Types());

}
コード例 #13
0
ファイル: Profile_CG.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h) {

    /* attributes */
    createAttribute(attrib_id,"id");
    createAttribute(attrib_platform,"platform");

    /* children */
    buildChildren(Types());

    /* data */

}
コード例 #14
0
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_ref,"ref");
  createAttribute(attrib_pass,"pass");

  /* children */
  buildChildren(Types());

  /* data */

}
コード例 #15
0
ファイル: StructTypeInfo.hpp プロジェクト: FynnGamadeyo/rtt
 /**
  * Implementation that updates result with the matching parts in source
  * Relies on the fact that getMember returns a C++ reference to each part of \a result, which is then updated
  * with a property found in source.
  */
 virtual bool composeTypeImpl(const PropertyBag& source,  typename internal::AssignableDataSource<T>::reference_t result) const {
     // The default implementation decomposes result and refreshes it with source.
     TypeInfoRepository::shared_ptr tir = Types();
     internal::ReferenceDataSource<T> rds(result);
     rds.ref(); // prevent dealloc.
     PropertyBag decomp;
     // only try refreshProperties if decomp's type is equal to source type.
     // update vs refresh: since it is intentional that the decomposition leads to references to parts of result,
     // only refreshProperties() is meaningful (ie we have a one-to-one mapping). In case of sequences, this would
     // of course not match, so this is struct specific.
     return typeDecomposition( &rds, decomp, false) && ( tir->type(decomp.getType()) == tir->type(source.getType()) ) && refreshProperties(decomp, source);
 }
コード例 #16
0
ファイル: Texture.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_texture,"texture");
  createAttribute(attrib_texcoord,"texcoord");

  /* children */
  buildChildren(Types());

  /* data */

}
コード例 #17
0
ファイル: Semantic.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */

  /* children */
  buildChildren(Types());

  /* data */
  if(handle){
    data = handle->getText();
  }

}
コード例 #18
0
void Declarations() {

  while(strchr("lctvpf", Look)) {
    switch(Look) {
      case 'l': Labels();
      case 'c': Constants();
      case 't': Types();
      case 'v': Variables();
      case 'p': DoProcedure();
      case 'f': DoFunction();
    }
  }
}
コード例 #19
0
ファイル: Argument.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_source,"source");
  createAttribute(attrib_operand,"operand",Enum::SRC_ALPHA);
  createAttribute(attrib_sampler,"sampler");

  /* children */
  buildChildren(Types());

  /* data */

}
コード例 #20
0
ファイル: Depth_target.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_index,"index");
  createAttribute(attrib_slice,"slice");
  createAttribute(attrib_mip,"mip");
  createAttribute(attrib_face,"face");

  /* children */
  buildChildren(Types());

  /* data */

}
コード例 #21
0
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  createAttribute(attrib_sid,"sid");
  createAttribute(attrib_name,"name");
  createAttribute(attrib_constraint,"constraint");


  /* children */
  buildChildren(Types());

  /* data */

}
コード例 #22
0
ファイル: Angle.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */

  /* children */
  buildChildren(Types());

  /* data */
  XmlElement* element = handle;
  if(element){
    Utils::fromString(data,element->getText());
  }

}
コード例 #23
0
ファイル: 9.c プロジェクト: naveen246/tiny_compiler
void Declarations(){
    int other = 0;
    while(!other){
        switch(Look){
            case 'l' : Labels(); break;
            case 'c' : Constants(); break;
            case 't' : Types(); break;
            case 'v' : Variables(); break;
            case 'p' : DoProcedure(); break;
            case 'f' : DoFunction(); break;
            default : other = 1;
        }
    }
}
コード例 #24
0
ファイル: metaview.c プロジェクト: axelmuhr/Helios-NG
Interactor* Builder::TypeSizeControls () {
    Tray* t = new Tray;
    Interactor* typeLabel = TypeLabel();
    Interactor* types = Types();
    Interactor* sizeLabel = SizeLabel();
    Interactor* sizes = Sizes();
    
    t->HBox(t, typeLabel, hgap(), types, new HGlue, t);
    t->HBox(t, sizeLabel, hgap(), sizes, new HGlue, t);
    t->Align(Left, types, sizes);

    t->VBox(t, typeLabel, vspc(), sizeLabel, t);
    t->Align(VertCenter, typeLabel, types);
    t->Align(VertCenter, sizeLabel, sizes);

    return t;
}
コード例 #25
0
ファイル: Spline.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */
  if(handle){
    std::string str;
    str = handle->getText();
    if(str == "true"){
      attrib_closed = true;
    }
    else{
      attrib_closed = false;
    }
  }

  /* children */
  buildChildren(Types());

}
コード例 #26
0
Types SubscriptOperation::allowedTypes(int _index) const
{
	if (_index == FirstOperand)
	{
		return SubscriptableRegistrar::get()->m_acceptable.values();
	}
	else if (_index == SecondOperand)
	{
		Type lt = leftType();
		if (Subscriptable* s = lt->tryType<Subscriptable>())
		{
			Types ts = s->subscriptTypes();
			ts.replace(Type(), Type(Unsigned|Int));
			return ts;
		}
		return Types();
	}
	return Super::allowedTypes(_index);
}
コード例 #27
0
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VariableAnalysis::InsertAggregateCandidates(OperandVariableDict& dict, 
                                                 const VariableList& varList) {
    auto unit = funct_->ParentUnit();

    for(int i = 0; i < varList.Count(); i++) {
        auto variable = varList[i];

        if((variable->IsArray()  || 
            variable->IsRecord() || 
            variable->IsPointer()) == false) {
            continue;
        }

        variable->SetIsAddresTaken(false); // Presume it's not.
        auto variableRefType = unit->Types().GetPointer(variable->GetType());
        auto variableRef = unit->References().GetVariableRef(variable, variableRefType);

        dict.Add(variableRef, OVPair(variableRef, variable));
    }
}
コード例 #28
0
bool composeTemplateProperty(const PropertyBag& bag, T& result)
{
    TypeInfoRepository::shared_ptr tir = Types();
    if ( tir->type( bag.getType()) == tir->getTypeInfo< T >() ) {
        Property< typename T::value_type>* comp;
        int dimension = bag.size();
        result.resize( dimension );

        // Get values
        int size_correction = 0;
        for (int i = 0; i < dimension ; i++) {
            base::PropertyBase* element = bag.getItem( i );
            comp = dynamic_cast< Property< typename T::value_type>* >( element );
            if ( comp == 0 ) {
                // detect LEGACY element:
                if ( element->getName() == "Size" ) {
                    // oops, our result vector will be one smaller.
                    size_correction += 1;
                    continue;
                }
                Logger::log() << Logger::Error << "Aborting composition of Property< T > "
                              << ": Exptected data element "<< i << " to be of type " << internal::DataSourceTypeInfo< typename T::value_type>::getTypeName()
                              <<" got type " << element->getType()
                              <<Logger::endl;
                return false;
            }
            result[ i - size_correction ] = comp->get();
        }
        result.resize( dimension - size_correction );
    }
    else {
        Logger::log() << Logger::Error << "Composing Property< T > :"
                      << " type mismatch, got type '"<< bag.getType()
                      << "', expected 'vector<" <<  internal::DataSourceTypeInfo< typename T::value_type>::getTypeName() <<">'."<<Logger::endl;
        return false;
    }
    return true;
}
コード例 #29
0
ファイル: Magfilter.cpp プロジェクト: kaiserlicious/Pina
THIS::THIS(XmlElement* h):Element(h){

  /* attributes */

  /* children */
  buildChildren(Types());

  /* data */
  XmlElement* element = handle;
  if(element){
    std::string str = element->getText();
    /*remove spaces*/
    while(str.find(" ") != std::string::npos)
    {
      str.replace(str.find(" "), 1, "");
    }
    /*default*/
    data = Enum::LINEAR;
    if(str == "NEAREST"){
      data = Enum::NEAREST;
    }
  }

}