/*
 * $Id: Interface_signal_name.cpp 113 2009-04-14 18:39:12Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Interface.h"

namespace morpheo              {
namespace behavioural          {

  std::string Interface::signal_name          (std::string      name_interface,
					       std::string      name_signal   ,
					       direction_t direction     )
  {
    log_printf(FUNC,Behavioural,"signal_name","Begin");

    std::string str_direction = (direction==INTERNAL)?"":toString(direction);
    std::string str_interface = name_interface;
    std::string str_signal    = name_signal;

//     LowerCase(str_direction);    
//     LowerCase(str_interface);
//     LowerCase(str_signal   );
    
    std::string signame = "";
    bool need_underscore = false;

    if (str_direction != "")
      {
        signame +=                            str_direction;
        need_underscore = true;
      }
    if (str_interface != "")
      {
        signame += ((need_underscore)?"_":"")+str_interface;
        need_underscore = true;
      }
    if (str_signal != "")
      {
        signame += ((need_underscore)?"_":"")+str_signal;
//      need_underscore = true;
      }

    log_printf(FUNC,Behavioural,"signal_name","End");

    return signame;
  };

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