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

#include "Behavioural/include/Interfaces.h"


namespace morpheo              {
namespace behavioural          {

  string Interfaces::get_interface (void)
  {
    uint32_t               depth          = 0;
    string                 separator      = "\n";
    bool                   last_separator = false;

    list<Interface_fifo*>::iterator i  = _list_interface->begin();
    bool                   empty = _list_interface->empty();

    string                 tab   = string(depth,'\t');
    ostringstream          text;

    if (not empty)
      {
	// First
	if (i != _list_interface->end())
	  {
	    text << tab << **i;
	    ++i;
	  }
	
	while (i != _list_interface->end())
	  {
	    text << separator;
	    text << tab << **i;
	    ++i;
	  }
	
	if (last_separator)
	  text << separator;
      }

    return text.str();
  };

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