/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Interface.h"

namespace morpheo              {
namespace behavioural          {

  XML Interface::toXML (void)
  {
    XML xml ("interface");
    
    xml.balise_open_begin ("interface");
    xml.  attribut        ("name"         ,_name                 );
    xml.  attribut        ("direction"   ,toString(_direction   ));
    xml.  attribut        ("localisation",toString(_localisation));
    xml.balise_open_end   ();
    xml.  text            (get_comment());

    if (_list_signal.empty()== false)
      {
	list<Signal>::iterator i     = _list_signal.begin();

	while (i != _list_signal.end())
	  {
	    xml.  insert_XML ((*i).toXML());
	    ++i;
	  }
      }

    xml.balise_close      ();
     
    return xml;
  };

}; // end namespace behavioural          
}; // end namespace morpheo              
