model_server/cmIntegration/src/Integrator.cxx
//-------------------------------------------------------------------------------------
// This protected function forms a string which contains complete service name for
// the current integrator.
//-------------------------------------------------------------------------------------
This protected function forms a string which contains complete service name for
the current integrator.
This protected function forms a string which contains complete service name for the current integrator .
string CIntegrator::GetServiceName() 
{	
	if(m_ServiceName.empty()) {
	        string hostName;
	        string userName;
    	        char hostNameSys[1024];
    	        gethostname(hostNameSys,1024);
	        hostName = hostNameSys;
	        char*		userNameEnv;
	        userNameEnv = getenv("USER");
	        if(userNameEnv == NULL) {
		        userName = "";
	        } else {
		        userName = userNameEnv;
	        }
	        m_ServiceName = hostName+":"+userName+":"+GetIntegratorType()+":"+GetIntegratorName();
        }
	return m_ServiceName;
}
string CIntegrator :: GetServiceName ( ) { if ( m_ServiceName . empty ( ) ) { string hostName ; string userName ; char hostNameSys [ 1024 ] ; gethostname ( hostNameSys , 1024 ) ; hostName = hostNameSys ; char * userNameEnv ; userNameEnv = getenv ( " " ) ; if ( userNameEnv == NULL ) { userName = " " ; } else { userName = userNameEnv ; } m_ServiceName = hostName + " " + userName + " " + GetIntegratorType ( ) + " " + GetIntegratorName ( ) ; } return m_ServiceName ; }
This protected function forms a string which contains complete service name for
the current integrator.
This protected function forms a string which contains complete service name for the current integrator .
// Getting current host name   // Getting current user name // Making service name string