From c4e3df4c1b76c4c8dae3a821a75acd049858e74e Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 17 Mar 2005 07:45:50 +0000 Subject: [PATCH] Dump Python --- src/Container/Component_i.cxx | 15 +++++++++++++++ src/Container/SALOME_ComponentPy.py | 5 +++++ src/Container/SALOME_Component_i.hxx | 2 ++ 3 files changed, 22 insertions(+) diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index ff343a2cc..14dce5a29 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -393,6 +393,21 @@ CORBA::Long Engines_Component_i::CpuUsed_impl() { return cpu ; } +Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Object_ptr theStudy, + CORBA::Boolean isPublished, + CORBA::Boolean& isValidScript) +{ + char* aScript = "def RebuildData(theStudy): pass"; + char* aBuffer = new char[strlen(aScript)+1]; + strcpy(aBuffer, aScript); + CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; + int aBufferSize = strlen(aBuffer)+1; + Engines::TMPFile_var aStreamFile = new Engines::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1); + isValidScript = true; + return aStreamFile._retn(); +} + + // Send message to event channel void Engines_Component_i::sendMessage(const char *event_type, const char *message) { diff --git a/src/Container/SALOME_ComponentPy.py b/src/Container/SALOME_ComponentPy.py index 10a47c978..000775318 100755 --- a/src/Container/SALOME_ComponentPy.py +++ b/src/Container/SALOME_ComponentPy.py @@ -218,4 +218,9 @@ class SALOME_ComponentPy_i (Engines__POA.Component): return 0 #------------------------------------------------------------------------- + + def DumpPython(self, theStudy, isPublished): + aBuffer = "def RebuildData(theStudy): pass" + return (aBuffer, 1) + #------------------------------------------------------------------------- diff --git a/src/Container/SALOME_Component_i.hxx b/src/Container/SALOME_Component_i.hxx index 620ca1499..30b67d3b4 100644 --- a/src/Container/SALOME_Component_i.hxx +++ b/src/Container/SALOME_Component_i.hxx @@ -92,6 +92,8 @@ public: long CpuUsed() ; CORBA::Long CpuUsed_impl() ; + virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean isPublished, CORBA::Boolean& isValidScript); + static std::string GetDynLibraryName(const char *componentName); static std::string BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname); protected: -- 2.39.2