예제 #1
0
bool CreateDesertFormulaSet(FormulaSet &fs, UdmDesertMap &des_map, DesertUdmMap &inv_des_map )
{
	CustomFormula ft;
	Element owner;
	long fts_id;
	set<CustomFormula> fomula_set = fs.CustomFormula_kind_children();
	set<CustomFormula>::iterator fit;

	ASSERT(!fomula_set.empty());
	//create constraint set
	fts_id = CreateFormulaSet(((string)fs.name()).c_str());
	DoMap(fs, des_map, inv_des_map, fts_id);


	for(fit = fomula_set.begin(); fit != fomula_set.end(); fit++)
	{
		//get owner element
		ft = *(fit);
		owner = ft.context();
		
		//lookup in the map 
		long owner_id = GetID(owner, des_map);

		//create constraint
		
		long ft_id = CreateFormula(((string)ft.name()).c_str(), 
						fts_id, 
						owner_id, 
						((string)ft.expression()).c_str());
	
		DoMap(ft, des_map, inv_des_map,  ft_id);

	}//eo for (fit)
	return true;
};//eo bool CreateDesertConstrainSet