for (int i = 0; attr[i]; i += 2)
{
if(std::string(attr[i]) == "name")this->name(attr[i+1]);
+ if(std::string(attr[i]) == "elementaryWeight")this->weight(atof(attr[i+1]));
if(std::string(attr[i]) == "state")this->state(attr[i+1]);
}
}
_kind="";
this->_state="";
this->_container="";
+ this->_weight=-1.;
+ }
+ virtual void weight (const double& x)
+ {
+ DEBTRACE("elementary_weight: " << x )
+ _weight=x;
}
virtual void kind (const std::string& name)
{
return this->_node;
}
std::string _kind;
+ double _weight;
};
template <class T> inlinetypeParser<T> inlinetypeParser<T>::inlineParser;
DEBTRACE( "inline_script: " << f._code )
_node=theRuntime->createScriptNode(_kind,_name);
_node->setScript(f._code);
+ if(_weight>0)_node->setWeight(_weight);
}
template <>
fnode=theRuntime->createFuncNode(_kind,_name);
fnode->setScript(f._code);
fnode->setFname(f._name);
+ if(_weight>0)fnode->setWeight(_weight);
_node=fnode;
}