echo ""
echo " to run IDLparser:"
echo ""
- echo " $0 -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,multistudy=<component_multistudy>][,remove=component_name] <file.idl> "
+ echo " $0 -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,remove=component_name] <file.idl> "
echo ""
echo " to have omniidl help:"
echo ""
*/
typedef string SalomeReference;
-//! List of file names
- typedef sequence<string> ListOfFileNames;
//! List of modification dates of a study
typedef sequence<string> ListOfDates ;
//! An unbounded sequence of strings
ComponentType type;
string name;
string username;
- boolean multistudy;
ImplType implementationType;
string implname;
string icon;
*/
readonly attribute string componentusername;
-/*! \brief Get whether the component is multistudy or not
-*/
- readonly attribute boolean multistudy;
-
/*! \brief Get the type of the component
*/
readonly attribute ComponentType component_type ;
-# running : one or more running studies
*/
SessionState state ;
- //! Number of running studies
- short runningStudies ;
+
//! It is True if GUI is active in the session
boolean activeGUI ;
} ;
{
//! This exception is raised when trying to stop the %session with active GUI
exception GUIActive {} ;
-//! This exception is raised when trying to stop the %session with a number of running studies.
- exception RunningStudies {} ;
+//! This exception is raised when trying to stop the %session with running study.
+ exception RunningStudy {} ;
//! Launches GUI in the session
void GetInterface();
Engines::EngineComponent GetComponent(in string theLibraryName);
//! Stops the %Session (It must be idle)
- void StopSession() raises(GUIActive, RunningStudies) ;
+ void StopSession() raises(GUIActive, RunningStudy) ;
//! Gets Session State
StatSession GetStatSession() ;
<component-author>NRI</component-author>
<component-version>@SALOMEKERNEL_VERSION@</component-version>
<component-comment>GUI Neutral Context</component-comment>
- <component-multistudy>1</component-multistudy>
<constraint>hostname = muna</constraint>
</component>
<component-author>NRI</component-author>
<component-version>@SALOMEKERNEL_VERSION@</component-version>
<component-comment>GUI Neutral Context</component-comment>
- <component-multistudy>1</component-multistudy>
<constraint>'linux' ~ OS</constraint>
</component>
<component>
<component-author>NRI</component-author>
<component-version>@SALOMEKERNEL_VERSION@</component-version>
<component-comment>GUI Neutral Context</component-comment>
- <component-multistudy>1</component-multistudy>
<constraint>'linux' ~ OS</constraint>
</component>
</component-list>
extern bool _Sleeping ;
static Engines_Component_i * theEngines_Component ;
-bool Engines_Component_i::_isMultiStudy = false;
bool Engines_Component_i::_isMultiInstance = false;
/*! \class Engines_Component_i
std::string getContainerName();
void setContainerName();
- static bool isMultiStudy();
static bool isMultiInstance();
static std::string GetDynLibraryName(const char *componentName);
Salome_file_i * file);
protected:
- static bool _isMultiStudy;
static bool _isMultiInstance;
std::string _instanceName ;
//----------------------------------------------------------------------
// Function : SALOME_ModuleCatalog_AcomponentImpl
// Purpose : Constructor
-// Affect the component name, type,icone, a bool to define
-// if it's multistudy or not.
+// Affect the component name, type,icone
// Affect too the constraint and the interfaces of the component
// and the pathes prefixes for all computers
//----------------------------------------------------------------------
return CORBA::string_dup(_Component.username);
}
-//----------------------------------------------------------------------
-// Function : multistudy
-// Purpose : define if a component can be multistudy or not
-//----------------------------------------------------------------------
-CORBA::Boolean SALOME_ModuleCatalog_AcomponentImpl::multistudy()
-{
- return _Component.multistudy ;
-}
-
-
//----------------------------------------------------------------------
// Function : implementation type
// Purpose : return the implementation type : C++ (dyn lib), Python (module) or executable
*/
virtual char* componentusername();
- //! method to define if a component can be multistudy or not
- /*!
- \return true if the component supports multistudy
- */
- virtual CORBA::Boolean multistudy();
-
//! method to define the type of the component
/*!
\return the component type
void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C)
{
MESSAGE("Name : " << C->componentname());
- MESSAGE("Type : " << C->component_type() << " multistudy : " << C->multistudy());
MESSAGE("Constraint : " << C->constraint());
MESSAGE("Icon : " << C->component_icone());
test_component_name = "component-name";
test_component_username = "component-username";
test_component_type = "component-type" ;
- test_component_multistudy = "component-multistudy";
test_component_icon = "component-icone" ;
test_component_impltype = "component-impltype";
test_component_implname = "component-implname";
_aModule.type = OTHER ;
}
- // Tag test_component_multistudy
- if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
- _aModule.multistudy = atoi( aContent.c_str() ) != 0;
-
// Tag test_component_impltype
if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
_aModule.implementationType = aContent;
const char *test_component_name;
const char *test_component_username;
const char *test_component_type ;
- const char *test_component_multistudy ;
const char *test_component_icon ;
const char *test_component_impltype;
const char *test_component_implname;
std::string name;
std::string username;
ParserComponentType type;
- bool multistudy;
std::string icon;
std::string constraint;
ParserInterfaces interfaces;
<< " name : " << C.name << std::endl;
f << " user name : " << C.username << std::endl;
f << " type : " << C.type << std::endl;
- f << " multistudy : " << (C.multistudy ? "yes" : "no")
- << std::endl;
f << " icon : " << C.icon << std::endl;
f << " constraint : " << C.constraint << std::endl;
{
C_corba.name = CORBA::string_dup(C_parser.name.c_str());
C_corba.username = CORBA::string_dup(C_parser.username.c_str());
- C_corba.multistudy = C_parser.multistudy;
C_corba.icon = CORBA::string_dup(C_parser.icon.c_str());
C_corba.type = ComponentTypeConvert[C_parser.type];
if(C_parser.implementationType == "EXE")
"COMP_TYPE" : "",
"COMP_NAME" : "",
"COMP_UNAME" : "",
- "COMP_MULT" : "",
"COMP_IMPL" : ""
}
self.addNamedChild('component-author', common_data["AUTHOR"])
self.addNamedChild('component-version', common_data["VERSION"])
self.addNamedChild('component-comment', 'unknown')
- self.addNamedChild('component-multistudy', common_data["COMP_MULT"])
self.addNamedChild('component-impltype', common_data["COMP_IMPL"])
self.addNamedChild('component-icone', common_data["ICON"])
self.addNamedChild('constraint')
for i in ['component-username', 'component-author',
'component-type', 'component-icone', 'component-version',
- 'component-multistudy', 'component-impltype', 'constraint']:
+ 'component-impltype', 'constraint']:
ext = C.getChild(i)
int = self.getChild(i)
if int is None:
common_data["COMP_NAME"] = getParamValue("name", "", args)
common_data["COMP_UNAME"] = getParamValue("username", "", args)
common_data["COMP_TYPE"] = getParamValue("type", "OTHER", args)
- common_data["COMP_MULT"] = getParamValue("multistudy", "1", args)
common_data["COMP_IMPL"] = getParamValue("impltype", "1", args)
print common_data
if __name__ == "__main__":
print
- print "Usage : omniidl -bIDLparser [-I<catalog files directory>]* -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,username=<component_username>][,multistudy=<component_multistudy>][,impltype=<implementation type : 0 (python), 1 (C++)>] <file.idl>"
+ print "Usage : omniidl -bIDLparser [-I<catalog files directory>]* -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,username=<component_username>][,impltype=<implementation type : 0 (python), 1 (C++)>] <file.idl>"
print
extern bool _Sleeping ;
static Engines_Parallel_Component_i * theEngines_Component ;
-bool Engines_Parallel_Component_i::_isMultiStudy = false;
bool Engines_Parallel_Component_i::_isMultiInstance = false;
//=============================================================================
PortableServer::ObjectId * getId();
Engines_Parallel_Container_i *GetContainerPtr();
- static bool isMultiStudy();
static bool isMultiInstance();
static std::string GetDynLibraryName(const char *componentName);
Engines::Parallel_Salome_file_proxy_impl * file);
protected:
- static bool _isMultiStudy;
static bool _isMultiInstance;
std::string _instanceName ;
// purpose : Removes files listed in theFileList
//============================================================================
void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
+ const std::list<std::string>& theFiles,
const bool IsDirDeleted)
{
std::string aDirName = theDirectory;
- int i, aLength = theFiles.length();
- for(i=1; i<=aLength; i++) {
+ for(std::list<std::string>::const_iterator it = theFiles.begin(); it != theFiles.end(); it++) {
std::string aFile(aDirName);
- aFile += theFiles[i-1];
+ aFile += *it;
if(!Exists(aFile)) continue;
#ifdef WIN32
{
SALOMEDS::TMPFile*
PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames,
+ const std::list<std::string>& theFiles,
+ const std::list<std::string>& theFileNames,
const int theNamesOnly)
{
- int i, aLength = theFiles.length();
+ int i = 0, aLength = theFiles.size();
if(aLength == 0)
return (new SALOMEDS::TMPFile);
//Determine the required size of the buffer
- for(i=0; i<aLength; i++) {
+ std::list<std::string>::const_iterator it_files = theFiles.begin();
+ std::list<std::string>::const_iterator it_names = theFileNames.begin();
+ for(; it_files != theFiles.end(); it_files++, it_names++, i++) {
//Check if the file exists
if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
- std::string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ std::string aFullPath = aTmpDir + *it_files;
if(!Exists(aFullPath)) continue;
#ifdef WIN32
std::ifstream aFile(aFullPath.c_str(), std::ios::binary);
aFileSize[i] = aFile.tellg();
aBufferSize += aFileSize[i]; //Add a space to store the file
}
- aFileNameSize[i] = strlen(theFileNames[i])+1;
+ aFileNameSize[i] = (*it_names).length()+1;
aBufferSize += aFileNameSize[i]; //Add a space to store the file name
aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name,
// 8 bytes: length of the file itself
aCurrentPos = 4;
- for(i=0; i<aLength; i++) {
+ it_files = theFiles.begin();
+ it_names = theFileNames.begin();
+ for(; it_files != theFiles.end(); it_files++, it_names++, i++) {
std::ifstream *aFile;
if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
- std::string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ std::string aFullPath = aTmpDir + *it_files;
if(!Exists(aFullPath)) continue;
#ifdef WIN32
aFile = new std::ifstream(aFullPath.c_str(), std::ios::binary);
aCurrentPos += 4;
//Copy the file name to the buffer
- memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]);
+ memcpy((aBuffer + aCurrentPos), (*it_names).c_str(), aFileNameSize[i]);
aCurrentPos += aFileNameSize[i];
if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
SALOMEDS::TMPFile*
SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
+ const std::list<std::string>& theFiles,
const int theNamesOnly)
{
- SALOMEDS::ListOfFileNames aFileNames(theFiles);
+ std::list<std::string> aFileNames(theFiles);
return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly);
}
SALOMEDS::TMPFile*
-SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames)
+SALOMEDS_Tool::PutFilesToStream(const std::list<std::string>& theFiles,
+ const std::list<std::string>& theFileNames)
{
return ::PutFilesToStream("",theFiles,theFileNames,0);
}
// function : PutStreamToFile
// purpose : converts the stream "theStream" to the files
//============================================================================
-SALOMEDS::ListOfFileNames_var
+std::list<std::string>
SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
const std::string& theToDirectory,
const int theNamesOnly)
{
- SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
+ std::list<std::string> aFiles;
if(theStream.length() == 0)
return aFiles;
//Copy the number of files in the stream
memcpy(&aNbFiles, aBuffer, sizeof(int));
- aFiles->length(aNbFiles);
-
for(i=0; i<aNbFiles; i++) {
//Put a length of the file name to aFileNameSize
aFile.close();
aCurrentPos += aFileSize;
}
- aFiles[i] = CORBA::string_dup(aFileName);
+ aFiles.push_back(CORBA::string_dup(aFileName));
delete[] aFileName;
}
// Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
// if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
static void RemoveTemporaryFiles(const std::string& theDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
+ const std::list<std::string>& theFiles,
const bool IsDirDeleted);
// Converts files listed in <theFiles> which are in <theFromDirectory> into a byte sequence TMPFile
static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
+ const std::list<std::string>& theFiles,
const int theNamesOnly = 0);
// Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
- static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames);
+ static SALOMEDS::TMPFile* PutFilesToStream(const std::list<std::string>& theFiles,
+ const std::list<std::string>& theFileNames);
// Converts a byte sequence <theStream> to files and places them in <theToDirectory>
- static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
- const std::string& theToDirectory,
- const int theNamesOnly = 0);
+ static std::list<std::string> PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
+ const std::string& theToDirectory,
+ const int theNamesOnly = 0);
// Returns the name by the path
// for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"