#ifdef POSITION
/*
 * $Id: Component_generate_file.cpp 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Component.h"
#include "Common/include/Environment.h"

namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "Component::generate_file"
  void Component::generate_file (void)
  {
    log_printf(FUNC,Behavioural,"Component::generate_file","Begin");

    try 
      {
        directory();

	XML xml = toXML();

	xml.filename_extension (".pos");
	
	xml.generate_file(MORPHEO_POSITION,"ISO-8859-1");

      }
    catch (ErrorMorpheo e)
      {
	throw ERRORMORPHEO(FUNCTION,toString(_("Component \"%s\" have a bad mapping : %s\n")),_entity->get_name().c_str(),e.what().c_str());
      }

    log_printf(FUNC,Behavioural,"Component::generate_file","End");
  };

}; // end namespace behavioural          
}; // end namespace morpheo              
#endif
