+ else
+ {
+ // std::cout << pthread_self() << "Engines_Component_i::CpuUsed _ThreadId "
+ // << _ThreadId << " " << _serviceName<< " _StartUsed "
+ // << _StartUsed << std::endl ;
+ }
+#else
+ // NOT implemented yet
+#endif
+
+
+ return cpu ;
+}
+
+void CallCancelThread()
+{
+ if ( theEngines_Component )
+ theEngines_Component->CancelThread() ;
+}
+
+//=============================================================================
+/*!
+ * C++ method:
+ */
+//=============================================================================
+
+void Engines_Component_i::CancelThread()
+{
+ _CanceledThread = true;
+}
+
+//=============================================================================
+/*!
+ * C++ method: Send message to event channel
+ */
+//=============================================================================
+
+void Engines_Component_i::sendMessage(const char *event_type,
+ const char *message)
+{
+ _notifSupplier->Send(_graphName.c_str(), _nodeName.c_str(), event_type, message);
+}
+
+//=============================================================================
+/*!
+ * C++ method: return standard library name built on component name
+ */
+//=============================================================================
+
+std::string Engines_Component_i::GetDynLibraryName(const char *componentName)
+{
+ std::string prefix, suffix;
+ std::string cname = componentName;
+#if !defined(WIN32)
+ prefix = "lib";
+#endif
+#if defined(WIN32)
+ suffix = "dll";
+#elif defined(__APPLE__)
+ suffix = "dylib";
+#else
+ suffix = "so";
+#endif
+ std::string ret = prefix + cname + std::string("Engine.") + suffix;
+ return ret;
+}
+
+//=============================================================================
+/*!
+ * C++ method: DumpPython default implementation
+ */
+//=============================================================================
+
+Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Boolean /*isPublished*/,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean& isValidScript)
+{
+ const char* aScript = isMultiFile ? "def RebuildData(): pass" : "";
+ char* aBuffer = new char[strlen(aScript)+1];
+ strcpy(aBuffer, aScript);
+ size_t aBufferSize = strlen(aBuffer)+1;
+ Engines::TMPFile_var aStreamFile = new Engines::TMPFile((CORBA::ULong)aBufferSize, (CORBA::ULong)aBufferSize, (CORBA::Octet*)aBuffer, 1);
+ isValidScript = true;
+ return aStreamFile._retn();
+}
+
+Engines::Salome_file_ptr
+Engines_Component_i::getInputFileToService(const char* service_name,
+ const char* Salome_file_name)
+{
+ // Try to find the service, if it doesn't exist, we throw an exception.
+ _Service_file_map_it = _Input_Service_file_map.find(service_name);
+ if (_Service_file_map_it == _Input_Service_file_map.end()) {
+ SALOME::ExceptionStruct es;
+ es.type = SALOME::INTERNAL_ERROR;
+ es.text = "service doesn't have salome files";
+ throw SALOME::SALOME_Exception(es);