Exemplo n.º 1
0
void Component::invokeEx( Project& project, FCO& currentFCO, const std::set<FCO>& setSelectedFCOs, long lParam )
{
#ifdef GME_ADDON
	project->setAutoCommit( false);
#endif
	// ======================

	// Insert application specific code here

   BON::Folder folder = project->getRootFolder ();
   std::set<BON::Model> model_set = folder->getChildModels ();
   if (model_set.size () > 0)
   {
	 for (std::set<BON::Model>::iterator iter = model_set.begin (); iter!=model_set.end (); iter++)
	  {
		if ((*iter)->getObjectMeta ().name () == "Middleware")
		{
		  Pattern_Factory pattern_factory (project);
		  std::auto_ptr <Pattern> pattern;
		  std::set<BON::Model> pattern_models = (*iter)->getChildModels ();
		  for (std::set<BON::Model>::iterator pattern_iter = pattern_models.begin (); pattern_iter!= pattern_models.end(); pattern_iter++)
		  {
			pattern.reset (pattern_factory.get_pattern (*pattern_iter));
			if (pattern.get ())
			{
			  project->consoleMsg ("Creating initialization file...!",msgtype_enum(1));
			  if (pattern->create_init_file () != 0)
				project->consoleMsg ("Initialization file created!",msgtype_enum(1));
			}
		  }
		  break;
		}
	  }
   }
}
void Component::traversalProject(Project& p)
{
	BON::Folder folder = p->getRootFolder();
		std::set<BON::Model> models = folder->getChildModels();
		for(auto it=models.begin(); it!=models.end(); it++)
		{
			GarbledCircuit_BON::Library l(*it);
			std::set<GarbledCircuit_BON::GarbledCircuit> gc = l->getGarbledCircuit();
			for(auto i=gc.begin(); i!=gc.end(); i++)
			{
				traversalGarbledCircuit(*i);
			}
		}
}