-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# PLEASE DO NOT MODIFY configure.in FILE
# ALL CHANGES WILL BE DISCARDED BY THE NEXT
# build_configure COMMAND
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# make_config.in: template for make_config script
# make_config is used by check_cas.m4 to generate
# config.h file in case it cannot be found in OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : KERNEL_version.h
// Author : Vadim SANDLER
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume BOULANT (CSSI)
# Date : 09/11/2005
-Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys,os
def getNSparams(info=""):
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os, sys, pickle, string, signal
from launchConfigureParser import verbose
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#clean appli
DELCOM="rm -rf bin lib share doc idl env.d envd USERS getAppliPath.py searchFreePort.sh runAppli runConsole runSession runRemote.sh runTests SalomeApp.xml *.pyc *~ .bashrc"
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file appli_gen.py
# Create a %SALOME application (virtual Salome installation)
#
usage="""usage: %prog [options]
Typical use is:
- python appli_gen.py
+ python appli_gen.py
Typical use with options is:
python appli_gen.py --verbose --prefix=<install directory> --config=<configuration file>
"""
modules_tag = "modules"
module_tag = "module"
samples_tag = "samples"
+resources_tag = "resources"
# --- names of attributes in XML configuration file
nam_att = "name"
if self.space == [appli_tag, prereq_tag] and path_att in attrs.getNames():
self.config["prereq_path"] = attrs.getValue( path_att )
pass
+ # --- if we are analyzing "resources" element then store its "path" attribute
+ if self.space == [appli_tag, resources_tag] and path_att in attrs.getNames():
+ self.config["resources_path"] = attrs.getValue( path_att )
+ pass
# --- if we are analyzing "samples" element then store its "path" attribute
if self.space == [appli_tag, samples_tag] and path_att in attrs.getNames():
self.config["samples_path"] = attrs.getValue( path_att )
print "Configure parser: parse error in configuration file %s" % filename
pass
except xml.sax.SAXException, inst:
- print inst.args
+ print inst.args
print "Configure parser: error in configuration file %s" % filename
pass
except:
command = "cp -p " + filename + ' ' + os.path.join(home_dir,"config_appli.xml")
os.system(command)
pass
-
+
virtual_salome.mkdir(os.path.join(home_dir,'env.d'))
if os.path.isfile(_config["prereq_path"]):
command='cp -p ' + _config["prereq_path"] + ' ' + os.path.join(home_dir,'env.d','envProducts.sh')
command='export DATA_DIR=' + _config["samples_path"] +'\n'
f.write(command)
pass
+ if _config.has_key("resources_path") and os.path.isfile(_config["resources_path"]):
+ command='export USER_CATALOG_RESOURCES_FILE=' + os.path.abspath(_config["resources_path"]) +'\n'
+ f.write(command)
+
f.close()
<parameter name="killall" value="no"/>
<parameter name="noexcepthandler" value="no"/>
<parameter name="modules" value="""
- f.write(command)
+ f.write(command)
f.write('"')
for module in _config["guimodules"][:-1]:
f.write(module)
</section>
</document>
"""
- f.write(command)
+ f.write(command)
f.close()
#Add default CatalogResources.xml file
hostname="localhost" />
</resources>
"""
- f.write(command)
+ f.write(command)
f.close()
#Add USERS directory with 777 permission to store users configuration files
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SALOME_ROOT=${HOME}/SALOME2
INSTALL_ROOT=${SALOME_ROOT}/Install
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# If not running interactively, don't do anything:
+
[ -z "$PS1" ] && return
# keep original settings (debian)
-Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#------------------------------------------------
# to be sourced first, used in following scripts
#------------------------------------------------
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------------------------------------------------
# ---- openpbs
#
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# --- example to adapt to your own configuration ---
# --- envSalome.sh gives a set of MODULE_ROOT_DIR, to source
# --- you must at least define and export KERNEL_ROOT_DIR
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os
def relpath(target, base):
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# --- run command in SALOME environment from remote call, ssh or rsh
# - SALOME configuration is defined by :
# - list of MODULE_ROOT_DIR
# $4 : if $3 == WORKINGDIR, the path to the workingdir
# $5 (or $3 if no workingdir given) and following : local command to execute, with args
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-#
+
APPLI_HOME=`dirname $0`
export APPLI=`${APPLI_HOME}/getAppliPath.py`
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#
+
# Useful shell to run executable progs or shells under Salome env
# Use it with args to run a program : runSession python -i myprog.py
# Use it without args to run an interactive shell under Salome env
-#
APPLI_HOME=`dirname $0`
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# --- define port for CORBA naming service
-#
+
searchFreePort() {
echo -n "Searching for a free port for naming service: "
NSPORT=2810
<application>
<prerequisites path="/data/tmplgls/secher/SALOME_V4.1.1_MD08/env_products.sh"/>
+<resources path="myCata.xml"/>
<modules>
<!-- variable name <MODULE>_ROOT_DIR is built with <MODULE> == name attribute value -->
<!-- <MODULE>_ROOT_DIR values is set with path attribute value -->
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
comName=`which $0`
rep=`dirname $comName`
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os
import sys
import setenv
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file killSalome.py
# Stop all %SALOME servers from all sessions by killing them
#
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file killSalomeWithPort.py
# Stop all %SALOME servers from given sessions by killing them
#
-# The sessions are indicated by their ports on the command line as in :
-#
-# killSalomeWithPort.py 2811 2815
+# The sessions are indicated by their ports on the command line as in :
+# \code
+# killSalomeWithPort.py 2811 2815
+# \endcode
#
import os, sys, pickle, signal, commands,glob
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os, glob, string, sys, re
import xml.sax
import optparse
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import socket
import os
import sys
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os, re, socket
#import commands
from server import *
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## @package orbmodule
# \brief Module that provides a client for %SALOME
#
-#
import sys,os,time
import string
#! /bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#log files localization
#
import os, commands, sys, re, string, socket
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#log files localization
#
BaseDir=/tmp
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-@REM Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE\r
-@REM\r
-@REM Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-@REM CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
-@REM\r
-@REM This library is free software; you can redistribute it and/or\r
-@REM modify it under the terms of the GNU Lesser General Public\r
-@REM License as published by the Free Software Foundation; either\r
-@REM version 2.1 of the License.\r
-@REM\r
-@REM This library is distributed in the hope that it will be useful,\r
-@REM but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-@REM Lesser General Public License for more details.\r
-@REM\r
-@REM You should have received a copy of the GNU Lesser General Public\r
-@REM License along with this library; if not, write to the Free Software\r
-@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-@REM\r
-@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
-@REM\r
-\r
+@REM Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+@REM
+@REM Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+@REM CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
@"%PYTHONBIN%" "%KERNEL_ROOT_DIR%\bin\salome\envSalome.py" "%PYTHONBIN%" "%KERNEL_ROOT_DIR%\bin\salome\runSalome.py" %*\r
#!/bin/csh -f
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-
runSalome --gui --modules=GEOM,SMESH,VISU,MED --killall
#!/bin/ksh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-
searchFreePort() {
echo -n "Searching for a free port for naming service: "
NSPORT=2810
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## @package runSalome
# \brief Module that provides services to launch SALOME
#
-#
import sys, os, string, glob, time, pickle, re
import orbmodule
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os
import sys
#-------------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## @package salome_session
# \brief Module that provides the SalomeSession object that helps to launch
# a SALOME script session
#
-#
import os
import sys
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
# File : salome_utils.py
# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
# ---
-#
+
## @package salome_utils
# \brief Set of utility functions used by SALOME python scripts.
-#
-#
#
# Exported functions
#
+
__all__ = [
'getORBcfgInfo',
'getHostFromORBcfg',
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os, sys, string
process_id = {}
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os, string, glob, time, pickle
import orbmodule
from launchConfigureParser import verbose
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file showNS.py
# \brief display the contents of %SALOME naming service
#
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file shutdownSalome.py
# shutdown all %SALOME servers and naming service
#
-#
import time
-import salome
-salome.salome_init()
-salome.lcc.shutdownServers()
+import salome_kernel
+orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init()
+lcc.shutdownServers()
#give some time to shutdown to complete
time.sleep(1)
-salome.LifeCycleCORBA.killOmniNames()
+salome_kernel.LifeCycleCORBA.killOmniNames()
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""Create a virtual Salome installation
Based on a script created by Ian Bicking.
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file waitContainers.py
# \brief command to wait until containers are launched
#
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## \file waitNS.py
# \brief command to wait until module catalog server is launched
#
+
import orbmodule
clt=orbmodule.client()
clt.waitNS("/Kernel/ModulCatalog")
#! /bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
status=1
while [ $status -ne 0 ]; do
ls $HOME/$APPLI/USERS/.omniORB_${USER}_last.cfg >& /dev/null
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-\r
+@REM Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
%PYTHONBIN% salome_adm\cmake_files\am2cmake.py --kernel\r
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ====================================================================
# This script is just here to illustrate the procedure for preparing
# the configure process. It creates configuration files (ex:
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ================================================================
# Process this file with autoconf to produce a configure script
# ================================================================
#AC_PREREQ(2.59)
#
-AC_INIT([Salome2 Project], [5.1.3], [paul.rascle@edf.fr], [SalomeKERNEL])
+AC_INIT([Salome2 Project], [5.1.4], [paul.rascle@edf.fr], [SalomeKERNEL])
# AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
# scripts such as config.guess, install-sh, ...
doc/salome/Makefile \
doc/salome/tui/Makefile \
doc/salome/tui/doxyfile \
+ doc/salome/tui/static/header.html \
doc/salome/gui/Makefile \
doc/salome/gui/doxyfile \
+ doc/salome/gui/static/header.html \
idl/Makefile \
idl/Calcium_Ports.idl \
resources/Makefile \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Paul RASCLE (EDF)
# Date : 06/02/2006
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# --- SALOME Required packages : configuration example,SALOME2 V2_2_0
# --- all path are relative to ${INSTALLROOT}
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Paul RASCLE (EDF)
# Date : 16/02/2006
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
+EXTRA_DIST = images static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/KERNEL
+guidoc_DATA = images/head.png
+
usr_docs: doxyfile
echo "Running doxygen in directory: "`pwd`; \
$(DOXYGEN) $< ;
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME v.@VERSION@"
+PROJECT_NAME = "SALOME KERNEL User's Guide"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = KERNEL
CREATE_SUBDIRS = NO
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
-HTML_STYLESHEET =
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
--- /dev/null
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #ffffff;
+}
+
+h1 {
+ text-align: center;
+ text-decoration: none;
+ border: none;
+ line-height: 25px;
+ text-align: center;
+// text-transform:uppercase;
+ background: #D9f4fd;
+ font-size: 12pt;
+ font-weight: bold;
+ border: 1px solid #CCCCCC;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+h2 {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+table {
+ font-size: 10pt;
+}
+
+CAPTION {
+ font-weight: bold
+}
+
+/* Link in the top navbar */
+A.qindex {}
+
+A.qindexRef {}
+
+/* Link to any cross-referenced Doxygen element inside a code section
+ (ex: header)
+*/
+A.code {
+ text-decoration: none;
+ font-weight: normal;
+ color: #4444ee
+}
+
+A.codeRef {
+ font-weight: normal;
+ color: #4444ee
+}
+
+A:hover {
+ text-decoration: none;
+ background-color: lightblue;
+}
+
+div.contents {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+}
+
+div.navpath {
+ font-size: 11pt;
+ border: 0 none;
+ text-align: left;
+}
+
+div.version {
+ background-color:#ffffde;
+ border:1px solid #cccccc;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+// -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+div.header {
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ margin-bottom: 10px;
+}
+
+div.tabs {
+ text-align: justify;
+ margin-left : 2px;
+ margin-right : 2px;
+ margin-top : 2px;
+ margin-bottom : 2px
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+div.footer {
+ background-color: #D9f4fd;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ margin-top: 15px;
+}
+
+DL.el {
+ margin-left: -1cm
+}
+
+/* A code fragment (ex: header) */
+div.fragment {
+ border: none;
+}
+
+/* In the alpha list (coumpound index), style of an alphabetical index letter */
+DIV.ah {
+ background-color: #CCCCCC;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px
+}
+
+/* Method name (+ type) */
+TD.md {
+ background-color: lightblue;
+ font-weight: bold;
+}
+
+/* Method parameter (some of them) */
+TD.mdname1 {
+ background-color: lightblue;
+ font-weight: bold; color: #602020;
+}
+
+/* Method parameter (some of them) */
+TD.mdname {
+ background-color: lightblue;
+ font-weight: bold;
+ color: #602020;
+ width: 600px;
+}
+
+/* Separator between methods group (usually empty, seems not supported by IE) */
+DIV.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold
+}
+
+DIV.groupText {
+ margin-left: 16px;
+ font-style: italic;
+ font-size: smaller
+}
+
+/*div.div-page {
+ background-color: #FFFFFF;
+ margin-left: 1em;
+ margin-right: 1em;
+ margin-top: 1em;
+ margin-bottom: 0.1em;
+
+ padding-left: 1em;
+ padding-right: 1em;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+
+ border: 2px solid #0D299A;
+ border-width: 2px;
+ border-color: #0D299A;
+}*/
+
+div.tabs {
+ text-align: justify;
+ margin-left : 2px;
+ margin-right : 2px;
+ margin-top : 2px;
+ margin-bottom : 2px
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+DIV.div-footer {
+ margin-left: 1em;
+ margin-right: 1em;
+ margin-bottom: 0.2em;
+ text-align: right;
+ font-size: 9pt;
+}
+
+/* In File List, Coumpound List, etc, 1st column of the index */
+TD.indexkey {
+ background-color: #CCCCCC;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+
+/* In File List, Coumpound List, etc, 2nd column of the index */
+TD.indexvalue {
+ background-color: #CCCCCC;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+
+span.keyword { color: #008000 }
+span.keywordtype { color: #604020 }
+span.keywordflow { color: #e08000 }
+span.comment { color: #800000 }
+span.preprocessor { color: #806020 }
+span.stringliteral { color: #002080 }
+span.charliteral { color: #008080 }
+
+/* @group Code Colorization */
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 10pt;
+}
+
+pre.fragment {
+ width: 95%;
+ border: 1px solid #CCCCCC;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-color:#EEF3F5;
+ padding: 4px 6px;
+ margin: 4px 1px 4px 1px;
+}
+
+/* Top Navigation style */
+
+div.navigation {
+ margin-bottom: 70px;
+}
+
+/* Left navigation panel style */
+
+body.ftvtree {
+ background-color: #D9f4fd;
+ margin: 10px;
+}
+
+div.directory {
+ margin: 0;
+}
+
+div.directory.p {
+ margin: 0;
+}
+
+h3.swap {
+ font-size: 10pt;
+ margin-bottom: 0;
+}
+
+/* Link to any cross-referenced Doxygen element */
+a.el {
+ text-decoration: none;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 9pt;
+ color: #551a8b;
+}
+
+a.el:hover {
+ background-color: transparent;
+}
+
+a.elRef {
+ font-weight: normal;
+}
+
+
+#MSearchBox {
+ -moz-border-radius:8px 8px 8px 8px;
+ background-color:white;
+ border:1px solid #84B0C7;
+ margin:0;
+ padding:0;
+ white-space:nowrap;
+}
+
+div.directory img {
+ vertical-align:-30%;
+}
+
+div.directory p {
+ white-space:nowrap;
+ margin: 0;
+}
+
+div.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+
+div.directory div {
+ display: none;
+ margin: 0px;
+}
+
+div.version {
+ background-color:#ffffde;
+ border:1px solid #cccccc;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+// -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+/* In File List, Coumpound List, etc, 1st column of the index */
+TD.indexkey {
+ background-color: #DDDDEE;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+
+/* In File List, Coumpound List, etc, 2nd column of the index */
+TD.indexvalue {
+ background-color: #EEEEFF;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+
+
+/* @group Member Descriptions */
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #FAFAFA;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #ccc;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #606060;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #606060;
+ font-weight: normal;
+ margin-left: 3px;
+}
+
+.memnav {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+}
+
+.memproto, .memdoc {
+ border: 1px solid #84b0c7;
+}
+
+.memproto {
+ padding: 0;
+ background-color: #d5e1e8;
+ font-weight: bold;
+ -webkit-border-top-left-radius: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+
+}
+
+
+
+.memdoc {
+ padding: 2px 5px;
+ background-color: #eef3f5;
+ border-top-width: 0;
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+/* @end */
+
<head>
</head>
<body>
-<hr style="width: 100%; height: 2px;">
+<div class="footer">
<div style="text-align: center;">
-Copyright © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+Copyright © 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</div>
+</div>
</body>
</html>
--- /dev/null
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>$title</title>
+ <link href="tabs.css" rel="stylesheet" type="text/css">
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
+</head>
+<div class="header"></div>
+<div align="right"><div class="version">Version: @VERSION@</div></div>
\ No newline at end of file
copy of ${KERNEL_ROOT_DIR}/bin/salome/config_appli.xml.
The file describes the list of %SALOME modules used in the application, with
their respective installation path. The configuration file also defines the
-path of an existing script which sets the %SALOME prerequisites,
-and optionnaly, the path of samples directory (SAMPLES_SRC).
+path of an existing script which sets the %SALOME prerequisites (tag "prerequisites"),
+and optionally, the path of samples directory (SAMPLES_SRC) (tag "samples")
+and the path of a catalog of resources (tag "resources").
+
The following command:
\code
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Paul RASCLE (EDF)
# Date : 16/02/2006
#
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
+EXTRA_DIST = images input static/footer.html static/doxygen.css
+
+tuidocdir = $(docdir)/tui/KERNEL
+tuidoc_DATA = images/head.png
+
dev_docs:
$(DOXYGEN) -u doxyfile; \
$(DOXYGEN) doxyfile
uninstall-local:
rm -rf $(DESTDIR)$(docdir)/tui/KERNEL
-
-EXTRA_DIST = static
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME v.@VERSION@"
+PROJECT_NAME = "SALOME KERNEL Developer"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = KERNEL
CREATE_SUBDIRS = NO
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = \
- @top_srcdir@/src/DSC
-FILE_PATTERNS = *.idl *.cxx *.hxx *.h *.hh *.i *c *.cc @DOXYGEN_PYTHON_EXTENSION@
+ @top_srcdir@/src/DSC \
+ @srcdir@/input
+FILE_PATTERNS = *.dox *.idl *.cxx *.hxx *.h *.hh *.i *c *.cc @DOXYGEN_PYTHON_EXTENSION@
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
-HTML_STYLESHEET =
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
--- /dev/null
+/*! \mainpage
+
+To browse the \b SALOME KERNEL module Developer Documentation, follow the links below or use navigation menu at the top of the page:
+<ul>
+<li> <a href="namespaces.html">Namespaces</a> - list of KERNEL namespaces and scripts.</li>
+<li> <a href="annotated.html">Data Structures</a> - list of all data structures and classes with brief descriptions.</li>
+<li> <a href="files.html">Files</a> - list of all files with brief descriptions.</li>
+</ul>
+
+*/
\ No newline at end of file
+#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#!/usr/bin/env python
-#
+
import getopt
import glob
import os.path
--- /dev/null
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #ffffff;
+}
+
+h1 {
+ text-align: center;
+ text-decoration: none;
+ border: none;
+ line-height: 25px;
+ text-align: center;
+// text-transform:uppercase;
+ background: #D9f4fd;
+ font-size: 12pt;
+ font-weight: bold;
+ border: 1px solid #CCCCCC;
+ margin-top: 50px;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+h2 {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+table {
+ font-size: 10pt;
+ padding-left: 20px;
+}
+
+CAPTION {
+ font-weight: bold
+}
+
+/* Link in the top navbar */
+A.qindex {}
+
+A.qindexRef {}
+
+/* Link to any cross-referenced Doxygen element inside a code section
+ (ex: header)
+*/
+A.code {
+ text-decoration: none;
+ font-weight: normal;
+ color: #4444ee
+}
+
+A.codeRef {
+ font-weight: normal;
+ color: #4444ee
+}
+
+A:hover {
+ text-decoration: none;
+ background-color: lightblue;
+}
+
+div.contents {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ padding: 20px;
+}
+
+div.navpath {
+ font-size: 11pt;
+}
+
+div.header {
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ margin-bottom:20px;
+}
+
+div.tabs {
+ text-align: justify;
+ margin-left : 2px;
+ margin-right : 2px;
+ margin-top : 2px;
+ margin-bottom : 2px
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+div.footer {
+ background-color: #D9f4fd;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+}
+
+div.div-footer {
+ background-color: #D9f4fd;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ text-align: center;
+}
+
+DL.el {
+ margin-left: -1cm
+}
+
+/* A code fragment (ex: header) */
+div.fragment {
+ border: none;
+}
+
+/* In the alpha list (coumpound index), style of an alphabetical index letter */
+DIV.ah {
+ background-color: #CCCCCC;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px
+}
+
+/* Method name (+ type) */
+TD.md {
+ background-color: lightblue;
+ font-weight: bold;
+}
+
+/* Method parameter (some of them) */
+TD.mdname1 {
+ background-color: lightblue;
+ font-weight: bold; color: #602020;
+}
+
+/* Method parameter (some of them) */
+TD.mdname {
+ background-color: lightblue;
+ font-weight: bold;
+ color: #602020;
+ width: 600px;
+}
+
+/* Separator between methods group (usually empty, seems not supported by IE) */
+DIV.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold
+}
+
+DIV.groupText {
+ margin-left: 16px;
+ font-style: italic;
+ font-size: smaller
+}
+
+/*div.div-page {
+ background-color: #FFFFFF;
+ margin-left: 1em;
+ margin-right: 1em;
+ margin-top: 1em;
+ margin-bottom: 0.1em;
+
+ padding-left: 1em;
+ padding-right: 1em;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+
+ border: 2px solid #0D299A;
+ border-width: 2px;
+ border-color: #0D299A;
+}*/
+
+div.tabs {
+ text-align: justify;
+ margin-left : 2px;
+ margin-right : 2px;
+ margin-top : 2px;
+ margin-bottom : 2px
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+/* In File List, Coumpound List, etc, 1st column of the index */
+TD.indexkey {
+ background-color: #DDDDEE;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+
+/* In File List, Coumpound List, etc, 2nd column of the index */
+TD.indexvalue {
+ background-color: #EEEEFF;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+
+span.keyword { color: #008000 }
+span.keywordtype { color: #604020 }
+span.keywordflow { color: #e08000 }
+span.comment { color: #800000 }
+span.preprocessor { color: #806020 }
+span.stringliteral { color: #002080 }
+span.charliteral { color: #008080 }
+
+/* @group Code Colorization */
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 10pt;
+}
+
+pre.fragment {
+ width: 95%;
+ border: 1px solid #CCCCCC;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-color:#EEF3F5;
+ padding: 4px 6px;
+ margin: 20px;
+}
+
+/* Top Navigation style */
+
+div.navigation {
+ margin-bottom:20px;
+}
+
+/* Left navigation panel style */
+
+body.ftvtree {
+ background-color: #D9f4fd;
+ margin: 10px;
+}
+
+div.directory {
+ margin: 0;
+}
+
+div.directory.p {
+ margin: 0;
+}
+
+h3.swap {
+ font-size: 10pt;
+ margin-bottom: 0;
+}
+
+/* Link to any cross-referenced Doxygen element */
+a.el {
+ text-decoration: none;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 10pt;
+ color: #551a8b;
+}
+
+a.el:hover {
+ background-color: transparent;
+ color: #551acc;
+}
+
+a {
+// text-decoration: none;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 10pt;
+ color: #551a8b;
+}
+
+a:hover {
+ background-color: transparent;
+ color: #551acc;
+}
+
+a.elRef {
+ font-weight: normal;
+}
+
+
+#MSearchBox {
+ -moz-border-radius:8px 8px 8px 8px;
+ background-color:white;
+ border:1px solid #84B0C7;
+ margin:0;
+ padding:0;
+ white-space:nowrap;
+}
+
+div.directory img {
+ vertical-align:-30%;
+}
+
+div.directory p {
+ white-space:nowrap;
+ margin: 0;
+}
+
+div.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+
+div.directory div {
+ display: none;
+ margin: 0px;
+}
+
+div.version {
+ background-color:#ffffde;
+ border:1px solid #cccccc;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ // -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+
+/* @group Member Descriptions */
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #FAFAFA;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #ccc;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #606060;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #606060;
+ font-weight: normal;
+ margin-left: 3px;
+}
+
+.memnav {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+}
+
+.memproto, .memdoc {
+ border: 1px solid #84b0c7;
+}
+
+.memproto {
+ padding: 0;
+ background-color: #d5e1e8;
+ font-weight: bold;
+ -webkit-border-top-left-radius: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+
+}
+
+
+
+.memdoc {
+ padding: 2px 5px;
+ background-color: #eef3f5;
+ border-top-width: 0;
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+/* @end */
<head>
</head>
<body>
-<hr style="width: 100%; height: 2px;">
+<div class="footer">
<div style="text-align: center;">
-Copyright © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+Copyright © 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</div>
+</div>
</body>
</html>
--- /dev/null
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
+ <title>$title</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+<link href="tabs.css" rel="stylesheet" type="text/css">
+</head>
+<body>
+<div class="header"></div>
+<div align="right"><div class="version">Version: @VERSION@</div></div>
+</body>
+</html>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+#!/bin/sh
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#/bin/sh
+
# ===================================================================
# This shell script is provided for generating the html files
# from the txt files (restructured text) in the source directory.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_Engines.idl
// Author : Andre RIBES, EDF
// $Header:
<?xml version="1.0"?>
<!--
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Logger.idl
// Author : Vasily Rusyaev
//
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
STATIDL_SOURCES += $(MPIIDL_SOURCES)
endif
+if MPI_IS_OK
+ DYNIDL_SRCS += SALOME_MPIObjectDynSK.cc SALOME_MPIContainerDynSK.cc SALOME_TestMPIComponentDynSK.cc
+endif
+
$(DYNIDL_SRCS) : $(IDL_SOURCES)
# also install all generated headers to use result library from another modules
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Palm_Ports.idl
// Author : André RIBES, EDF
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS.idl
// Author : Yves FRICAUD
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Attributes.idl
// Author : Yves FRICAUD
// $Header$
//
/*! \file SALOMEDS_Attributes.idl
\brief This file contains a set of interfaces
- for the attributes which can be assigned to %SObject
+ for the attributes which can be assigned to SObject
*/
#ifndef _SALOMEDS_AttributesIDL_
#define _SALOMEDS_AttributesIDL_
module SALOMEDS
{
-//! Sequence of double values
+ //! Sequence of double values
typedef sequence <double> DoubleSeq;
-//! Sequence of long values
+ //! Sequence of long values
typedef sequence <long> LongSeq;
-//! Sequence of string values
+ //! Sequence of string values
typedef sequence <string> StringSeq;
-/*! \brief This structure stores a set of elements defining the color based on RGB palette.
-
- These elements are
- used as input parameters for methods necessary for color definition of different items.
-*/
+
+ /*!
+ \brief Represents the color based on RGB palette.
+
+ Used by different interfaces to specify the color attributes of different items.
+ */
struct Color {
-//! Red color
- double R;
-//! Green color
- double G;
-//! Blue color
- double B;
+ //! Red component of the color
+ double R;
+ //! Green component of the color
+ double G;
+ //! Blue component of the color
+ double B;
};
+
//==========================================================================
-/*! \brief Attribute allowing to store a real value
+ /*!
+ \brief Attribute allowing to store a real value
- Attribute allowing to store a real value
-*/
- //==========================================================================
+ <em>See \ref example1 for an example of this attribute usage in batchmode of %SALOME application.</em>
+ \sa AttributeInteger, AttributeString
+ */
+ //==========================================================================
interface AttributeReal : GenericAttribute
{
-//! Returns the value of this attribute.
-/*!
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
double Value();
- //! Sets the value of this attribute.
-/*!
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute
+ \param value value being set to the attribute
+ */
void SetValue(in double value);
};
+
//==========================================================================
-/*! \brief Attribute allowing to store an integer value
+ /*!
+ \brief Attribute allowing to store an %integer value
- Attribute allowing to store an integer value
-*/
+ <em>See \ref example17 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeReal, AttributeString
+ */
//==========================================================================
interface AttributeInteger : GenericAttribute
{
- //! Returns the value of this attribute
-/*!
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
long Value();
- //! Sets the value of this attribute
-/*!
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute
+ \param value value being set to the attribute
+ */
void SetValue(in long value);
};
+
//==========================================================================
-/*! \brief Attribute - sequence of real values
+ /*!
+ \brief Attribute allowing to store a sequence of real values.
+ \note The indices in the sequence start from 1.
- Attribute - sequence of real values, indexing from 1 (like in CASCADE).
-*/
+ <em>See \ref example3 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeSequenceOfInteger
+ */
//==========================================================================
interface AttributeSequenceOfReal : GenericAttribute
{
- //! Initialization of the attribute with initial data.
-/*!
- \param other Initially assigned sequence of real numbers.
-*/
+ /*!
+ \brief Initialization of the attribute with initial data.
+ \param other sequence of values assigned to the attribute
+ */
void Assign (in DoubleSeq other);
-//! Returns the sequence of real numbers stored in the attribute.
+ /*!
+ \brief Returns the sequence of values stored in the attribute.
+ \return sequence of values
+ */
DoubleSeq CorbaSequence();
-/*! \brief Adds to the end of the sequence a real number.
-
- \param value A real number added to the sequence.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Adds new value to the end of the sequence.
+ \param value value being added to the sequence
+ */
void Add (in double value);
-/*! \brief Removes a real number with a definite index
- from the sequence of real numbers stored in the Attribute.
-
- \param index The index of the given real number
-*/
+ /*!
+ \brief Removes a value by the specified \a index
+ from the sequence stored in the attribute.
+ \param index index of the value in the sequence to be removed
+ */
void Remove(in long index);
-/*! \brief Substitutes a given real number with a definite index for another real number.
-
- \param index The index of the given real number.
- \param value The value of another real number.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Sets new value to the sequence by the specified \a index.
+ \param index index in the sequence
+ \param value new value being set to the sequence by specified \a index
+ */
void ChangeValue(in long index, in double value);
-/*! \brief Returns a given real number with a definite index in the sequence of real numbers stored in the Attribute.
-
- \param index The index of the given real number.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns a value in the sequence specified by its \a index.
+ \param index index in the sequence
+ \return value specified by \a index
+ */
double Value(in short index);
-/*! \brief Returns the length of the sequence of real numbers stored in the Attribute.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the length of the sequence stored in the attribute.
+ \return sequence length
+ */
long Length();
};
+
//==========================================================================
-/*! \brief Attribute - sequence of integer
+ /*!
+ \brief Attribute allowing to store a sequence of %integer values.
+ \note The indices in the sequence start from 1.
- Attribute - sequence of integer, indexing from 1 (like in CASCADE)
-*/
+ <em>See \ref example4 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeSequenceOfReal
+ */
//==========================================================================
interface AttributeSequenceOfInteger : GenericAttribute
{
-/*! \brief Initialisation of the attribute with initial data.
- \param other Initially assigned sequence of integer numbers.
-*/
+ /*!
+ \brief Initialization of the attribute with initial data.
+ \param other sequence of values assigned to the attribute
+ */
void Assign (in LongSeq other);
-//! Returns the sequence of integer numbers stored in the Attribute.
- LongSeq CorbaSequence();
-/*! \brief Adds to the end of the sequence an integer number.
-
- \param value An integer number added to the sequence.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the sequence of values stored in the attribute.
+ \return sequence of values
+ */
+ LongSeq CorbaSequence();
+ /*!
+ \brief Adds new value to the end of the sequence.
+ \param value value being added to the sequence
+ */
void Add (in long value);
-/*! \brief Removes an integer number with a definite index from the sequence of integer numbers stored in the Attribute.
-
- \param index The index of the given integer number.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Removes an value by the specified \a index
+ from the sequence stored in the attribute.
+ \param index index of the value in the sequence to be removed
+ */
void Remove(in long index);
-/*! \brief Substitutes an integer number with a definite index for another integer number.
-
- \param index The index of the given integer number.
- \param value The value of another integer number.
-
-*/
+ /*!
+ \brief Sets new value to the sequence by the specified \a index.
+ \param index index in the sequence
+ \param value new value being set to the sequence by specified \a index
+ */
void ChangeValue(in long index, in long value);
-/*! \brief Returns a given integer number with a definite index in the sequence of integer numbers stored in the Attribute.
- \param index The index of the given integer number.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns a value in the sequence specified by its \a index.
+ \param index index in the sequence
+ \return value specified by \a index
+ */
long Value(in short index);
-/*! \brief Returns the length of the sequence of integer numbers stored in the Attribute.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the length of the sequence stored in the attribute.
+ \return sequence length
+ */
long Length();
};
//==========================================================================
-/*! \brief Name attribute
+ /*!
+ \brief Name attribute
- This attribute stores a string value, which corresponds to the name of the %SObject
- or to the name of corresponding object.
-*/
- //==========================================================================
+ The attribute stores a string value, which corresponds to the name of the SObject
+ or to the name of corresponding %object.
+ <em>See \ref example5 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeComment
+ */
+ //==========================================================================
interface AttributeName : GenericAttribute
{
-/*! \brief Returns the value of this attribute
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value assigned to the attribute.
+ \return attribute value
+ */
string Value();
-/*! \brief Sets the value of this attribute
-
- \param value This parameter defines the value of this attribute.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute (name of a SObject).
+ \param value value being set to the attribute
+ */
void SetValue(in string value);
};
//==========================================================================
-/*! \brief Comment attribute
-
- This attribute stores a string value containing supplementary information about
- the %SObject. In particular it contains the data type of the %SComponent.
-*/
+ /*!
+ \brief Comment attribute
+
+ The attribute stores a string value containing supplementary information about
+ the SObject. In particular it contains the data type of the %SComponent.
+
+ <em>See \ref example6 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeName
+ */
//==========================================================================
interface AttributeComment : GenericAttribute
{
-/*! \brief Returns the value of this attribute
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*! \brief Sets the value of this attribute
- \param value This string parameter defines the value of this attribute - a description of a %SObject.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute (description of a SObject).
+ \param value value being set to the attribute
+ */
void SetValue(in string value);
};
- //==========================================================================
-/*! \brief String attribute
- This attribute stores a string value containing arbitrary information.
-*/
+ //==========================================================================
+ /*!
+ \brief String attribute
+
+ The attribute stores a string value containing arbitrary information.
+ \sa AttributeInteger, AttributeReal
+ */
//==========================================================================
interface AttributeString : GenericAttribute
{
-/*!
- Returns the value of this attribute
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*!
- Sets the value of this attribute
- \param value This string parameter defines the value of this attribute.
-*/
+ /*!
+ \brief Sets the value of the attribute.
+ \param value value being set to the attribute
+ */
void SetValue(in string value);
};
+
//==========================================================================
-/*! \brief IOR attribute
+ /*!
+ \brief IOR attribute
+
+ The attribute stores a string value identifying a runtime %object.
+ In particular it contains CORBA Interoperable Object Reference.
- This attribute stores a string value identifying a runtime object.In particular
- it contains CORBA Interoperable Object Reference.
-*/
- //==========================================================================
+ <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
+
+ \sa AttributePersistentRef
+ */
+ //==========================================================================
interface AttributeIOR : GenericAttribute
{
-/*!
- Returns the value of this attribute
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*!
- Sets the value of this attribute
- \param value This parameter defines the value of this attribute - IOR of a %SObject.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute (IOR of a SObject).
+ \param value value being set to the attribute.
+ */
void SetValue(in string value);
};
//==========================================================================
-/*! \brief Persistent reference attribute
+ /*!
+ \brief Persistent reference attribute
+
+ The attribute stores a persistent identifier of the %object. It is a part
+ of SALOME persistence mechanism .
- This attribute stores a persistent identifier of the object.
-*/
+ <em>See \ref example7 for an example of this method usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeIOR
+ */
//==========================================================================
interface AttributePersistentRef : GenericAttribute
{
-/*!
- Returns the value of this attribute
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*!
- Sets the value of this attribute
- \param value This parameter defines the value of this attribute.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute.
+ \param value Value being set to the attribute
+ */
void SetValue(in string value);
};
//==========================================================================
-/*! \brief External File definition
-
- This attribute stores a path to an External File.
-*/
+ /*!
+ \brief External file definition.
+
+ The attribute stores a path to an external file.
+
+ \sa AttributeFileType
+ */
//==========================================================================
interface AttributeExternalFileDef: GenericAttribute
{
-/*!
- Returns the value of this attribute
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*!
- Sets the value of this attribute
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute.
+ \param value value being set to the attribute
+ */
void SetValue(in string value);
};
//==========================================================================
-/*! \brief File Type definition
+ /*!
+ \brief External file type definition.
- This attribute stores an external File Type (see ExternalFileDef attribute).
-*/
+ The attribute stores an external file type.
+
+ \sa AttributeExternalFileDef
+ */
//==========================================================================
interface AttributeFileType: GenericAttribute
{
-/*!
- Returns the value of this attribute
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*!
- Sets the value of this attribute
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute.
+ \param value value being set to the attribute
+ */
void SetValue(in string value);
};
//==========================================================================
- //Below the list of presentation attributes for display study tree in browser
+ // Presentation attributes (parameters of the object displaying in the Object browser)
//==========================================================================
-
//==========================================================================
-/*! \brief Drawable flag Attribute.
+ /*!
+ \brief Drawable flag attribute.
- This is a presentation attribute necessary for display of a study tree in the browser.
- The item associated to a %SObject is created/displayed if TRUE.
-*/
+ This presentation attribute specifies if the parent SObject should be displayed
+ in the study tree in the Object browser.
+
+ If this attribute is defined for the parent %object and set to \c false, the item
+ is not displayed in the Object browser. By default, the item is always displayed.
+
+ <em>See \ref example8 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeExpandable, AttributeSelectable
+ */
//==========================================================================
interface AttributeDrawable : GenericAttribute
{
-/*!
- Returns TRUE if the item is drawable (as it is by default) and FALSE if it isn't.
-
-<em>See \ref example8 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return \c true if the item is drawable or \c false otherwise
+ */
boolean IsDrawable();
-/*!
-Sets the item to be drawable.
-
-\param value If the value of this boolean parameter is TRUE (default) the item will be drawable.
-
-<em>See \ref example8 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
- void SetDrawable(in boolean value);
+ /*!
+ \brief Sets the value of the attribute.
+ \param value value being set to the attribute (\c true if item should be drawable or \c false otherwise)
+ */
+ void SetDrawable(in boolean value);
};
//==========================================================================
-/*! \brief Selectable flag Attribute.
+ /*!
+ \brief Selectable flag attribute.
- This is a presentation attribute necessary for display of the study tree in the browser.
- The item is selectable by %SALOME selection mechanism if TRUE.
-*/
+ This presentation attribute specifies if the parent SObject is selectable
+ by the user in the Object browser.
+ If this attribute is defined for the parent %object and set to \c false, the item
+ is not selectable in the Object browser. By default, the item is always selectable.
+
+ <em>See \ref example9 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeDrawable, AttributeExpandable
+ */
//==========================================================================
interface AttributeSelectable : GenericAttribute
{
-/*!
- Returns TRUE if the item is selectable (as it is by default) and FALSE if it isn't.
-
-
-<em>See \ref example9 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return \c true if the item is selectable or \c false otherwise
+ */
boolean IsSelectable();
-/*!
-Sets the item to be selectable
-
-\param value If the value of this parameter is TRUE (the default) the item will be set as selectable.
-
-<em>See \ref example9 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
- void SetSelectable(in boolean value);
+ /*!
+ \brief Sets the value of the attribute.
+ \param value value being set to the attribute (\c true if item should be selectable or \c false otherwise)
+ */
+ void SetSelectable(in boolean value);
};
//==========================================================================
-/*! \brief Expandable flag Attribute.
-
- This is a presentation attribute necessary for display of the study tree in the browser.
- It sets this item to be expandable even if it has no children if value is TRUE. If value is FALSE
- expandable only if it has children.
-*/
+ /*!
+ \brief Expandable flag attribute.
+
+ This presentation attribute specifies if the parent SObject can be expanded
+ by the user in the Object browser (to show its child objects).
+ If this attribute is defined for the parent %object and set to \c false, the item
+ is not expandable in the Object browser. By default, the item is always expandable
+ (if it has children).
+
+ <em>See \ref example10 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeDrawable, AttributeSelectable
+ */
//==========================================================================
interface AttributeExpandable : GenericAttribute
{
-/*!
- Returns TRUE if this item is expandable even when it has no children.
-
-<em>See \ref example10 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return \c true if the item is expandable or \c false otherwise
+ */
boolean IsExpandable();
-/*! Sets this item to be expandable even if it has no children.
-
- \param value If the value of this boolean parameter is TRUE, this item will be set as expandable.
-
-<em>See \ref example10 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
- void SetExpandable(in boolean value);
+ /*!
+ \brief Sets the value of the attribute.
+ \param value value being set to the attribute (\c true if item should be expandable or \c false otherwise)
+ */
+ void SetExpandable(in boolean value);
};
//==========================================================================
-/*! \brief Flags Attribute.
-
- This interface is intended for storing different object attributes that
- have only two states (0 and 1).
-*/
+ /*!
+ \brief Flags attribute.
+
+ The interface is intended for storing different %object attributes that
+ have only two states: 0 (\c false) or 1 (\c true).
+ \note The interpretation of the flag values attribute is a matter of the user.
+ \note The total number of flags which can be stored in a single attribute
+ is defined by the size of CORBA::Long data type.
+ */
//==========================================================================
interface AttributeFlags : GenericAttribute
{
+ /*!
+ \brief Returns the value of the attribute.
+ \return set of flags currently set to the attribute
+ */
long GetFlags();
- void SetFlags( in long theFlags );
-
- boolean Get( in long theFlag );
- void Set( in long theFlag, in boolean theValue );
+ /*!
+ \brief Sets the value of the attribute.
+ \param flags new set of flags to be stored in the attribute
+ */
+ void SetFlags(in long flags);
+ /*!
+ \brief Test the value for the specified flag or set of flags.
+ \param flags flag or set of flags being tested.
+ \return \c true if all bits correspoding to the \a flags are currently set or \c false otherwise
+ */
+ boolean Get(in long flags);
+ /*!
+ \brief Set/clear specific flag or set of flags.
+ \param flags flag or set of flags being set / cleared
+ \param value \c true if all bits correspoding to the \a flags should be set
+ or \c false if flag(s) should be cleared
+ */
+ void Set(in long flags, in boolean value);
};
//==========================================================================
-/*! \brief Graphic Attribute.
- This class is intended for storing information about
- graphic representation of objects in dirrent views
-*/
- //==========================================================================
+ /*!
+ \brief Graphic attribute.
+ This interface is intended for storing information about graphical representation
+ of the %object in different views.
+ */
+ //==========================================================================
interface AttributeGraphic : GenericAttribute
{
- void SetVisibility( in long theViewId, in boolean theValue );
- boolean GetVisibility( in long theViewId );
+ /*!
+ \brief Set / clear visibility flag of the parent SObject for the view
+ specified by \a viewId.
+ \param viewId view identifier
+ \param value visibility flag value being set to the attribute
+ */
+ void SetVisibility(in long viewId, in boolean value);
+ /*!
+ \brief Get visibility flag of the parent SObject for the view
+ specified by \a viewId.
+ \param viewId view identifier
+ \return visibility flag currently set to the attribute for the specified view
+ */
+ boolean GetVisibility(in long viewId);
};
//==========================================================================
-/*! \brief Opened flag Attribute.
+ /*!
+ \brief Opened flag Attribute
+ \warning Deprecated interface. Not used since version 3.0.
- This is a presentation attribute necessary for display of the study tree in the browser.
- It sets this item to be open (its children are visible) if bool is TRUE, and to be closed (its children
- are not visible) if bool is FALSE.
-*/
+ This presentation attribute specifies if the item corresponding to the
+ parent SObject in the Object browser is currently opened (expanded) or no.
+ */
//==========================================================================
interface AttributeOpened : GenericAttribute
{
-/*!
- Returns TRUE if this item is open (its children are visible) and FALSE if it isn't.
-
-<em>See \ref example11 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \obsolete
+ \return \c true if the item is opened (expanded) in the Object browser or \c false otherwise
+ */
boolean IsOpened();
-/*!
- Sets this item to be open (its children are visible)
+ /*!
+ \brief Sets the value of the attribute.
+ \obsolete
+ \param value value being set to the attribute (\c true if item should
+ be opened (expanded) or \c false otherwise)
+ */
+ void SetOpened(in boolean value);
+ };
- \param value If the value of this boolean parameter is TRUE this item will be set as open,
- and as closed if FALSE.
+ //==========================================================================
+ /*!
+ \brief Text color attribute.
-<em>See \ref example11 for an example of this method usage in batchmode of %SALOME application.</em>
+ This attribute allows to specify the text color to be used to render the item
+ in the Object browser. If the attribute is not set for the SObject, default
+ value (GUI specific) is used.
-*/
- void SetOpened(in boolean value);
- };
- //==========================================================================
-/*! \brief TextColorAttribute.
+ <em>See \ref example12 for an example of this attribute usage in batchmode of %SALOME application.</em>
- This attribute sets the color of an item.
-*/
+ \sa AttributeTextHighlightColor, AttributePixMap
+ */
//==========================================================================
interface AttributeTextColor : GenericAttribute
{
-/*!
- Returns the color of an item.
-
-<em>See \ref example12 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
- Color TextColor();
-/*!
- Sets the color of an item.
-
- \param value This parameter defines the color of the item.
-
-<em>See \ref example12 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return text color assigned to the attribute
+ */
+ Color TextColor();
+ /*!
+ \brief Sets the value of the attribute.
+ \param value text color value being set to the attribute
+ */
void SetTextColor(in Color value);
};
//==========================================================================
- /*! \brief TextHighlightColorAttribute.
+ /*!
+ \brief Text highlight color attribute.
+
+ This attribute allows to specify the highlight color to be used to render
+ the item in the Object browser (used only when the item is selected).
+ If the attribute is not set for the SObject, default value (GUI specific) is used.
- This attribute sets the highlight color of an item.
-*/
+ <em>See \ref example13 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeTextColor, AttributePixMap
+ */
//==========================================================================
interface AttributeTextHighlightColor : GenericAttribute
{
-/*!
- Returns the highlight color of an item.
-
-
-
-<em>See \ref example13 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
- Color TextHighlightColor();
-/*!
- Sets the highlight color of an item.
- \param value This parameter defines the highlight color of the item.
-
-<em>See \ref example13 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return highlight color assigned to the attribute
+ */
+ Color TextHighlightColor();
+ /*!
+ \brief Sets the value of the attribute.
+ \param value highlight color value being set to the attribute
+ */
void SetTextHighlightColor(in Color value);
};
+
//==========================================================================
-/*! \brief PixMapAttribute.
+ /*!
+ \brief Icon attribute.
+
+ This attribute is used to specifiy the name (file name) of an icon which
+ should be drawn in the Object browser when rendering an item.
- This attribute stores an icon which is put before the name of an item.
-*/
+ <em>See \ref example14 for an example of this attribute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeTextColor, AttributeTextHighlightColor
+ */
//==========================================================================
interface AttributePixMap : GenericAttribute
{
-/*!
- Returns True if there is an icon before the name of the given item.
-*/
+ /*!
+ Checks if the pixmap is assigned to the attribute.
+ \return \c true if an icon file name is set to the attribute
+ */
boolean HasPixMap();
-/*!
- Returns the name of the icon in the format of a string.
-
-<em>See \ref example14 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return icon file name assigned to the attribute (empty string if not set)
+ */
string GetPixMap();
-/*!
- Sets the name of the icon.
- \param value This string parameter defines the name of the icon.
-
-<em>See \ref example14 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Sets the value of the attribute.
+ \param icom file name being set to the attribute
+ */
void SetPixMap(in string value);
};
//==========================================================================
-/*! \brief TreeNodeAttribute.
-
- A set of these attributes on the %SObjects of the %study forms an inner auxiliary
- tree whith its own structure and identifier. The quantity of such trees with different
- identifiers can be arbitrary.
+ /*!
+ \brief Tree node attribute.
-<em>See \ref example18 for an example of usage of the methods of this interface in batchmode of %SALOME application.</em>
+ By specifying the tree node attributes for the SObjects it is possible to
+ create internal auxillary %object tree with its own structure and identifier.
-*/
+ Since each such tree is specfied by the unique identifier, it is possible
+ to create as many trees as it is required.
+
+ <em>See \ref example18 for an example of usage of this attribute in batchmode of %SALOME application.</em>
+ */
//==========================================================================
interface AttributeTreeNode : GenericAttribute
{
-/*!
- Assigns the father tree node to this tree node.
-*/
- void SetFather(in AttributeTreeNode value);
-/*!
- Returns True if there is a father tree node of this tree node.
-*/
+ /*!
+ \brief Assigns the father tree node to this tree node.
+ \param father tree node attribute being set as a parent of this tree node
+ */
+ void SetFather(in AttributeTreeNode father);
+ /*!
+ \brief Checks if father tree node attribute is set for this tree node.
+ \return \c true if father tree node attribute is defined or \c false otherwise
+ */
boolean HasFather();
-/*!
- Returns the father tree node of this tree node.
-*/
+ /*!
+ \brief Returns the father tree node of this tree node.
+ \return father tree node attribute
+ */
AttributeTreeNode GetFather();
-/*!
- Assigns the previous brother tree node to the given tree node.
-*/
- void SetPrevious(in AttributeTreeNode value);
-/*!
- Returns True if there is the previous brother tree node of this tree node.
-*/
+ /*!
+ \brief Assigns the previous sibling tree node to this tree node.
+ \param sibling tree node attribute being set as a previous sibling of this tree node
+ */
+ void SetPrevious(in AttributeTreeNode sibling);
+ /*!
+ \brief Checks if previous sibling tree node attribute is set for this tree node.
+ \return \c true if previous sibling tree node attribute is defined or \c false otherwise
+ */
boolean HasPrevious();
-/*!
- Returns the previous brother tree node of this tree node.
-*/
+ /*!
+ \brief Returns the previous sibling tree node of this tree node.
+ \return previous sibling tree node attribute
+ */
AttributeTreeNode GetPrevious();
-/*!
- Sets the next brother tree node to this tree node.
-*/
- void SetNext(in AttributeTreeNode value);
-/*!
- Returns True if there is the next brother tree node of this tree node.
-*/
+ /*!
+ \brief Assigns the next sibling tree node to this tree node.
+ \param sibling tree node attribute being set as a next sibling of this tree node
+ */
+ void SetNext(in AttributeTreeNode sibling);
+ /*!
+ \brief Checks if next sibling tree node attribute is set for this tree node.
+ \return \c true if next sibling tree node attribute is defined or \c false otherwise
+ */
boolean HasNext();
-/*!
- Returns the previous brother tree node of this tree node.
-*/
+ /*!
+ \brief Returns the next sibling tree node of this tree node.
+ \return next sibling tree node attribute
+ */
AttributeTreeNode GetNext();
-/*!
- Sets the first child tree node to this tree node.
-*/
- void SetFirst(in AttributeTreeNode value);
-/*!
- Returns True if there is the first child tree node of this tree node.
-*/
+ /*!
+ \brief Sets the specified tree node as a first child of this tree node.
+ \param child tree node attribute being set filrst child of this tree node
+ */
+ void SetFirst(in AttributeTreeNode child);
+ /*!
+ \brief Checks if first child tree node attribute is set for this tree node.
+ \return \c true if first child tree node attribute is defined or \c false otherwise
+ */
boolean HasFirst();
-/*!
- Returns the first child tree node of this tree node.
-*/
+ /*!
+ \brief Returns the first child tree node of this tree node.
+ \return first child tree node attribute
+ */
AttributeTreeNode GetFirst();
-/*!
- Sets ID of a tree.
- \param value String parameter defining the ID of a tree.
- \note <br>Tree nodes of one tree have the same ID.
-*/
- void SetTreeID(in string value);
-/*!
- Gets ID of a tree.
- \return An ID of a tree in the format of a string.
-*/
+ /*!
+ \brief Sets identifier of the parent tree to this tree node.
+ \note All tree nodes which belong to the same tree, should have the same identifier.
+ \param ID identifier (arbitrary non-empty string) being set for this tree node
+ */
+ void SetTreeID(in string ID);
+ /*!
+ \brief Returns identifier of the parent tree.
+ \return parent tree identifier
+ */
string GetTreeID();
-
-/*!
- Adds a child tree node to the end of the list of children of this tree node.
-*/
- void Append(in AttributeTreeNode value);
-/*!
- Adds a child tree node to the beginning of the list of children of this tree node.
-
-*/
- void Prepend(in AttributeTreeNode value);
-/*!
- Adds a brother tree node before this tree node.
- In this case the both tree nodes will belong to the same father.
-*/
- void InsertBefore(in AttributeTreeNode value);
-/*!
- Adds a brother tree node after this tree node.
- In this case the both tree nodes will belong to the same father.
-*/
- void InsertAfter(in AttributeTreeNode value);
-/*!
- Deletes a tree node.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief Appends specified tree node to the end of the children list of this tree node.
+ \param child tree node being added to the list of children
+ */
+ void Append(in AttributeTreeNode child);
+ /*!
+ \brief Puts specified tree node to the beginning of the children list of this tree node.
+ \param child tree node being added to the list of children
+ */
+ void Prepend(in AttributeTreeNode child);
+ /*!
+ \brief Insert specified tree node as a previous child in the parent tree node's children list.
+ \param child tree node being inserted to the parent tree node
+ */
+ void InsertBefore(in AttributeTreeNode child);
+ /*!
+ \brief Insert specified tree node as a next child in the parent tree node's children list.
+ \param child tree node being inserted to the parent tree node
+ */
+ void InsertAfter(in AttributeTreeNode child);
+ /*!
+ \brief Removes this tree node.
+ */
void Remove();
-
-/*!
- Returns the depth of the tree node in the
- structure, it means the number of fathers of the given tree node.
- (i.e.: the depth of the root tree node is 0).
-*/
+ /*!
+ \brief Returns the depth of the tree node in the tree structure. The resulting value
+ it equal to the number of the fathers of this tree node.
+ \note The depth of the root tree node is 0.
+ \return tree node's depth
+ */
long Depth();
-/*!
- Returns True if it is a root tree node.
-*/
+ /*!
+ \brief Checks if the tree node is a root of the tree.
+ \return \c true if it is a root tree node or \c false otherwise
+ */
boolean IsRoot();
-/*!
- Returns True if this tree node is a descendant of the tree node.
-*/
- boolean IsDescendant(in AttributeTreeNode value);
-/*!
- Returns True if this tree node is the father of the tree node.
-*/
- boolean IsFather(in AttributeTreeNode value);
-/*!
- Returns True if this tree node is a child of the tree node.
-*/
- boolean IsChild(in AttributeTreeNode value);
-/*!
- Returns ID of the according %SObject.
-*/
+ /*!
+ \brief Checks if the tree node is a descendant of the specified tree node.
+ \param other tree node that is tested for being ancestor of this tree node
+ \return \c true if this node is descendant of the \a other node or \c false otherwise
+ */
+ boolean IsDescendant(in AttributeTreeNode other);
+ /*!
+ \brief Checks if this tree node is a parent of the specified tree node \a other.
+ \param other tree node that is tested for being father of this tree node
+ \return \c true if this node is father of the \a other node or \c false otherwise
+ */
+ boolean IsFather(in AttributeTreeNode other);
+ /*!
+ \brief Checks if this tree node is a child of the specified tree node \a other.
+ \param other tree node that is tested for being child of this tree node
+ \return \c true if this node is child of the \a other node or \c false otherwise
+ */
+ boolean IsChild(in AttributeTreeNode other);
+ /*!
+ \brief Returns string identifier of the owner SObject (e.g. "0:1:2").
+ \return string entry of the owner SObject
+ */
string Label();
};
+
//==========================================================================
-/*! \brief LocalID attribute
+ /*!
+ \brief Local identifier attribute
+
+ This attribute can be used for identification of the SObject (for example by type).
- Attribute describing the link between a %SObject and a local object in the component.
-*/
+ <em>See \ref example15 for an example of this atrtibute usage in batchmode of %SALOME application.</em>
+
+ \sa AttributeUserID
+ */
//==========================================================================
interface AttributeLocalID : GenericAttribute
{
-/*!
- Returns the value of this attribute.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
long Value();
-/*!
- Sets the value of this attribute.
-
- \param value This parameter defines the local ID which will be set.
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute
+ \param value value being set to the attribute
+ */
void SetValue(in long value);
};
//==========================================================================
-/*! \brief Attribute storing GUID
-
- Attribute allowing to store GUID
-*/
+ /*!
+ \brief Attribute storing GUID.
+
+ This attribute can be used to store arbitrary GUID. Attribute allowing to store GUID.
+ In contrast to any other atribute (e.g. AttributeLocalID), it is possible to
+ define as many GUID attributes for the same SObject as it is required provided that
+ they have different GUID values.
+
+ \sa AttributeLocalID
+ */
//==========================================================================
interface AttributeUserID : GenericAttribute
{
-/*!
- Returns the value of this attribute
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Returns the value of the attribute.
+ \return attribute value
+ */
string Value();
-/*!
- Sets the value of this attribute
-
-<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
-*/
+ /*!
+ \brief Sets the value of the attribute
+ \param value value being set to the attribute
+ */
void SetValue(in string value);
};
//==========================================================================
-/*! \brief %AttributeTarget iterface
+ /*!
+ \brief Back references attribute.
+ \internal
- This attribute stores the list of all %SObjects that refer
- to this %SObject. This attribute is used for inner purposes of the application.
- It is also needed for optimization.
-*/
+ This attribute is used to store back references to all the SObjects that refer
+ to the owner SObject.
+
+ This attribute is used for inner purposes (in particular, for performance
+ optimization).
+ */
//==========================================================================
interface AttributeTarget : GenericAttribute
{
-/*!
- Adds a %SObject to the list of %SObjects which refer to this %SObject.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
- void Add(in SObject anObject);
-/*!
- Returns a list of %SObjects which refer to this %SObject.
-*/
+ /*!
+ Adds specified SObject to the list of SObjects which refer to the owner SObject.
+ \param refobj %SObject being added to the list
+ */
+ void Add(in SObject refobj);
+ /*!
+ Returns a list of SObjects which refer to the owner SObject.
+ \return list of SObject referencing to the owher SObject
+ */
SALOMEDS::Study::ListOfSObject Get();
-/*!
- Deletes a %SObject from the list of %SObjects which refer to this %SObject.
-
-<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ Removes specified SObject from the list of SObjects which refer to the owner SObject.
+ \param refobj %SObject being removed to the list
+ */
void Remove(in SObject anObject);
};
+
//==========================================================================
- /*! \brief %AttributeTableOfInteger interface
+ /*!
+ \brief Generic table attribute.
- This attribute allows to store a table of integers (indexing from 1 like in CASCADE)
- and string titles of this table, of each row, of each column.
+ Used as base interface for the AttributeTableOfInteger, AttributeTableOfReal
+ and AttributeTableOfString. Provides functions which are common for all table
+ attributes.
-<em>See \ref example21 for an example of usage of these methods in batchmode of %SALOME application.</em>
-
-*/
+ \note The indices of rows and columns in the table start from 1.
+ \sa AttributeTableOfInteger, AttributeTableOfReal, AttributeTableOfString
+ */
//==========================================================================
- interface AttributeTableOfInteger : GenericAttribute
+ interface AttributeTable : GenericAttribute
{
-//! This exception is raised when an incorrect index is passed as parameter.
+ //! This exception is raised when an invalid (out of range) index is passed as parameter.
exception IncorrectIndex {};
-//! This exception is raised when an incorrect length of the argument is passed as parameter.
+ //! This exception is raised when sequence of incorrect length is passed as parameter.
exception IncorrectArgumentLength {};
- // titles: for table, for each row, for each column
-/*!
- Sets the title of the table.
-*/
- void SetTitle(in string theTitle);
-/*!
- Returns the title of the table.
-*/
+ //! Sort order
+ enum SortOrder {
+ AscendingOrder, //!< The items are sorted ascending
+ DescendingOrder //!< The items are sorted descending
+ };
+
+ //! Sort policy (specifies how empty cells are taken into account when sorting)
+ enum SortPolicy {
+ EmptyLowest, //!< Empty cells are considered as lowest values
+ EmptyHighest, //!< Empty cells are considered as highest values
+ EmptyFirst, //!< Empty cells are always first
+ EmptyLast, //!< Empty cells are always last
+ EmptyIgnore //!< Empty cells are ignored (stay at initial positions)
+ };
+
+ /*!
+ \brief Sets the main title of the table.
+ \param title title being set to the table
+ \sa GetTitle()
+ */
+ void SetTitle(in string title);
+ /*!
+ \brief Returns the title of the table.
+ \return table title (empty string if not set)
+ \sa SetTitle()
+ */
string GetTitle();
-/*!
- Sets the title of a row with a definite index.
-*/
- void SetRowTitle(in long theIndex, in string theTitle) raises(IncorrectIndex);
-/*!
- Sets the titles for all rows of the table.
-*/
- void SetRowTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
-/*!
- Returns the titles of all rows of the table.
-*/
+ /*!
+ \brief Sets the title of a row with specified index.
+
+ Raises an exception if \a row is out of range.
+
+ \param row row index
+ \param title title being set to the row
+ \sa GetRowTitle()
+ */
+ void SetRowTitle(in long row, in string title) raises(IncorrectIndex);
+ /*!
+ \brief Returns the title of a row with specified index.
+
+ Raises an exception if \a row is out of range.
+
+ \param row row index
+ \return row title (empty string if not set)
+ \sa SetRowTitle()
+ */
+ string GetRowTitle(in long row) raises(IncorrectIndex);
+ /*!
+ \brief Sets the titles for all rows in the table.
+
+ Raises an exception if length of the \a titles parameter is not equal
+ to the number of rows in the table.
+
+ \param titles titles being set to the table rows
+ \sa GetRowTitles()
+ */
+ void SetRowTitles(in StringSeq titles) raises(IncorrectArgumentLength);
+ /*!
+ \brief Returns the titles of all rows of the table.
+ \return list of all rows titles
+ \sa SetRowTitles()
+ */
StringSeq GetRowTitles();
-/*!
- Sets the title of a column with a definite index.
-*/
- void SetColumnTitle(in long theIndex, in string theTitle) raises(IncorrectIndex);
-/*!
- Sets the titles for all columns of the table.
-*/
- void SetColumnTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
-/*!
- Returns the titles of all columns of the table.
-*/
+ /*!
+ \brief Sets the title of a column with specified index.
+
+ Raises an exception if \a column is out of range.
+
+ \param column column index
+ \param title title being set to the column
+ \sa GetColumnTitle()
+ */
+ void SetColumnTitle(in long column, in string title) raises(IncorrectIndex);
+ /*!
+ \brief Returns the title of a column with specified index.
+
+ Raises an exception if \a column is out of range.
+
+ \param column column index
+ \return column title (empty string if not set)
+ \sa SetColumnTitle()
+ */
+ string GetColumnTitle(in long column) raises(IncorrectIndex);
+ /*!
+ \brief Sets the titles for all columns in the table.
+
+ Raises an exception if length of the \a titles parameter is not equal
+ to the number of columns in the table.
+
+ \param titles titles being set to the table columns
+ \sa GetColumnTitles()
+ */
+ void SetColumnTitles(in StringSeq titles) raises(IncorrectArgumentLength);
+ /*!
+ \brief Returns the titles of all columns of the table.
+ \return list of all columns titles
+ \sa SetColumnTitles()
+ */
StringSeq GetColumnTitles();
-
- //Rows units
-/*!
- Sets the unit of a row with a definite index.
-*/
- void SetRowUnit(in long theIndex, in string theUnit) raises(IncorrectIndex);
-/*!
- Sets the units for all rows of the table.
-*/
- void SetRowUnits(in StringSeq theUnits) raises(IncorrectArgumentLength);
-/*!
- Returns the units of all rows of the table.
-*/
+ /*!
+ \brief Assigns the unit label to the row with specified index.
+
+ Raises an exception if \a row is out of range.
+
+ \param row row index
+ \param unit unit label being set to the row
+ \sa GetRowUnit()
+ */
+ void SetRowUnit(in long row, in string unit) raises(IncorrectIndex);
+ /*!
+ \brief Returns the unit label of a row with specified index.
+
+ Raises an exception if \a row is out of range.
+
+ \param row row index
+ \return row unit label (empty string if not set)
+ \sa SetRowUnit()
+ */
+ string GetRowUnit(in long row) raises(IncorrectIndex);
+ /*!
+ \brief Sets the unit labels for all rows in the table.
+
+ Raises an exception if length of the \a units parameter is not equal
+ to the number of rows in the table.
+
+ \param units unit labels being set to the table rows
+ \sa GetRowUnits()
+ */
+ void SetRowUnits(in StringSeq units) raises(IncorrectArgumentLength);
+ /*!
+ \brief Returns the unit labels of all rows of the table.
+ \return list of all rows unit labels
+ \sa SetRowUnits()
+ */
StringSeq GetRowUnits();
-
- // table information
-/*!
- Returns the number of rows of the table.
-*/
+ /*!
+ \brief Returns the number of rows of the table.
+ \return rows count
+ \sa GetNbColumns()
+ */
long GetNbRows();
-/*!
- Returns the number of columns of the table.
-*/
+ /*!
+ \brief Returns the number of columns of the table.
+ \return columns count
+ \sa GetNbRows(), SetNbColumns()
+ */
long GetNbColumns();
-
- // operations with rows
-/*!
- Adds a row to the end of the table.
- \param theData A sequence of long values which will be set as elements of the added row.
-*/
- void AddRow(in LongSeq theData) raises(IncorrectArgumentLength);
-/*!
- Sets the elements of a definite row.
- \param theRow The number of the row.
- \param theData A sequence of long values which will be set as elements of this row.
-
-*/
- void SetRow(in long theRow, in LongSeq theData) raises(IncorrectArgumentLength, IncorrectIndex);
-/*!
- Gets the row of the table.
-
- \param theRow The number of the row.
- \return A sequence of long values which are set as elements of this row.
-*/
- LongSeq GetRow(in long theRow) raises(IncorrectIndex);
-
- // operations with columns
-/*!
- Adds a column to the end of the table.
-
- \param theData A sequence of long values which will be set as elements of this column.
-*/
- void AddColumn(in LongSeq theData) raises(IncorrectArgumentLength);
-/*!
- Sets the values of all elements of the column.
-
- \param theData A sequence of long values which will be set as elements of this column.
-*/
- void SetColumn(in long theColumn, in LongSeq theData) raises(IncorrectArgumentLength, IncorrectIndex);
-/*!
- Returns the column of the table.
-*/
- LongSeq GetColumn(in long theColumn) raises(IncorrectIndex);
-
- // operations with elements
-/*!
- Puts a value in the table.
- \param theRow The row, where the value will be placed.
- \param theColumn The column, where the value will be placed.
-*/
- void PutValue(in long theValue, in long theRow, in long theColumn) raises(IncorrectIndex);
-/*!
- Returns True if there is a value in the table.
- \param theRow The row containing the value
- \param theColumn The column containing the value
-*/
- boolean HasValue(in long theRow, in long theColumn);
-/*!
- Returns the value from the table.
- \param theRow The row containing the value
- \param theColumn The column containing the value
-*/
- long GetValue(in long theRow, in long theColumn) raises(IncorrectIndex);
-
-/*!
- Sets the max number of colums in the table.
- \note It'd better to set it before filling the table.
-*/
- void SetNbColumns(in long theNbColumns);
-
-/*!
- Returns the indices of the row where the values are defined.
-*/
- LongSeq GetRowSetIndices(in long theRow) raises(IncorrectIndex);
- // operations with files
-/*!
- Reads a table from a file.
-*/
- boolean ReadFromFile(in SALOMEDS::TMPFile theStream);
-/*!
- Saves a table into a file.
-*/
+ /*!
+ \brief Check if the value is set for the cell with specified \a row and \a column indices.
+ \param row row index
+ \param column column index
+ \return \c true if value is set for the specified cell or \c false otherwise
+ (or if row/column index is/are out of range)
+ */
+ boolean HasValue(in long row, in long column);
+ /*!
+ \brief Clear value in the specified table cell.
+
+ Raises an exception if \a row or \a column is out of range.
+
+ \param row row index
+ \param column column index
+ \sa HasValue()
+ */
+ void RemoveValue(in long row, in long column) raises(IncorrectIndex);
+ /*!
+ \brief Sets the maximum number of colums in the table.
+
+ If new number of columns is less than the current one, the table is truncated
+ (extra columns are removed).
+
+ \note It is recommended to set number of columns before assigning data to the table.
+
+ \param columns total number of columns being set for the table
+ \sa GetNbColumns()
+ */
+ void SetNbColumns(in long columns);
+ /*!
+ \brief Returns the indices of the columns in the specified \a row for which
+ values are set.
+
+ Raises an exception if \a row is out of range.
+
+ \param row row index
+ \return list of column indices
+ */
+ LongSeq GetRowSetIndices(in long row) raises(IncorrectIndex);
+ /*!
+ \brief Sort values in the specified table row.
+
+ Sort order is specified by the \a order parameter. The \a policy
+ specifies how to process empty cells (put to the first place, ignore, etc).
+
+ Raises an exception if \a row is out of range.
+
+ \note Other table rows are not affected.
+
+ \param row row index
+ \param order sort order (ascending/descending)
+ \param policy sort policy (specifies how to process empty cells)
+ \return list of mixed column indices
+ */
+ LongSeq SortRow(in long row, in SortOrder order, in SortPolicy policy) raises(IncorrectIndex);
+ /*!
+ \brief Sort values in the specified table column.
+
+ Sort order is specified by the \a order parameter. The \a policy
+ specifies how to process empty cells (put to the first place, ignore, etc).
+
+ Raises an exception if \a column is out of range.
+
+ \note Other table columns are not affected.
+
+ \param column column index
+ \param order sort order (ascending/descending)
+ \param policy sort policy (specifies how to process empty cells)
+ \return list of mixed row indices
+ */
+ LongSeq SortColumn(in long column, in SortOrder order, in SortPolicy policy) raises(IncorrectIndex);
+ /*!
+ \brief Sort table columns by the specified row.
+
+ All the table columns are sorted according to the values in the specified
+ row. Sort order is specified by the \a order parameter. The \a policy
+ specifies how to process empty cells (put to the first place, ignore, etc).
+
+ Raises an exception if \a row is out of range.
+
+ \param row row index
+ \param order sort order (ascending/descending)
+ \param policy sort policy (specifies how to process empty cells)
+ \return list of mixed column indices
+ */
+ LongSeq SortByRow(in long row, in SortOrder order, in SortPolicy policy) raises(IncorrectIndex);
+ /*!
+ \brief Sort table rows by the specified column.
+
+ All the table rows are sorted according to the values in the specified
+ column. Sort order is specified by the \a order parameter. The \a policy
+ specifies how to process empty cells (put to the first place, ignore, etc).
+
+ Raises an exception if \a column is out of range.
+
+ \param column column index
+ \param order sort order (ascending/descending)
+ \param policy sort policy (specifies how to process empty cells)
+ \return list of mixed row indices
+ */
+ LongSeq SortByColumn(in long column, in SortOrder order, in SortPolicy policy) raises(IncorrectIndex);
+ /*!
+ \brief Swap values in two table cells.
+
+ Raises an exception if any specified index is out of range.
+
+ \param row1 first cell's row index
+ \param column1 first cell's column index
+ \param row2 second cell's row index
+ \param column2 second cell's column index
+ */
+ void SwapCells(in long row1, in long column1, in long row2, in long column2) raises(IncorrectIndex);
+ /*!
+ \brief Swap two table rows.
+
+ Raises an exception if any \a row1 or \a row2 is out of range.
+
+ \param row1 first row's index
+ \param row2 second row's index
+ */
+ void SwapRows(in long row1, in long row2) raises(IncorrectIndex);
+ /*!
+ \brief Swap two table columns.
+
+ Raises an exception if any \a column1 or \a column2 is out of range.
+
+ \param column1 first column's index
+ \param column2 second column's index
+ */
+ void SwapColumns(in long column1, in long column2) raises(IncorrectIndex);
+ /*!
+ \brief Reads a table from a byte stream.
+ \param fileStream byte stream
+ \return \c true if table is successfully read or \c false otherwise
+ \sa SaveToFile()
+ */
+ boolean ReadFromFile(in SALOMEDS::TMPFile fileStream);
+ /*!
+ \brief Saves a table into a byte stream.
+ \return byte stream with table representation
+ \sa ReadFromFile()
+ */
SALOMEDS::TMPFile SaveToFile();
};
//==========================================================================
-/*! \brief %AttributeTableOfReal interface
+ /*!
+ \brief Table of %integer values
- This attribute allows to store a table of reals (indexing from 1 like in CASCADE)
- and string titles of this table, of each row, of each column.
-<em>See \ref example21 for an example of usage of these methods in batchmode of %SALOME application.</em>
+ This attribute allows to store a table of %integer values. It is possible
+ to specify titles for rows and columns. In addition, the unis labels can be
+ assigned to the rows. And finally, the table iself can have title.
-*/
- //==========================================================================
+ \note The indices of rows and columns in the table start from 1.
- interface AttributeTableOfReal : GenericAttribute
- {
-//! This exception is raised when an incorrect index is passed as parameter.
- exception IncorrectIndex {};
-//! This exception is raised when an incorrect length of the argument is passed as parameter.
- exception IncorrectArgumentLength {};
+ <em>See \ref example21 for an example of usage of this attribute in batchmode of %SALOME application.</em>
- // titles: for table, for each row, for each column
-/*!
- Sets the title of the table.
-*/
- void SetTitle(in string theTitle);
-/*!
- Returns the title of the table.
-*/
- string GetTitle();
-/*!
- Sets the title of a row with a definite index.
-*/
- void SetRowTitle(in long theIndex, in string theTitle) raises(IncorrectIndex);
-/*!
- Sets the titles for all rows of the table.
-*/
- void SetRowTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
-/*!
- Returns the titles of all rows of the table.
-*/
- StringSeq GetRowTitles();
-/*!
- Sets the title of a column with a definite index.
-*/
- void SetColumnTitle(in long theIndex, in string theTitle) raises(IncorrectIndex);
-/*!
- Sets the titles for all columns of the table.
-*/
- void SetColumnTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
-/*!
- Returns the titles of all columns of the table.
-*/
- StringSeq GetColumnTitles();
+ \sa AttributeTable, AttributeTableOfReal, AttributeTableOfString
+ */
+ //==========================================================================
- //Rows units
-/*!
- Sets the unit of a row with a definite index.
-*/
- void SetRowUnit(in long theIndex, in string theUnit) raises(IncorrectIndex);
-/*!
- Sets the units for all rows of the table.
-*/
- void SetRowUnits(in StringSeq theUnits) raises(IncorrectArgumentLength);
-/*!
- Returns the units of all rows of the table.
-*/
- StringSeq GetRowUnits();
+ interface AttributeTableOfInteger : AttributeTable
+ {
+ /*!
+ \brief Appends new row to the table.
+
+ If the length of the \a data parameter is greater than current number of columns
+ in the table, the table is automatically resized.
+
+ \param data sequence of values which will be set as elements of the added row
+ \sa SetRow(), GetRow(), AddColumn()
+ */
+ void AddRow(in LongSeq data) raises(IncorrectArgumentLength);
+ /*!
+ \brief Replaces all the elements of the specified \a row with new values.
+
+ Raises an exception if \a row is out of range or if the length of the
+ \a data parameter is not equal to the number of columns in the table.
+
+ \param row row index
+ \param data sequence of values being set as values of the row
+ \sa GetRow(), AddRow(), SetColumn()
+ */
+ void SetRow(in long row, in LongSeq data) raises(IncorrectArgumentLength, IncorrectIndex);
+ /*!
+ \brief Returns all the values of the specified row in the table.
+
+ Raises an exception if \a row is out of range.
+
+ \note For empty cells 0 value is returned.
+
+ \param row row index
+ \return sequence of values which are set as elements of the row.
+ \sa SetRow(), AddRow()
+ */
+ LongSeq GetRow(in long row) raises(IncorrectIndex);
+ /*!
+ \brief Appends new column to the table.
+
+ If the length of the \a data parameter is greater than current number of rows
+ in the table, the table is automatically resized.
+
+ \param data sequence of values which will be set as elements of the added column
+ \sa SetColumn(), GetColumn(), AddRow()
+ */
+ void AddColumn(in LongSeq data) raises(IncorrectArgumentLength);
+ /*!
+ \brief Replaces all the elements of the specified column with new values.
+
+ Raises an exception if \a column is out of range or if the length of the
+ \a data parameter is not equal to the number of rows in the table.
+
+ \param column column index
+ \param data sequence of values being set as values of the column
+ \sa GetColumn(), AddColumn(), SetRow()
+ */
+ void SetColumn(in long column, in LongSeq data) raises(IncorrectArgumentLength, IncorrectIndex);
+ /*!
+ \brief Returns all the values of the specified column in the table.
+
+ Raises an exception if \a column is out of range.
+
+ \note For empty cells 0 value is returned.
+
+ \param column column index
+ \return sequence of values which are set as elements of the column.
+ \sa SetColumn(), AddColumn()
+ */
+ LongSeq GetColumn(in long column) raises(IncorrectIndex);
+ /*!
+ \brief Puts a value to the table cell specified by \a row and \a column indices.
+
+ If the \a row and/or \a column parameter(s) are greater than current number of rows/columns
+ in the table, the table is automatically resized.
+
+ \param value value being set to the table cell
+ \param row row index
+ \param column column index
+ \sa GetValue(), HasValue()
+ */
+ void PutValue(in long value, in long row, in long column) raises(IncorrectIndex);
+ /*!
+ \brief Returns the value from the cell table.
+
+ Raises an exception if \a row or \a column is out of range or
+ if value is not set for the specified table cell.
+
+ \param row row index
+ \param column column index
+ \return value assigned to the table cell
+ \sa PutValue(), HasValue()
+ */
+ long GetValue(in long row, in long column) raises(IncorrectIndex);
+ };
- // table information
-/*!
- Returns the number of rows of the table.
-*/
- long GetNbRows();
-/*!
- Returns the number of columns of the table.
-*/
- long GetNbColumns();
+ //==========================================================================
+ /*!
+ \brief Table of real values
- // operations with rows
-/*!
- Adds a row to the end of the table.
-*/
- void AddRow(in DoubleSeq theData) raises(IncorrectArgumentLength);
-/*!
- Sets the values of all elements of the row.
-*/
- void SetRow(in long theRow, in DoubleSeq theData) raises(IncorrectArgumentLength, IncorrectIndex);
-/*!
- Returns the row of the table.
-*/
- DoubleSeq GetRow(in long theRow) raises(IncorrectIndex);
+ This attribute allows to store a table of real values. It is possible
+ to specify titles for rows and columns. In addition, the unis labels can be
+ assigned to the rows. And finally, the table iself can have title.
- // operations with columns
-/*!
- Adds a column to the end of the table.
-*/
- void AddColumn(in DoubleSeq theData) raises(IncorrectArgumentLength);
-/*!
- Sets the values of all elements of the column.
-*/
- void SetColumn(in long theColumn, in DoubleSeq theData) raises(IncorrectArgumentLength, IncorrectIndex);
-/*!
- Returns the column of the table.
-*/
- DoubleSeq GetColumn(in long theColumn) raises(IncorrectIndex);
+ \note The indices of rows and columns in the table start from 1.
- // operations with elements
-/*!
- Puts a value in the table.
- \param theRow The row, where the value will be placed.
- \param theColumn The column, where the value will be placed.
-*/
- void PutValue(in double theValue, in long theRow, in long theColumn) raises(IncorrectIndex);
-/*!
- Returns True if there is a value in the table.
- \param theRow The row containing the value
- \param theColumn The column containing the value
-*/
- boolean HasValue(in long theRow, in long theColumn);
-/*!
- Returns the value from the table.
- \param theRow The row containing the value
- \param theColumn The column containing the value
-*/
- double GetValue(in long theRow, in long theColumn) raises(IncorrectIndex);
+ <em>See \ref example22 for an example of usage of this attribute in batchmode of %SALOME application.</em>
-/*!
- Sets the max number of colums in the table.
- \note It'd better to set it before filling the table.
-*/
- void SetNbColumns(in long theNbColumns);
+ \sa AttributeTable, AttributeTableOfInteger, AttributeTableOfString
+ */
+ //==========================================================================
-/*!
- Returns the indices of the row where the values are defined.
-*/
- LongSeq GetRowSetIndices(in long theRow) raises(IncorrectIndex);
- // operations with files
-/*!
- Reads a table from a file.
-*/
- boolean ReadFromFile(in SALOMEDS::TMPFile theStream);
-/*!
- Saves a table into a file.
-*/
- SALOMEDS::TMPFile SaveToFile();
+ interface AttributeTableOfReal : AttributeTable
+ {
+ /*!
+ \brief Appends new row to the table.
+
+ If the length of the \a data parameter is greater than current number of columns
+ in the table, the table is automatically resized.
+
+ \param data sequence of values which will be set as elements of the added row
+ \sa SetRow(), GetRow(), AddColumn()
+ */
+ void AddRow(in DoubleSeq data) raises(IncorrectArgumentLength);
+ /*!
+ \brief Replaces all the elements of the specified \a row with new values.
+
+ Raises an exception if \a row is out of range or if the length of the
+ \a data parameter is not equal to the number of columns in the table.
+
+ \param row row index
+ \param data sequence of values being set as values of the row
+ \sa GetRow(), AddRow(), SetColumn()
+ */
+ void SetRow(in long row, in DoubleSeq data) raises(IncorrectArgumentLength, IncorrectIndex);
+ /*!
+ \brief Returns all the values of the specified row in the table.
+
+ Raises an exception if \a row is out of range.
+
+ \note For empty cells 0.0 value is returned.
+
+ \param row row index
+ \return sequence of values which are set as elements of the row.
+ \sa SetRow(), AddRow()
+ */
+ DoubleSeq GetRow(in long row) raises(IncorrectIndex);
+ /*!
+ \brief Appends new column to the table.
+
+ If the length of the \a data parameter is greater than current number of rows
+ in the table, the table is automatically resized.
+
+ \param data sequence of values which will be set as elements of the added column
+ \sa SetColumn(), GetColumn(), AddRow()
+ */
+ void AddColumn(in DoubleSeq data) raises(IncorrectArgumentLength);
+ /*!
+ \brief Replaces all the elements of the specified column with new values.
+
+ Raises an exception if \a column is out of range or if the length of the
+ \a data parameter is not equal to the number of rows in the table.
+
+ \param column column index
+ \param data sequence of values being set as values of the column
+ \sa GetColumn(), AddColumn(), SetRow()
+ */
+ void SetColumn(in long column, in DoubleSeq data) raises(IncorrectArgumentLength, IncorrectIndex);
+ /*!
+ \brief Returns all the values of the specified column in the table.
+
+ Raises an exception if \a column is out of range.
+
+ \note For empty cells 0.0 value is returned.
+
+ \param column column index
+ \return sequence of values which are set as elements of the column.
+ \sa SetColumn(), AddColumn()
+ */
+ DoubleSeq GetColumn(in long column) raises(IncorrectIndex);
+ /*!
+ \brief Puts a value to the table cell specified by \a row and \a column indices.
+
+ If the \a row and/or \a column parameter(s) are greater than current number of rows/columns
+ in the table, the table is automatically resized.
+
+ \param value value being set to the table cell
+ \param row row index
+ \param column column index
+ \sa GetValue(), HasValue()
+ */
+ void PutValue(in double value, in long row, in long volumn) raises(IncorrectIndex);
+ /*!
+ \brief Returns the value from the cell table.
+
+ Raises an exception if \a row or \a column is out of range or
+ if value is not set for the specified table cell.
+
+ \param row row index
+ \param column column index
+ \return value assigned to the table cell
+ \sa PutValue(), HasValue()
+ */
+ double GetValue(in long row, in long column) raises(IncorrectIndex);
};
-
-
//==========================================================================
-/*! \brief %AttributeTableOfString interface
+ /*!
+ \brief Table of string values
- This attribute allows to store a table of strings (indexing from 1 like in CASCADE)
- and string titles of this table, of each row, of each column.
-<em>See \ref example21 for an example of usage of these methods in batchmode of %SALOME application.</em>
+ This attribute allows to store a table of string values. It is possible
+ to specify titles for rows and columns. In addition, the unis labels can be
+ assigned to the rows. And finally, the table iself can have title.
-*/
+ \note The indices of rows and columns in the table start from 1.
+ \sa AttributeTable, AttributeTableOfInteger, AttributeTableOfReal
+ */
//==========================================================================
-
- interface AttributeTableOfString : GenericAttribute
+ interface AttributeTableOfString : AttributeTable
{
-//! This exception is raised when an incorrect index is passed as parameter.
- exception IncorrectIndex {};
-//! This exception is raised when an incorrect length of the argument is passed as parameter.
- exception IncorrectArgumentLength {};
-
- // titles: for table, for each row, for each column
-/*!
- Sets the title of the table.
-*/
- void SetTitle(in string theTitle);
-/*!
- Returns the title of the table.
-*/
- string GetTitle();
-/*!
- Sets the title of a row with a definite index.
-*/
- void SetRowTitle(in long theIndex, in string theTitle) raises(IncorrectIndex);
-/*!
- Sets the titles for all rows of the table.
-*/
- void SetRowTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
-/*!
- Returns the titles of all rows of the table.
-*/
- StringSeq GetRowTitles();
-/*!
- Sets the title of a column with a definite index.
-*/
- void SetColumnTitle(in long theIndex, in string theTitle) raises(IncorrectIndex);
-/*!
- Sets the titles for all columns of the table.
-*/
- void SetColumnTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
-/*!
- Returns the titles of all columns of the table.
-*/
- StringSeq GetColumnTitles();
-
- //Rows units
-/*!
- Sets the unit of a row with a definite index.
-*/
- void SetRowUnit(in long theIndex, in string theUnit) raises(IncorrectIndex);
-/*!
- Sets the units for all rows of the table.
-*/
- void SetRowUnits(in StringSeq theUnits) raises(IncorrectArgumentLength);
-/*!
- Returns the units of all rows of the table.
-*/
- StringSeq GetRowUnits();
-
- // table information
-/*!
- Returns the number of rows of the table.
-*/
- long GetNbRows();
-/*!
- Returns the number of columns of the table.
-*/
- long GetNbColumns();
-
- // operations with rows
-/*!
- Adds a row to the end of the table.
-*/
- void AddRow(in StringSeq theData) raises(IncorrectArgumentLength);
-/*!
- Sets the values of all elements of the row.
-*/
- void SetRow(in long theRow, in StringSeq theData) raises(IncorrectArgumentLength, IncorrectIndex);
-/*!
- Returns the row of the table.
-*/
- StringSeq GetRow(in long theRow) raises(IncorrectIndex);
-
- // operations with columns
-/*!
- Adds a column to the end of the table.
-*/
- void AddColumn(in StringSeq theData) raises(IncorrectArgumentLength);
-/*!
- Sets the values of all elements of the column.
-*/
- void SetColumn(in long theColumn, in StringSeq theData) raises(IncorrectArgumentLength, IncorrectIndex);
-/*!
- Returns the column of the table.
-*/
- StringSeq GetColumn(in long theColumn) raises(IncorrectIndex);
-
- // operations with elements
-/*!
- Puts a value in the table.
- \param theRow The row, where the value will be placed.
- \param theColumn The column, where the value will be placed.
-*/
- void PutValue(in string theValue, in long theRow, in long theColumn) raises(IncorrectIndex);
-/*!
- Returns True if there is a value in the table.
- \param theRow The row containing the value
- \param theColumn The column containing the value
-*/
- boolean HasValue(in long theRow, in long theColumn);
-/*!
- Returns the value from the table.
- \param theRow The row containing the value
- \param theColumn The column containing the value
-*/
- string GetValue(in long theRow, in long theColumn) raises(IncorrectIndex);
-
-/*!
- Sets the max number of colums in the table.
- \note It'd better to set it before filling the table.
-*/
- void SetNbColumns(in long theNbColumns);
-
-/*!
- Returns the indices of the row where the values are defined.
-*/
- LongSeq GetRowSetIndices(in long theRow) raises(IncorrectIndex);
- // operations with files
-/*!
- Reads a table from a file.
-*/
- boolean ReadFromFile(in SALOMEDS::TMPFile theStream);
-/*!
- Saves a table into a file.
-*/
- SALOMEDS::TMPFile SaveToFile();
+ /*!
+ \brief Appends new row to the table.
+
+ If the length of the \a data parameter is greater than current number of columns
+ in the table, the table is automatically resized.
+
+ \param data sequence of values which will be set as elements of the added row
+ \sa SetRow(), GetRow(), AddColumn()
+ */
+ void AddRow(in StringSeq data) raises(IncorrectArgumentLength);
+ /*!
+ \brief Replaces all the elements of the specified \a row with new values.
+
+ Raises an exception if \a row is out of range or if the length of the
+ \a data parameter is not equal to the number of columns in the table.
+
+ \param row row index
+ \param data sequence of values being set as values of the row
+ \sa GetRow(), AddRow(), SetColumn()
+ */
+ void SetRow(in long row, in StringSeq data) raises(IncorrectArgumentLength, IncorrectIndex);
+ /*!
+ \brief Returns all the values of the specified row in the table.
+
+ Raises an exception if \a row is out of range.
+
+ \note For empty cells empty string is returned.
+
+ \param row row index
+ \return sequence of values which are set as elements of the row.
+ \sa SetRow(), AddRow()
+ */
+ StringSeq GetRow(in long row) raises(IncorrectIndex);
+ /*!
+ \brief Appends new column to the table.
+
+ If the length of the \a data parameter is greater than current number of rows
+ in the table, the table is automatically resized.
+
+ \param data sequence of values which will be set as elements of the added column
+ \sa SetColumn(), GetColumn(), AddRow()
+ */
+ void AddColumn(in StringSeq data) raises(IncorrectArgumentLength);
+ /*!
+ \brief Replaces all the elements of the specified column with new values.
+
+ Raises an exception if \a column is out of range or if the length of the
+ \a data parameter is not equal to the number of rows in the table.
+
+ \param column column index
+ \param data sequence of values being set as values of the column
+ \sa GetColumn(), AddColumn(), SetRow()
+ */
+ void SetColumn(in long column, in StringSeq data) raises(IncorrectArgumentLength, IncorrectIndex);
+ /*!
+ \brief Returns all the values of the specified column in the table.
+
+ Raises an exception if \a column is out of range.
+
+ \note For empty cells empty string is returned.
+
+ \param column column index
+ \return sequence of values which are set as elements of the column.
+ \sa SetColumn(), AddColumn()
+ */
+ StringSeq GetColumn(in long column) raises(IncorrectIndex);
+ /*!
+ \brief Puts a value to the table cell specified by \a row and \a column indices.
+
+ If the \a row and/or \a column parameter(s) are greater than current number of rows/columns
+ in the table, the table is automatically resized.
+
+ \param value value being set to the table cell
+ \param row row index
+ \param column column index
+ \sa GetValue(), HasValue()
+ */
+ void PutValue(in string value, in long row, in long column) raises(IncorrectIndex);
+ /*!
+ \brief Returns the value from the cell table.
+
+ Raises an exception if \a row or \a column is out of range or
+ if value is not set for the specified table cell.
+
+ \param row row index
+ \param column column index
+ \return value assigned to the table cell
+ \sa PutValue(), HasValue()
+ */
+ string GetValue(in long row, in long column) raises(IncorrectIndex);
};
-
//==========================================================================
-/*! \brief %AttributeStudyProperties interface
-
- This attribute allows to store study properties: user name, creation date, creation
- mode, modified flag, locked flag.
-<em>See \ref example20 for an example of usage of these methods in batchmode of %SALOME application.</em>
-
-*/
+ /*!
+ \brief %Study properties attribute
+
+ This attribute is used to store study properties: user name, creation date,
+ creation mode, modified flag, locked flag.
+
+ <em>See \ref example20 for an example of usage of this attribute in batchmode of %SALOME application.</em>
+ */
//==========================================================================
-
interface AttributeStudyProperties : GenericAttribute
{
-/*!
- Sets the name of the author of the %Study
-*/
- void SetUserName(in string theName);
-/*!
- Returns the name of the user of the %Study.
- \note <BR>It returns a null string, if user name is not set
-*/
+ /*!
+ \brief Sets the name of the study author to the attribute.
+ \param author study author name
+ */
+ void SetUserName(in string author);
+ /*!
+ \brief Returns the name of the study author.
+ \return study author name (empty string if not set)
+ */
string GetUserName();
-/*!
- Sets creation date of the %Study.
-*/
- void SetCreationDate(in long theMinute, in long theHour, in long theDay, in long theMonth, in long theYear);
-/*!
- Returns creation date of the %Study and True if creation date is set.
-*/
- boolean GetCreationDate(out long theMinute, out long theHour, out long theDay, out long theMonth, out long theYear);
-/*!
- Sets creation mode of the %Study.
- \note <BR>Creation mode must be: "from scratch" or "copy from".
-*/
- void SetCreationMode(in string theMode);
-/*!
- Returns creation mode: "from scratch", "copy from", or null string
- if creation mode is not set
-*/
+ /*!
+ \brief Sets creation date of the study.
+ \param minute minutes part of the date
+ \param hour hour part of the date
+ \param day day number part of the date
+ \param month month part of the date
+ \param year year part of the date
+ */
+ void SetCreationDate(in long minute, in long hour, in long day, in long month, in long year);
+ /*!
+ \brief Returns creation date of the study.
+ \param minute used to return minutes part of the date (undefined if creation date is not set)
+ \param hour used to return hour part of the date (undefined if creation date is not set)
+ \param day used to return day number part of the date (undefined if creation date is not set)
+ \param month used to return month part of the date (undefined if creation date is not set)
+ \param year used to return year part of the date (undefined if creation date is not set)
+ \return \c true if creation date is set or \c false otherwise
+ */
+ boolean GetCreationDate(out long minute, out long hour, out long day, out long month, out long year);
+ /*!
+ \brief Sets creation mode of the study.
+ \note Creation mode must be either "from scratch" or "copy from".
+ \param mode creation mode description
+ */
+ void SetCreationMode(in string mode);
+ /*!
+ \brief Returns creation mode of the study.
+
+ \brief The following values are allowed for creation mode: "from scratch", "copy from",
+ empty string (if not set).
+
+ \return creation mode description
+ */
string GetCreationMode();
-/*!
- Sets the number of transactions executed after the last saving of the document.
-*/
- void SetModified(in long theModified);
-/*!
- Returns True, if the document has been modified and not saved.
-*/
+ /*!
+ \brief Sets the number of transactions executed after the last saving of the study.
+ \param modified transaction count
+ */
+ void SetModified(in long modified);
+ /*!
+ \brief Check if study has been modified since last saving operation.
+ \return \c true, if the study has been modified and not saved or \c false otherwise
+ */
boolean IsModified();
-/*!
- Returns the number of transactions executed after the last saving of the document.
-*/
+ /*!
+ \brief Returns the number of transactions executed after the last saving of the study.
+ \return transaction count
+ */
long GetModified();
-/*!
- Sets the document locked for modifications if <VAR>theLocked</VAR> is True.
-*/
- void SetLocked(in boolean theLocked);
-/*!
- Returns True if the document is locked for modifications.
-*/
+ /*!
+ \brief Lock/unlock the study for modifications.
+ \note This parameter is not recursive.
+ \note If the study is locked, any attempt to modify study contents leads to the raising
+ of the LockProtection exception.
+ \param lock \c true if study should be locked or \c false if study should be unlocked
+ */
+ void SetLocked(in boolean lock);
+ /*!
+ \brief Check if study is locked.
+ \return \c true if study is locked or \c false otherwise
+ */
boolean IsLocked();
-/*!
- Appends modification parameters to the modifications list.
-*/
- void SetModification(in string theName, in long theMinute, in long theHour, in long theDay, in long theMonth, in long theYear);
-/*!
- Returns a list of mosdifiers user names, modification dates.
- /note <BR>If <VAR>theWithCreator</VAR> is True, then the output list will also contain the name of the author and the date of creation.
-*/
- void GetModificationsList(out StringSeq theNames, out LongSeq theMinutes, out LongSeq theHours, out LongSeq theDays, out LongSeq theMonths, out LongSeq theYears, in boolean theWithCreator);
+ /*!
+ \brief Appends modification record to the list of study modifications.
+ \param author author of the modification
+ \param minute minutes part of the modification date
+ \param hour hour part of the modification date
+ \param day day number part of the modification date
+ \param month month part of the modification date
+ \param year year part of the modification date
+ */
+ void SetModification(in string author, in long minute, in long hour, in long day, in long month, in long year);
+ /*!
+ \brief Returns list of all the study modification records.
+ \param authors used to return authors of the modification records
+ \param minutes used to return minutes parts of the modification records
+ \param hours used to return hour parts of the modification records
+ \param days used to return day number parts of the modification records
+ \param months used to return month parts of the modification records
+ \param years used to return year parts of the modification records
+ \param withCreator \c true if creation record should be also added to the resulting list or \c false otherwise
+ */
+ void GetModificationsList(out StringSeq authors, out LongSeq minutes, out LongSeq hours, out LongSeq days, out LongSeq months, out LongSeq years, in boolean withCreator);
};
- //==========================================================================
-/*! \brief %AttributePythonObject interface
- Attribute allowing to store pyton objects as a sequence of chars.
-*/
//==========================================================================
+ /*!
+ \brief Python %object attribute
+ This attribute is used to store pyton objects as a sequence of characters.
+ */
+ //==========================================================================
interface AttributePythonObject : GenericAttribute
{
-/*!
- Sets in the attribute a Python object converted into a sequence of chars.
- \param theSequence A sequence of chars.
- \param IsScript Defines (if True) whether this sequence of chars is a Python script.
-*/
- void SetObject(in string theSequence, in boolean IsScript);
-/*!
- Returns a Python object stored in the attribute as a sequence of chars.
-*/
+ /*!
+ \brief Sets a Python %object converted into a sequence of characters to the attribute.
+ \param pyObject sequence of characters representing the encoded Python %object
+ \param isScript if \c true, the \a pyObject parameter specifies a Python script
+ */
+ void SetObject(in string pyObject, in boolean isScript);
+ /*!
+ \brief Returns a Python %object stored in the attribute as a sequence of characters.
+ \return encoded Python %object stored in the attribute (empty string if not set)
+ */
string GetObject();
-/*!
- Returns True if the sequence of bytes stored in the attribute corresponds
- to a Python script.
-*/
+ /*!
+ \brief Check if the value stored in the attribute is a Python script
+ \return \c true if the sequence of characters stored in the attribute corresponds
+ to a Python script or \c false otherwise
+ */
boolean IsScript();
};
- //==========================================================================
-/*! \brief %AttributeParameter interface
- Attribute is a universal container of basic types
-*/
+ //==========================================================================
+ /*!
+ \brief Parameter attribute
+
+ This attribute is a universal container of arbitrary data of basic types
+ (%integer, real, string, array, etc).
+
+ Each parameter is identified by the unique name. Only one value of the
+ specific type can be assigned to the parameter, though it is allowed to
+ assign values of different types to the same name.
+ */
//==========================================================================
interface AttributeParameter : GenericAttribute
{
-/*!
- Associates a integer value with the ID
- \param theID An ID of a parameter.
- \param theValue A value of the parameter
-*/
- void SetInt(in string theID, in long theValue);
-/*!
- Returns a int value associated with the given ID
- \param theID An ID of a parameter.
-*/
- long GetInt(in string theID);
-
-/*!
- Associates a real value with the ID
- \param theID An ID of a parameter.
- \param theValue A value of the parameter
-*/
- void SetReal(in string theID, in double theValue);
-/*!
- Returns a real value associated with the given ID
- \param theID An ID of a parameter.
-*/
- double GetReal(in string theID);
-
-/*!
- Associates a string value with the ID
- \param theID An ID of a parameter.
- \param theValue A value of the parameter
-*/
- void SetString(in string theID, in string theValue);
-/*!
- Returns a string value associated with the given ID
- \param theID An ID of a parameter.
-*/
- string GetString(in string theID);
-
-/*!
- Associates a boolean value with the ID
- \param theID An ID of a parameter.
- \param theValue A value of the parameter
-*/
- void SetBool(in string theID, in boolean theValue);
-/*!
- Returns a boolean value associated with the given ID
- \param theID An ID of a parameter.
-*/
- boolean GetBool(in string theID);
-
-/*!
- Associates an array of real values with the ID
- \param theID An ID of a parameter.
- \param theArray The array of real values
-*/
- void SetRealArray(in string theID, in DoubleSeq theArray);
-/*!
- Returns an array of real values associated with the ID
- \param theID An ID of a parameter.
-*/
- DoubleSeq GetRealArray(in string theID);
-
-/*!
- Associates an array of integer values with the ID
- \param theID An ID of a parameter.
- \param theArray The array of integer values
-*/
- void SetIntArray(in string theID, in LongSeq theArray);
-/*!
- Returns an array of integer values associated with the ID
- \param theID An ID of a parameter.
-*/
- LongSeq GetIntArray(in string theID);
-
-/*!
- Associates an array of string values with the ID
- \param theID An ID of a parameter.
- \param theArray The array of string values
-*/
- void SetStrArray(in string theID, in StringSeq theArray);
-/*!
- Returns an array of string values associated with the ID
- \param theID An ID of a parameter.
-*/
- StringSeq GetStrArray(in string theID);
-/*!
- Returns True if for the ID of given type was assigned a value in the attribute
- \param theID An ID of a parameter.
- \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(RealArray), 5(IntArray), 6(StrArray)].
-*/
- boolean IsSet(in string theID, in long theType);
-/*!
- Removes a parameter with given ID and Type, returns True if succeded
- \param theID An ID of a parameter.
- \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(RealArray), 5(IntArray), 6(StrArray)].
-*/
- boolean RemoveID(in string theID, in long theType);
-/*!
- Returns a father attribute of this attribute
-*/
+ //! This exception is raised when an invalid identifier is passed as parameter.
+ exception InvalidIdentifier {};
+
+ /*!
+ \brief Associates %integer value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetInt(in string ID, in long value);
+ /*!
+ \brief Returns %integer value associated with the specified identifier.
+
+ Raises an exception if %integer parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return %integer value assigned to the parameter
+ */
+ long GetInt(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Associates real value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetReal(in string ID, in double value);
+ /*!
+ \brief Returns real value associated with the specified identifier.
+
+ Raises an exception if real parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return real value assigned to the parameter
+ */
+ double GetReal(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Associates string value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetString(in string ID, in string value);
+ /*!
+ \brief Returns string value associated with the specified identifier.
+
+ Raises an exception if string parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return string value assigned to the parameter
+ */
+ string GetString(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Associates boolean value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetBool(in string ID, in boolean value);
+ /*!
+ \brief Returns boolean value associated with the specified identifier.
+
+ Raises an exception if boolean parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return boolean value assigned to the parameter
+ */
+ boolean GetBool(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Associates real array value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetRealArray(in string ID, in DoubleSeq value);
+ /*!
+ \brief Returns real array value associated with the specified identifier.
+
+ Raises an exception if real array parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return real array value assigned to the parameter
+ */
+ DoubleSeq GetRealArray(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Associates %integer array value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetIntArray(in string ID, in LongSeq value);
+ /*!
+ \brief Returns %integer array value associated with the specified identifier.
+
+ Raises an exception if %integer array parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return %integer array value assigned to the parameter
+ */
+ LongSeq GetIntArray(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Associates string array value with the unique identifier.
+ \param ID parameter name
+ \param value parameter value
+ */
+ void SetStrArray(in string ID, in StringSeq value);
+ /*!
+ \brief Returns string array value associated with the specified identifier.
+
+ Raises an exception if string array parameter is not set for the specified
+ parameter.
+
+ \param ID parameter name
+ \return string array value assigned to the parameter
+ */
+ StringSeq GetStrArray(in string ID) raises(InvalidIdentifier);
+ /*!
+ \brief Checks if the value of specified type is set for the identifier.
+ \param ID parameter name
+ \param ptype parameter type [0(%integer), 1(real), 2(boolean), 3(string),
+ 4(real array), 5(%integer array), 6(string array)]
+ \returns \c true if the value of type \a ptype is associated with the parameter \a ID
+ */
+ boolean IsSet(in string ID, in long ptype);
+ /*!
+ \brief Removes value of specified type from the named parameter.
+ \param ID parameter name
+ \param ptype parameter type [0(%integer), 1(real), 2(boolean), 3(string),
+ 4(real array), 5(%integer array), 6(string array)]
+ \return \c true if value is successfully removed or \c false otherwise
+ */
+ boolean RemoveID(in string ID, in long ptype);
+ /*!
+ \brief Returns a father attribute of this attribute.
+ \return father parameter attribute
+ */
AttributeParameter GetFather();
-/*!
- Returns True if this attribute has a father attribute
-*/
+ /*!
+ \brief Check if this attribute has parent parameter attribute.
+ \return \c true if this attribute has parent parameter attribute
+ */
boolean HasFather();
-/*!
- Returns True if this attribute is a root attribute
-*/
+ /*!
+ \brief Check if this attribute is a root (top-level) parameter attribute.
+ \return \c true if this attribute is a root parameter attribute
+ */
boolean IsRoot();
-/*!
- Clears the content of the attribute
-*/
+ /*!
+ \brief Clears the content of the attribute.
+ */
void Clear();
-/*!
- Returns a sequence of ID's of the give type
- \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(RealArray), 5(IntArray), 6(StrArray)].
- */
- StringSeq GetIDs(in long theType);
+ /*!
+ \brief Returns a sequence of parameters identifiers of the specified type
+ stored in the attribute.
+ \param ptype parameter type [0(%integer), 1(real), 2(boolean), 3(string),
+ 4(real array), 5(%integer array), 6(string array)]
+ \return list of parameters identifier
+ */
+ StringSeq GetIDs(in long ptype);
};
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOME_COMM_IDL_
#define _SALOME_COMM_IDL_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Component.idl
// Author : Paul RASCLE, EDF
// $Header:
\param componentName like COMPONENT, (Python or C++ implementation)
try to make a Python import of COMPONENT,
then a lib open of libCOMPONENTEngine.so
+ \param reason in case of error (return false) a string explaining the error
\return true if load successfull or already done, false otherwise
*/
- boolean load_component_Library(in string componentName);
+ boolean load_component_Library(in string componentName, out string reason);
//! Create a new servant instance of a component.
/*!
Engines::Component create_component_instance(in string componentName,
in long studyId);
+ //! Create a new servant instance of a component with environment variables specified.
+ /*!
+ Component library must be loaded.
+ \param componentName Name of the component which will be registered
+ in Registry and Name Service,
+ (instance number suffix added to the registered name)
+ \param studyId 0 if instance is not associated to a study,
+ >0 otherwise (== study id)
+ \param env a dict of env variables
+ \param reason in case of error (return nil) a string explaining the error
+ \return a loaded component
+ */
+ Engines::Component create_component_instance_env(in string componentName,
+ in long studyId, in FieldsDict env,
+ out string reason);
//! Find a servant instance of a component
/*!
\param registeredName Name of the component in Registry or Name Service,
<?xml version="1.0"?>
<!--
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOME_CONTAINERMANAGER_IDL_
#define _SALOME_CONTAINERMANAGER_IDL_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Exception.idl
// Author : Paul RASCLE, EDF
// $Header$
<?xml version="1.0"?>
<!--
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Component.idl
// Author : Alexey Petrov, OPEN CASCADE
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_MPIContainer.idl
//
#ifndef _SALOME_MPICONTAINER_IDL_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_MPIObject.idl
//
#ifndef _SALOME_MPIOBJECT_IDL_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_ModuleCatalog.idl
// Author : Estelle Deville
// $Header$
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_PACOExtension.idl
// Author : André RIBES, EDF
// $Header:
<?xml version="1.0"?>
<!--
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_ParamPorts.idl
// Author : Andre RIBES, EDF
-
+//
#ifndef _SALOME_ParamPorts_IDL_
#define _SALOME_ParamPorts_IDL_
<?xml version="1.0"?>
<!--
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Ports.idl
// Author : Andre RIBES, EDF
-
+//
#ifndef _SALOME_PORTS_IDL_
#define _SALOME_PORTS_IDL_
<?xml version="1.0"?>
<!--
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_PyNode.idl
// Author : Christian CAREMOLI, EDF
// $Header:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Registry.idl
//
# ifndef __registry_idl__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_RessourcesCatalog.idl
// Author : Estelle Deville
// $Header$
//
-
/*! \file SALOME_RessourcesCatalog.idl \brief interfaces for %SALOME Resources Catalog
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Session.idl
// Author : Paul RASCLE, EDF
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_TestComponent.idl
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//=============================================================================
// File : SALOME_MPITestComponent.idl
// Created : mer jui 04 12:08:17 CEST 2003
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_TestModuleCatalog.idl
// Author :
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : TestNotif.idl
//
# ifndef __TESTNOTIF_IDL_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : TypeData.idl
//
#ifndef _SALOME_TYPEDATA_IDL_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef NSTEST_IDL
#define NSTEST_IDL
<member name="ref" type="string"/>
</struct>
<objref name="CALCIUM_integer" id="IDL:Ports/Calcium_Ports/Calcium_Integer_Port:1.0"/>
+ <objref name="CALCIUM_long" id="IDL:Ports/Calcium_Ports/Calcium_Long_Port:1.0"/>
<objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
<objref name="CALCIUM_double" id="IDL:Ports/Calcium_Ports/Calcium_Double_Port:1.0"/>
<objref name="CALCIUM_string" id="IDL:Ports/Calcium_Ports/Calcium_String_Port:1.0"/>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SUBDIRS = unix cmake_files
AUTOMAKE_OPTIONS=filename-length-max=255
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for boost ...")
SET(EXTENSION)
ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
SET(LIB_NAMES)
- FOREACH(version 1_35 1_38)
+ FOREACH(version 1_35 1_38 1_42)
SET(LIB_NAMES ${LIB_NAMES} libboost_${name}-vc90-mt${EXTENSION}-${version})
- ENDFOREACH(version 1_35 1_38)
+ ENDFOREACH(version 1_35 1_38 1_42)
FIND_LIBRARY(BOOST_LIB_${name} NAMES ${LIB_NAMES} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION})
ELSE(WINDOWS)
FIND_LIBRARY(BOOST_LIB_${name} boost_${name} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION})
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for cppunit ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for doxygen ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for hdf5 ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SET(KERNEL_CXXFLAGS -I${KERNEL_ROOT_DIR}/include/salome)
FIND_LIBRARY(DF DF ${KERNEL_ROOT_DIR}/lib/salome)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for libxml2 ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for omniorb ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
SET(PLATFORM_LIBADD)
IF(WINDOWS)
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0)
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ...
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings std::copy, std::transform, ...
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT)
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for pthreads ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for python ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ------
MESSAGE(STATUS "Check for swig ...")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
dist_salome_cmake_DATA = \
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import re
# ----
if # an if
\s+ # 1 or more space
(?P<val> # open the group val
-[^\s]+ # the group contain 1 or more non space characters
+.+ # the group contain 1 or more non space characters
) # close the group
""", re.VERBOSE)
"SalomeIDLMED",
]
smesh_list = [
+ "GeomSelectionTools",
"MEFISTO2D",
"MeshDriverDAT",
"MeshDriverMED",
if self.module == "med":
newlines.append("""
INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindMEDFILE.cmake)
+ IF(WINDOWS)
+ INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake)
+ ENDIF(WINDOWS)
""")
pass
if self.module == "smesh":
INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindBLSURF.cmake)
""")
pass
- if self.module == "hexoticplugin":
+ if self.module in ["ghs3dplugin", "hexoticplugin"]:
newlines.append("""
SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR})
SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR})
INCLUDE(${SMESH_ROOT_DIR}/adm_local/cmake_files/FindSMESH.cmake)
""")
pass
- if self.module == "ghs3dplugin":
+ if self.module == "ghs3dprlplugin":
newlines.append("""
SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR})
SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR})
SET(SMESH_ROOT_DIR $ENV{SMESH_ROOT_DIR})
INCLUDE(${GEOM_ROOT_DIR}/adm_local/cmake_files/FindGEOM.cmake)
+ INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMEDFILE.cmake)
INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake)
INCLUDE(${SMESH_ROOT_DIR}/adm_local/cmake_files/FindSMESH.cmake)
""")
newlines.append("""
SET(WITH_LOCAL 1)
SET(WITH_BATCH 1)
- set(VERSION 5.1.3)
- set(XVERSION 0x050103)
+ set(VERSION 5.1.4)
+ set(XVERSION 0x050104)
SET(CALCIUM_IDL_INT_F77 long)
SET(CALCIUM_CORBA_INT_F77 CORBA::Long)
SET(LONG_OR_INT int)
SET(ENABLE_PYCONSOLE ON)
SET(ENABLE_SUPERVGRAPHVIEWER ON)
SET(ENABLE_QXGRAPHVIEWER ON)
- set(VERSION 5.1.3)
- set(XVERSION 0x050103)
+ set(VERSION 5.1.4)
+ set(XVERSION 0x050104)
""")
pass
elif self.module == "geom":
SET(GHS3DPLUGIN_ENABLE_GUI ON)
""")
pass
+ elif self.module == "hexoticplugin":
+ newlines.append("""
+ SET(HEXOTICPLUGIN_ENABLE_GUI ON)
+ """)
+ pass
+ elif self.module == "ghs3dprlplugin":
+ newlines.append("""
+ SET(GHS3DPRLPLUGIN_ENABLE_GUI ON)
+ """)
+ pass
elif self.module == "yacs":
newlines.append("""
SET(SALOME_KERNEL ON)
SET(type SHARED)
ENDIF(ISIDL)
''')
+ if key == "noinst_LTLIBRARIES":
+ newlines.append(r'''
+ IF(WINDOWS)
+ SET(type STATIC)
+ ELSE(WINDOWS)
+ SET(type STATIC)
+ ENDIF(WINDOWS)
+ ''')
+ pass
# --
# Set sources for the library
# --
# --
self.setLibAdd(key, newlines)
# --
- if 1: # key != "noinst_LTLIBRARIES":
+ if key != "noinst_LTLIBRARIES":
if self.module == "medfile":
newlines.append(r'''
SET(DEST lib)
def addBinTarget(self, key, newlines):
# --
newlines.append(r'''
- FOREACH(amname ${bin_PROGRAMS} ${check_PROGRAMS})
+ FOREACH(amname ${%s})
+ '''%(key))
+ # --
+ newlines.append(r'''
+ SET(test ON)
+ ''')
+ if key == "check_PROGRAMS":
+ newlines.append(r'''
+ IF(bin_PROGRAMS)
+ STRING(REGEX MATCH ${amname} is_present ${bin_PROGRAMS})
+ IF(is_present)
+ SET(test OFF)
+ ENDIF(is_present)
+ ENDIF(bin_PROGRAMS)
+ ''')
+ pass
+ newlines.append(r'''
+ IF(test)
''')
# --
newlines.append(r'''
''')
# --
newlines.append(r'''
- ENDFOREACH(amname ${bin_PROGRAMS} ${check_PROGRAMS})
+ ENDIF(test)
''')
+ newlines.append(r'''
+ ENDFOREACH(amname ${%s})
+ '''%(key))
# --
return
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SET(FULLDIR ${CMAKE_INSTALL_PREFIX}/${DEST})
MESSAGE(STATUS "py compiling ${FULLDIR}/${PYTHON_FILE}")
SET(CMD "import py_compile ; py_compile.compile('${FULLDIR}/${PYTHON_FILE}')")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SET(FULLDIR ${CMAKE_INSTALL_PREFIX}/${DIR})
FILE(MAKE_DIRECTORY ${FULLDIR})
MESSAGE(STATUS "Compiling ${IDL_FILE} into ${FULLDIR}")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Doxyfile 1.2.8.1
# This file describes the settings to be used by the documentation system
# All text after a hash (#) is considered a comment and will be ignored
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-## -*- makefile -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+## -*- makefile -*-
## We keep a list of dependencies in `.depend' for each of the source
## files on which it depends. When one of the source files is modified
## we remove its record from .depend and regenerate its dependencies,
## tacking them onto the end of .depend. By including the .depend file
## into the makefile, we're telling make that the makefile depends on
## the dependency list in the .depend file.
-##
## This is as fast as the `.d' method described in the GNU make manual
## for automatic dependencies, but has the added advantage that all
## dependencies are stored in one place. The advantage over the
## `makedepend' program is that only those files that are out of date
## have dependency information rebuilt, and the Makefile is not
## modified.
-##
## This is also where tracing information is updated. The $(TRACE)
## program is run on each source file to make sure that the H5TRACE()
## macros are up to date. If they are then the file is not modified,
## otherwise the file is changed and a backup is saved by appending a
## tilde to the file name.
-##
+#
$(srcdir)/Dependencies: .depend
@if test "$(srcdir)" != "."; then \
echo '## This file is machine generated on GNU systems.' >$@; \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
DIR=`pwd`
EXEC_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
cd $EXEC_DIR/..
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# common directories to put headerfiles
#
inc_builddir=$(top_builddir)/include/salome
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#=======================================================================
# This section of this makefile comes from the file
# 'adm/unix/make_conclude' which was generated with config.status
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# generic rule to put in top module Makefile
# (for example with module SALOME, SALOME/Makefile.in and SALOME/src/Makefile.in)
# build all lib in all subdir
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#=======================================================================
# Begin specific part to omniorb
# (include from file adm/unix/make_omniorb generated by
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
SUBDIRS = config_files
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
dnl Synopsis : AC_CC_WARNINGS([ANSI])
dnl Version : 1.1 (2000/12/31)
dnl Author : Ville Laurikari <vl@iki.fi>
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_BOOL
dnl If the compiler recognizes bool as a separate built-in type,
dnl define HAVE_BOOL. Note that a typedef is not a separate
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_MUTABLE
dnl If the compiler allows modifying class data members flagged with
dnl the mutable keyword even in const objects (for example in the
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_PARTIAL_SPECIALIZATION
dnl If the compiler supports partial specialization,
dnl define HAVE_PARTIAL_SPECIALIZATION.
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
-ddnl @synopsis AC_CXX_TYPENAME
+
+dnl @synopsis AC_CXX_TYPENAME
dnl
dnl If the compiler recognizes the typename keyword, define HAVE_TYPENAME.
dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl------------------------------------------------------------
dnl Check availability of Salome binary distribution
-dnl
dnl Author : Marc Tajchman (CEA, 2002)
dnl------------------------------------------------------------
-
+dnl
AC_DEFUN([CHECK_SALOME],[
AC_CHECKING(for Salome)
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_JAVA],[
dnl AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
dnl AC_REQUIRE([AC_PROG_CPP])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_MICO],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
#@synonpsis CHECK_PTHREADS
dnl check for pthreads system interfaces.
dnl set CFLAGS_PTHREADS, CXXFLAGS_PTHREADS and LIBS_PTHREADS to
#! /bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+
AC_DEFUN([AC_CHECK_SIZEOF_FORTRAN], [
AC_REQUIRE([AC_F77_WRAPPERS])
AC_CACHE_CHECK([size of Fortran [$1]], [ac_cv_sizeof_fortran_[]translit($1, [A-Z *], [a-z_p])],[
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_C_DEPEND_FLAG
dnl define C_DEPEND_FLAG
dnl define CXX_DEPEND_FLAG
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_HAVE_SSTREAM
dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
dnl @author Ben Stanley
dnl @version $Id$
dnl modified by Marc Tajchman (CEA) - 10/10/2002
-dnl
AC_DEFUN([AC_CXX_HAVE_SSTREAM],[
AC_CACHE_CHECK([whether the compiler has stringstream],
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_NAMESPACES
dnl If the compiler can prevent names clashes using namespaces, define
dnl HAVE_NAMESPACES.
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_OPTION(-option,variable where we add option if ok,action if ok; action if not ok)
dnl Check options for C++ compiler
dnl @author Bernard Secher - 15/01/2004
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_TEMPLATE_OPTIONS
dnl Check template options for C++ compiler
dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_USE_STD_IOSTREAM
dnl
dnl If the C++ library use std iostream
dnl
dnl @author Bernard Secher (CEA) - 05/12/2003
-dnl
+
AC_DEFUN([AC_CXX_USE_STD_IOSTREAM],
[
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_CXX_WARNINGS
dnl Check warning flags for C++ compiler to control warning messages
dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl @synopsis AC_LINKER_OPTIONS
dnl Check warning flags for C++ compiler to control warning messages
dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl Paul RASCLE: modification for Linux: -pthread required by boost...
dnl Available from the GNU Autoconf Macro Archive at:
dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
# Check availability of Salome's KERNEL binary distribution
#
# Author : Jerome Roy (CEA, 2003)
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_BOOST],[
AC_CHECKING(for BOOST Library)
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+
AC_DEFUN([CHECK_CALCIUM], [
## Guess where as cal_int type is provided by --with-cal_int option
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_CAS],[
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_CORBA],[
if test x"$DEFAULT_ORB" = x"omniORB"
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_CPPUNIT],[
AC_CHECKING(for cppunit)
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_F77],[
AC_PROG_F77
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_HDF5],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_HTML_GENERATORS],[
#AC_CHECKING(for html generators)
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_LAM],[
AC_REQUIRE([AC_PROG_CC])dnl
-dnl Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or
-dnl email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
# CHECK_LIBBATCH
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_LIBXML],[
AC_CHECKING(for libxml library)
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_MPI],[
AC_REQUIRE([AC_PROG_CC])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_MPICH],[
AC_REQUIRE([AC_PROG_CC])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_OMNIORB],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_OPENMPI],[
AC_ARG_WITH(openmpi,
AC_HELP_STRING([--with-openmpi=DIR],[root directory path of openmpi installation]),
AC_MSG_CHECKING(for openmpi)
if test "$WITHOPENMPI" = "yes";then
mpi_ok=yes
+ WITHMPI=yes
CPPFLAGS="-DOMPI_IGNORE_CXX_SEEK -DWITHOPENMPI $CPPFLAGS"
AC_MSG_RESULT(yes)
else
mpi_ok=no
+ WITHMPI=no
AC_MSG_RESULT(no)
fi
fi
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl File : check_paco++.m4
dnl Author : André RIBES (EDF)
dnl Module : KERNEL
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_SOCKETS],[
dnl Author
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_SWIG],[
AC_REQUIRE([CHECK_PYTHON])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_WITHIHM],[
AC_ARG_WITH(gui,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
dnl modify CFLAGS, CXXFLAGS and LIBS for compiling pthread-based programs.
dnl@author (C) Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>, 1998, 2000
dnl@id $Id$
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl ---
dnl File : local_install.m4
dnl Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
dnl ---
dnl
-
dnl The purpose of below autoconf macro is to generate custom install script
dnl to be used instead of global /usr/bin/install one.
dnl The difference is that resulting install script does not install file passed
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl define macros :
dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl This macro defines the PYTHON_EMBED_{CFLAGS,LDFLAGS,LIBS} substitutions
dnl that should be used when embedding the python interpreter into a program.
dnl AM_INIT_PYTHON_EMBED
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
## ------------------------
## Python file handling
## From Andrew Dalke
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# The following is to avoid PACKAGE_... env variable
# redefinition compilation warnings
# ============================================================
+
if !WITHONLYLAUNCHER
AM_CXXFLAGS = -I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h
AM_CPPFLAGS = -I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
// File : BasicGenericDestructor.cxx
// Author : Antoine YESSAYAN, Paul RASCLE, EDF
#include "BasicsGenericDestructor.hxx"
-using namespace std;
-
void HouseKeeping();
std::list<PROTECTED_DELETE*> PROTECTED_DELETE::_objList;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
// File : BasicGenericDestructor.hxx
// Author : Antoine YESSAYAN, Paul RASCLE, EDF
#define DEVTRACE(msg)
#endif
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
// ============================================================================
/*!
* The PROTECTED_DELETE base class provides a protected destructor.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Basics_DirUtils.cxx
// Autor : Alexander A. BORODIN
// Module : SALOME
# include <time.h>
#endif
-using namespace std;
-
#ifdef WIN32
# define _separator_ '\\'
#else
namespace Kernel_Utils
{
- string GetBaseName( const std::string& file_path )
+ std::string GetBaseName( const std::string& file_path )
{
int pos = file_path.rfind( _separator_ );
if ( pos >= 0 )
- return pos < file_path.size()-1 ? file_path.substr( pos+1 ) : "";
+ return pos < (int)file_path.size()-1 ? file_path.substr( pos+1 ) : "";
return file_path;
}
- string GetTmpDirByEnv( const std::string& tmp_path_env )
+ std::string GetTmpDirByEnv( const std::string& tmp_path_env )
{
- string dir;
+ std::string dir;
char* val = getenv( tmp_path_env.c_str() );
- val ? dir = string( val ) : "";
+ val ? dir = std::string( val ) : "";
return GetTmpDirByPath( dir );
}
- string GetTmpDirByPath( const std::string& tmp_path )
+ std::string GetTmpDirByPath( const std::string& tmp_path )
{
- string aTmpDir = tmp_path;
+ std::string aTmpDir = tmp_path;
if ( aTmpDir == "" )
{
#ifdef WIN32
{
Tmp_dir = getenv("TMP");
if (Tmp_dir == NULL)
- aTmpDir = string("C:\\");
+ aTmpDir = std::string("C:\\");
else
- aTmpDir = string(Tmp_dir);
+ aTmpDir = std::string(Tmp_dir);
}
else
- aTmpDir = string(Tmp_dir);
+ aTmpDir = std::string(Tmp_dir);
#else
- aTmpDir = string("/tmp/");
+ aTmpDir = std::string("/tmp/");
#endif
}
int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory
char buffer[127];
sprintf(buffer, "%d", aRND);
- string aSubDir(buffer);
- if(aSubDir.size() <= 1) aSubDir = string("123409876");
+ std::string aSubDir(buffer);
+ if(aSubDir.size() <= 1) aSubDir = std::string("123409876");
aTmpDir += aSubDir; //Get RND sub directory
- string aDir = aTmpDir;
+ std::string aDir = aTmpDir;
if(IsExists(aDir)) {
for(aRND = 0; IsExists(aDir); aRND++) {
// function : GetTempDir
// purpose : Returns a temp directory to store created files like "/tmp/sub_dir/"
//============================================================================
- string GetTmpDir()
+ std::string GetTmpDir()
{
return GetTmpDirByPath( "" );
}
// function : GetTempFileName
// purpose : Returns the unique temporary file name without any extension /tmp/something/file for Unix or c:\something\file for WIN32
//============================================================================
- string GetTmpFileName()
+ std::string GetTmpFileName()
{
- string tmpDir = GetTmpDir();
- string aFilePath = "";
+ std::string tmpDir = GetTmpDir();
+ std::string aFilePath = "";
if(IsExists(tmpDir)) {
srand((unsigned int)time(NULL));
int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory
char buffer[127];
sprintf(buffer, "%d", aRND);
- string aSubDir(buffer);
- if(aSubDir.size() <= 1) aSubDir = string("123409876");
+ std::string aSubDir(buffer);
+ if(aSubDir.size() <= 1) aSubDir = std::string("123409876");
aFilePath = tmpDir;
for(aRND = 0; IsExists(aFilePath); aRND++) {
// function : IsExists
// purpose : Returns True(False) if the path (not)exists
//============================================================================
- bool IsExists(const string& thePath)
+ bool IsExists(const std::string& thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
// function : GetDirByPath
// purpose : Returns directory by path and converts it to native system format
//============================================================================
- string GetDirByPath(const string& thePath)
+ std::string GetDirByPath(const std::string& thePath)
{
if (thePath.empty())
return "";
- string path = thePath;
- string::size_type length = path.length();
+ std::string path = thePath;
+ std::string::size_type length = path.length();
//detect all separators in Unix format
- for ( int i = 0; i < length; i++ )
+ for ( unsigned int i = 0; i < length; i++ )
{
if( path[i] == '/' )
path[i] = '|';
}
//detect all separators in Windows format
- for ( int i = 0; i < length; i++ )
+ for ( unsigned int i = 0; i < length; i++ )
{
if( path[i] == '\\' )
path[i] = '|';
}
- string::size_type pos = path.rfind('|');
- if ( pos == string::npos )
+ std::string::size_type pos = path.rfind('|');
+ if ( pos == std::string::npos )
{
#ifdef WIN32
//check for disk letter ( C: )
}
length = path.length();
- for ( int i = 0; i < length; i++ )
+ for ( unsigned int i = 0; i < length; i++ )
{
if( path[i] == '|' )
path[i] = _separator_;
// purpose : Returns True(False) if the path (not) empty
// Also returns False if the path is not valid
//============================================================================
- bool IsEmptyDir(const string& thePath)
+ bool IsEmptyDir(const std::string& thePath)
{
if ( thePath.empty() || !IsExists(thePath))
return false;
result = true; //empty if no file found
while ((dirp = readdir(dp)) != NULL && result )
{
- string file_name(dirp->d_name);
+ std::string file_name(dirp->d_name);
result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false
}
closedir(dp);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Basics_DirUtils.hxx
// Autor : Alexander A. BORODIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Basics_Utils.cxx
// Autor : Alexander A. BORODIN
// Module : SALOME
#include <winsock2.h>
#endif
-using namespace std;
-
namespace Kernel_Utils
{
- string GetHostname()
+ std::string GetHostname()
{
int ls = 100, r = 1;
char *s;
char *aDot = (strchr(s,'.'));
if (aDot) aDot[0] = '\0';
- string p = s;
+ std::string p = s;
delete [] s;
return p;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Basics_DirUtils.hxx
// Autor : Alexander A. BORODIN
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Basics: General purpose C++
# File : Makefile.in
# Author : Paul RASCLE (EDF)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
// File : SALOME_Basics.hxx
// Author : Alexander A. BORODIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _BASICMAINTEST_HXX_
#define _BASICMAINTEST_HXX_
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Basics: General purpose C++
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
#
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "MatrixClient.hxx"
#include "ReceiverFactory.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __MATRIXCLIENT_HXX__
#define __MATRIXCLIENT_HXX__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "MultiCommException.hxx"
-using namespace std;
MultiCommException::MultiCommException(const char *message)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _MULTICOMMEXCEPTION_HXX_
#define _MULTICOMMEXCEPTION_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Receiver.hxx"
#include <string.h>
-using namespace std;
/*!
return a deep copy of the array contained in the servant.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _RECEIVER_HXX_
#define _RECEIVER_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifdef HAVE_MPI2
#include "mpi.h"
#endif
#include "ReceiverFactory.hxx"
#include "Receivers.hxx"
-using namespace std;
#ifdef COMP_CORBA_DOUBLE
#define CorbaDNoCopyReceiver CorbaNCNoCopyReceiver
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _RECEIVERFACTORY_HXX_
#define _RECEIVERFACTORY_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "omniORB4/poa.h"
#include "utilities.h"
-using namespace std;
#define TAILLE_SPLIT 100000
#define TIMEOUT 20
if( ex.details.type == SALOME::COMM )
{
_senderDestruc=false;
- cout << ex.details.text << endl;
+ std::cout << ex.details.text << std::endl;
throw MultiCommException("Unknown sender protocol");
}
else
if( ex.details.type == SALOME::COMM )
{
_senderDestruc=false;
- cout << ex.details.text << endl;
+ std::cout << ex.details.text << std::endl;
throw MultiCommException("Unknown sender protocol");
}
else
if( ex.details.type == SALOME::COMM )
{
_senderDestruc=false;
- cout << ex.details.text << endl;
+ std::cout << ex.details.text << std::endl;
throw MultiCommException("Unknown sender protocol");
}
else
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _RECEIVERS_HXX_
#define _RECEIVERS_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEMultiComm.hxx"
SALOMEMultiComm::SALOMEMultiComm():_type(SALOME::CORBA_)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMEMULTICOMM_HXX_
#define _SALOMEMULTICOMM_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_Comm_i.hxx"
#ifndef WIN32
#include <rpc/xdr.h>
#include "utilities.h"
#include "SenderFactory.hxx"
-using namespace std;
#ifndef WIN32
CORBA::ORB_var &getGlobalORB(){
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOME_COMM_I_HXX_
#define _SALOME_COMM_I_HXX_
~SALOME_CorbaLongCSender_i();
CORBA::ULong getSize();
SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
-#ifndef WIN32
- SALOME::CorbaLongCSender_ptr _this();
-#endif
};
#ifdef HAVE_MPI2
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Communication.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_Matrix_i.hxx"
#include "SenderFactory.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOME_MATRIX_I_HXX__
#define __SALOME_MATRIX_I_HXX__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_Comm_i.hxx"
#include "SenderFactory.hxx"
#include "utilities.h"
#include "SALOMEMultiComm.hxx"
-using namespace std;
#ifdef COMP_CORBA_DOUBLE
#define SALOME_CorbaDoubleSender SALOME_CorbaDoubleNCSender_i
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SENDERFACTORY_HXX_
#define _SENDERFACTORY_HXX_
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
%module libSALOME_Comm
%feature("autodoc", "1");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : Component_i.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
#include <process.h>
#endif
-
-using namespace std;
-
extern bool _Sleeping ;
static Engines_Component_i * theEngines_Component ;
_instanceName.c_str());
}
- _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
+ if(notif)
+ _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
}
//=============================================================================
const CORBA::String_var ior = _orb->object_to_string(_container);
if(regist)
_myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", _instanceName.c_str());
- _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
+ if(notif)
+ _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
+
}
{
Engines::FieldsDict_var copie = new Engines::FieldsDict;
copie->length(_fieldsDict.size());
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
CORBA::ULong i = 0;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++)
{
MESSAGE("Engines_Component_i::Stop_i() pthread_t "<< pthread_self()
<< " pid " << getpid() << " instanceName "
<< _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId );
+ << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id
+ << std::dec << " _ThreadId " << _ThreadId );
#else
MESSAGE("Engines_Component_i::Stop_i() pthread_t "<< pthread_self().p
<< " pid " << _getpid() << " instanceName "
<< _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId );
+ << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id
+ << std::dec << " _ThreadId " << _ThreadId );
#endif
MESSAGE("Engines_Component_i::Suspend_i() pthread_t "<< pthread_self()
<< " pid " << getpid() << " instanceName "
<< _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId );
+ << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id
+ << std::dec << " _ThreadId " << _ThreadId );
#else
MESSAGE("Engines_Component_i::Suspend_i() pthread_t "<< pthread_self().p
<< " pid " << _getpid() << " instanceName "
<< _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId );
+ << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id
+ << std::dec << " _ThreadId " << _ThreadId );
#endif
bool RetVal = false ;
MESSAGE("Engines_Component_i::Resume_i() pthread_t "<< pthread_self()
<< " pid " << getpid() << " instanceName "
<< _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId );
+ << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id
+ << std::dec << " _ThreadId " << _ThreadId );
#else
MESSAGE("Engines_Component_i::Resume_i() pthread_t "<< pthread_self().p
<< " pid " << _getpid() << " instanceName "
<< _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId );
+ << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id
+ << std::dec << " _ThreadId " << _ThreadId );
#endif
bool RetVal = false ;
#ifndef WIN32
}
// --- all strings given with setProperties are set in environment
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
{
std::string cle((*it).first);
std::cerr << "endService for " << serviceName << " Component instance : " << _instanceName ;
std::cerr << " Cpu Used: " << cpus << " (s) " << std::endl;
MESSAGE("Send EndService notification for " << serviceName
- << endl << " Component instance : " << _instanceName << " StartUsed "
- << _StartUsed << " _ThreadCpuUsed "<< _ThreadCpuUsed << endl <<endl);
+ << std::endl << " Component instance : " << _instanceName << " StartUsed "
+ << _StartUsed << " _ThreadCpuUsed "<< _ThreadCpuUsed << std::endl <<std::endl);
_ThreadId = 0 ;
}
return true ;
}
+void SetCpuUsed();
+void CallCancelThread();
+
//=============================================================================
/*!
* C++ method:
cpu = usage.ru_utime.tv_sec*1000 +usage.ru_utime.tv_usec/1000;
cpu = cpu+ usage.ru_stime.tv_sec*1000 +usage.ru_stime.tv_usec/1000;
cpu=cpu-_StartUsed ;
- // cout << pthread_self() << " Engines_Component_i::CpuUsed " << " "
+ // std::cout << pthread_self() << " Engines_Component_i::CpuUsed " << " "
// << _serviceName << usage.ru_utime.tv_sec << " - " << _StartUsed
- // << " = " << cpu << endl ;
+ // << " = " << cpu << std::endl ;
}
else
{
- // cout << pthread_self() << "Engines_Component_i::CpuUsed _ThreadId "
+ // std::cout << pthread_self() << "Engines_Component_i::CpuUsed _ThreadId "
// << _ThreadId << " " << _serviceName<< " _StartUsed "
- // << _StartUsed << endl ;
+ // << _StartUsed << std::endl ;
}
-#else
+#else
// NOT implementet yet
#endif
*/
//=============================================================================
-string Engines_Component_i::GetDynLibraryName(const char *componentName)
+std::string Engines_Component_i::GetDynLibraryName(const char *componentName)
{
- string ret="lib";
+ std::string ret="lib";
ret+=componentName;
ret+="Engine.so";
return ret;
CORBA::String_var containerName=_container->name();
std::string name(containerName);
name.erase(0,12);
- string::size_type slash =name.find_first_of('/');
+ std::string::size_type slash =name.find_first_of('/');
if(slash != std::string::npos)
name[slash]='_';
_containerName=name;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : Container_i.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
#include <string.h>
#include <stdio.h>
#include <time.h>
+#include <sys/types.h>
#ifndef WIN32
#include <sys/time.h>
#include <dlfcn.h>
#include <unistd.h>
+#include <sys/wait.h>
#else
#include <signal.h>
#include <process.h>
#include <Python.h>
#include "Container_init_python.hxx"
-using namespace std;
-
bool _Sleeping = false ;
// // Needed by multi-threaded Python --- Supervision
extern "C" {void SigIntHandler( int ) ; }
#endif
-#ifdef WIN32
-# define separator '\\'
+#ifndef WIN32
+#define LIB "lib"
+#define ENGINESO "Engine.so"
#else
-# define separator '/'
+#define LIB ""
+#define ENGINESO "Engine.dll"
#endif
+#ifdef WIN32
+#define SEP ';'
+#define SLASH '\\'
+#else
+#define SEP ':'
+#define SLASH '/'
+#endif
-map<std::string, int> Engines_Container_i::_cntInstances_map;
-map<std::string, void *> Engines_Container_i::_library_map;
-map<std::string, void *> Engines_Container_i::_toRemove_map;
+std::map<std::string, int> Engines_Container_i::_cntInstances_map;
+std::map<std::string, void *> Engines_Container_i::_library_map;
+std::map<std::string, void *> Engines_Container_i::_toRemove_map;
omni_mutex Engines_Container_i::_numInstanceMutex ;
static PyObject* _pyCont;
int checkifexecutable(const std::string&);
-int findpathof(std::string&, const std::string&);
+int findpathof(const std::string& path, std::string&, const std::string&);
/*! \class Engines_Container_i
* \brief C++ implementation of Engines::Container interface
_argc = argc ;
_argv = argv ;
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
#ifndef WIN32
MESSAGE(hostname << " " << getpid() <<
" Engines_Container_i starting argc " <<
}
SCRUTE(argv[1]);
_isSupervContainer = false;
- if (strcmp(argv[1],"SuperVisionContainer") == 0) _isSupervContainer = true;
-
- if (_isSupervContainer)
- {
- _ArgC = argc ;
- _ArgV = argv ;
- }
_orb = CORBA::ORB::_duplicate(orb) ;
_poa = PortableServer::POA::_duplicate(poa) ;
// pycont = SALOME_Container.SALOME_Container_i(containerIORStr)
CORBA::String_var sior = _orb->object_to_string(pCont);
- string myCommand="pyCont = SALOME_Container.SALOME_Container_i('";
+ std::string myCommand="pyCont = SALOME_Container.SALOME_Container_i('";
myCommand += _containerName + "','";
myCommand += sior;
myCommand += "')\n";
SCRUTE(myCommand);
- if (!_isSupervContainer)
- {
- PyGILState_STATE gstate = PyGILState_Ensure();
+ PyGILState_STATE gstate = PyGILState_Ensure();
#ifdef WIN32
- // mpv: this is temporary solution: there is a unregular crash if not
- //Sleep(2000);
- //
- // first element is the path to Registry.dll, but it's wrong
- PyRun_SimpleString("import sys\n");
- PyRun_SimpleString("sys.path = sys.path[1:]\n");
+ // mpv: this is temporary solution: there is a unregular crash if not
+ //Sleep(2000);
+ //
+ // first element is the path to Registry.dll, but it's wrong
+ PyRun_SimpleString("import sys\n");
+ PyRun_SimpleString("sys.path = sys.path[1:]\n");
#endif
- PyRun_SimpleString("import SALOME_Container\n");
- PyRun_SimpleString((char*)myCommand.c_str());
- PyObject *mainmod = PyImport_AddModule("__main__");
- PyObject *globals = PyModule_GetDict(mainmod);
- _pyCont = PyDict_GetItemString(globals, "pyCont");
+ PyRun_SimpleString("import SALOME_Container\n");
+ PyRun_SimpleString((char*)myCommand.c_str());
+ PyObject *mainmod = PyImport_AddModule("__main__");
+ PyObject *globals = PyModule_GetDict(mainmod);
+ _pyCont = PyDict_GetItemString(globals, "pyCont");
- PyGILState_Release(gstate);
- }
+ PyGILState_Release(gstate);
fileTransfer_i* aFileTransfer = new fileTransfer_i();
CORBA::Object_var obref=aFileTransfer->_this();
char* Engines_Container_i::getHostName()
{
- string s = Kernel_Utils::GetHostname();
+ std::string s = Kernel_Utils::GetHostname();
// MESSAGE("Engines_Container_i::getHostName " << s);
return CORBA::string_dup(s.c_str()) ;
}
* CORBA method: check if servant is still alive
*/
//=============================================================================
-
void Engines_Container_i::ping()
{
MESSAGE("Engines_Container_i::ping() pid "<< getpid());
* - orb shutdown if no other servants in the process
*/
//=============================================================================
-
void Engines_Container_i::Shutdown()
{
MESSAGE("Engines_Container_i::Shutdown()");
}
}
-/* int checkifexecutable(const char *filename)
-*
-* Return non-zero if the name is an executable file, and
-* zero if it is not executable, or if it does not exist.
+//=============================================================================
+//! load a component implementation
+/*!
+* CORBA method
+* \param componentName component name
+* \param reason explains error when load fails
+* \return true if dlopen successfull or already done, false otherwise
*/
-
-int checkifexecutable(const string& filename)
+//=============================================================================
+bool
+Engines_Container_i::load_component_Library(const char* componentName, CORBA::String_out reason)
{
- int result;
- struct stat statinfo;
-
- result = stat(filename.c_str(), &statinfo);
- if (result < 0) return 0;
- if (!S_ISREG(statinfo.st_mode)) return 0;
-#ifdef WIN32
- return 1;
-#else
- if (statinfo.st_uid == geteuid()) return statinfo.st_mode & S_IXUSR;
- if (statinfo.st_gid == getegid()) return statinfo.st_mode & S_IXGRP;
- return statinfo.st_mode & S_IXOTH;
-#endif
-}
-
-
-/* int findpathof(char *pth, const char *exe)
-*
-* Find executable by searching the PATH environment variable.
-*
-* const char *exe - executable name to search for.
-* char *pth - the path found is stored here, space
-* needs to be available.
-*
-* If a path is found, returns non-zero, and the path is stored
-* in pth. If exe is not found returns 0, with pth undefined.
-*/
-
-int findpathof(string& pth, const string& exe)
-{
- string path( getenv("PATH") );
- if ( path.size() == 0 )
- return 0;
-
- char path_spr =
-#ifdef WIN32
- ';';
-#else
- ':';
-#endif
+ //=================================================================
+ // --- C++ implementation section
+ //=================================================================
+ std::string retso;
+ if(load_component_CppImplementation(componentName,retso))
+ {
+ reason=CORBA::string_dup("");
+ return true;
+ }
+ else if(retso != "ImplementationNotFound")
+ {
+ reason=CORBA::string_dup(retso.c_str());
+ return false;
+ }
- char dir_spr =
-#ifdef WIN32
- '\\';
-#else
- '/';
-#endif
-
- int offset = 0;
- int stop = 0;
- int found = 0;
- while(!stop && !found)
- {
- int pos = path.find( path_spr, offset );
- if (pos == string::npos)
- stop = 1;
+ retso="Component ";
+ retso+=componentName;
+ retso+=": Can't find C++ implementation ";
+ retso+=std::string(LIB) + componentName + ENGINESO;
- pth = path.substr( offset, pos - offset );
- if ( pth.size() > 0 )
+ //=================================================================
+ // --- Python implementation section
+ //=================================================================
+ std::string retpy;
+ if(load_component_PythonImplementation(componentName,retpy))
{
- if( pth[pth.size()-1] != dir_spr )
- pth += dir_spr;
- pth += exe;
- found = checkifexecutable(pth.c_str());
+ reason=CORBA::string_dup("");
+ return true;
+ }
+ else if(retpy != "ImplementationNotFound")
+ {
+ reason=CORBA::string_dup(retpy.c_str());
+ return false;
+ }
+
+ retpy="Component ";
+ retpy+=componentName;
+ retpy+=": Can't find python implementation ";
+ retpy+=componentName;
+ retpy+="(.py)";
+
+ //=================================================================
+ // -- Executable implementation section
+ //=================================================================
+ std::string retex;
+ if(load_component_ExecutableImplementation(componentName,retex))
+ {
+ reason=CORBA::string_dup("");
+ return true;
+ }
+ else if(retex != "ImplementationNotFound")
+ {
+ reason=CORBA::string_dup(retex.c_str());
+ return false;
}
- offset = pos+1;
- }
+ retex="Component ";
+ retex+=componentName;
+ retex+=": Can't find executable implementation ";
+ retex+=componentName;
+ retex+=".exe";
-/* char *searchpath;
- char *beg, *end;
- int stop, found;
- int len;
+ std::string ret="Component implementation not found: ";
+ ret += componentName ;
+ ret += '\n' ;
+ ret += retso+ '\n' ;
+ ret += retpy+ '\n' ;
+ ret += retex+ '\n' ;
- if (strchr(exe, separator) != NULL) {
-#ifndef WIN32
- if (realpath(exe, pth) == NULL) return 0;
-#endif
- return checkifexecutable(pth);
- }
+ std::cerr << ret << std::endl;
+ reason=CORBA::string_dup(ret.c_str());
- searchpath = getenv("PATH");
- if (searchpath == NULL) return 0;
- if (strlen(searchpath) <= 0) return 0;
-
- string env_path(searchpath);
-
- beg = searchpath;
- stop = 0; found = 0;
- do {
- end = strchr(beg, ':');
- if (end == NULL) {
- stop = 1;
- strncpy(pth, beg, PATH_MAX);
- len = strlen(pth);
- } else {
- strncpy(pth, beg, end - beg);
- pth[end - beg] = '\0';
- len = end - beg;
- }
- if (pth[len - 1] != '/') strncat(pth, "/", 1);
- strncat(pth, exe, PATH_MAX - len);
- found = checkifexecutable(pth);
- if (!stop) beg = end + 1;
- } while (!stop && !found);
-*/
- return found;
+ return false;
}
-
-
//=============================================================================
-//! load a new component class
+//! try to load a C++ component implementation
/*!
-* CORBA method: load a new component class (Python or C++ implementation)
-* \param componentName like COMPONENT
-* try to make a Python import of COMPONENT,
-* then a lib open of libCOMPONENTEngine.so
-* \return true if dlopen successfull or already done, false otherwise
+* C++ method:
+* \param componentName the name of the component (COMPONENT, for example)
+* \param reason explains error when load fails
+* \return true if loading is successfull or already done, false otherwise
*/
//=============================================================================
-
bool
-Engines_Container_i::load_component_Library(const char* componentName)
+Engines_Container_i::load_component_CppImplementation(const char* componentName, std::string& reason)
{
-
- string aCompName = componentName;
-
- // --- try dlopen C++ component
-
-#ifndef WIN32
- string impl_name = string ("lib") + aCompName + string("Engine.so");
-#else
- string impl_name = aCompName + string("Engine.dll");
-#endif
+ std::string aCompName(componentName);
+ std::string impl_name = std::string(LIB) + aCompName + ENGINESO;
SCRUTE(impl_name);
- _numInstanceMutex.lock(); // lock to be alone
+ _numInstanceMutex.lock(); // lock to be alone
// (see decInstanceCnt, finalize_removal))
if (_toRemove_map.count(impl_name) != 0) _toRemove_map.erase(impl_name);
if (_library_map.count(impl_name) != 0)
- {
- MESSAGE("Library " << impl_name << " already loaded");
- _numInstanceMutex.unlock();
- return true;
- }
+ {
+ MESSAGE("Library " << impl_name << " already loaded");
+ _numInstanceMutex.unlock();
+ reason="";
+ return true;
+ }
+ _numInstanceMutex.unlock();
- std::string retso="";
#ifndef WIN32
void* handle;
- handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ;
- if ( !handle )retso=dlerror();
+ handle = dlopen( impl_name.c_str() , RTLD_NOW ) ;
+ if ( !handle )
+ {
+ //not loadable. Try to find the lib file in LD_LIBRARY_PATH
+ std::string path;
+ char* p=getenv("LD_LIBRARY_PATH");
+ if(p)path=p;
+ path=path+SEP+"/usr/lib"+SEP+"/lib";
+
+ std::string pth;
+ if(findpathof(path, pth, impl_name))
+ {
+ //found but not loadable
+ reason="Component ";
+ reason+=aCompName;
+ reason+=": C++ implementation found ";
+ reason+=pth;
+ reason+=" but it is not loadable. Error:\n";
+ reason+=dlerror();
+ std::cerr << reason << std::endl;
+ return false;
+ }
+ else
+ {
+ //not found
+ //continue with other implementation
+ reason="ImplementationNotFound";
+ return false;
+ }
+ }
#else
HINSTANCE handle;
handle = LoadLibrary( impl_name.c_str() );
+ if ( !handle )
+ {
+ reason="ImplementationNotFound";
+ }
#endif
if ( handle )
- {
- _library_map[impl_name] = handle;
- _numInstanceMutex.unlock();
- return true;
- }
- _numInstanceMutex.unlock();
+ {
+ _numInstanceMutex.lock();
+ _library_map[impl_name] = handle;
+ _numInstanceMutex.unlock();
+ reason="";
+ return true;
+ }
- // --- try import Python component
+ return false;
- INFOS("try import Python component "<<componentName);
- std::string retpy;
- if (_isSupervContainer)
- {
- INFOS("Supervision Container does not support Python Component Engines");
- return false;
- }
+}
+//=============================================================================
+//! try to load a Python component implementation
+/*!
+* C++ method:
+* \param componentName name of the component
+* \param reason explains error when load fails
+* \return true if loading is successfull or already done, false otherwise
+*/
+//=============================================================================
+bool
+Engines_Container_i::load_component_PythonImplementation(const char* componentName, std::string& reason)
+{
+ std::string aCompName(componentName);
+
+ _numInstanceMutex.lock() ; // lock to be alone (stl container write)
if (_library_map.count(aCompName) != 0)
- {
- return true; // Python Component, already imported
- }
- else
- {
- PyGILState_STATE gstate = PyGILState_Ensure();
- PyObject *result = PyObject_CallMethod(_pyCont,
- (char*)"import_component",
- (char*)"s",componentName);
-
- retpy=PyString_AsString(result);
- Py_XDECREF(result);
- SCRUTE(retpy);
- PyGILState_Release(gstate);
+ {
+ _numInstanceMutex.unlock() ;
+ reason="";
+ return true; // Python Component, already imported
+ }
+ _numInstanceMutex.unlock() ;
+
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject *result = PyObject_CallMethod(_pyCont,
+ (char*)"import_component",
+ (char*)"s",componentName);
- if (retpy=="") // import possible: Python component
+ reason=PyString_AsString(result);
+ Py_XDECREF(result);
+ SCRUTE(reason);
+ PyGILState_Release(gstate);
+
+ if (reason=="")
{
+ //Python component has been loaded (import componentName)
_numInstanceMutex.lock() ; // lock to be alone (stl container write)
_library_map[aCompName] = (void *)_pyCont; // any non O value OK
_numInstanceMutex.unlock() ;
- MESSAGE("import Python: "<<aCompName<<" OK");
+ MESSAGE("import Python: "<< aCompName <<" OK");
return true;
}
- }
- // Try to find an executable
+ else if(reason=="ImplementationNotFound")
+ {
+ //Python implementation has not been found. Continue with other implementation
+ reason="ImplementationNotFound";
+ }
+ else
+ {
+ //Python implementation has been found but loading has failed
+ std::cerr << reason << std::endl;
+ }
+ return false;
+
+}
+//=============================================================================
+//! try to load a Executable component implementation
+/*!
+* C++ method:
+* \param componentName name of the component
+* \param reason explains error when load fails
+* \return true if loading is successfull or already done, false otherwise
+*/
+//=============================================================================
+bool
+Engines_Container_i::load_component_ExecutableImplementation(const char* componentName, std::string& reason)
+{
+ std::string aCompName(componentName);
std::string executable=aCompName+".exe";
- string path;
- if (findpathof(path, executable))
- return true;
-
- INFOS( "Impossible to load component: " << componentName );
- INFOS( "Can't load shared library: " << impl_name );
- std::cerr << retso << std::endl;
- INFOS( "Can't import Python module: " << componentName );
- std::cerr << retpy << std::endl;
- INFOS( "Can't execute program: " << executable );
+
+ std::string path;
+ std::string pth;
+
+ char* p=getenv("PATH");
+ if(p)path=p;
+
+ if (findpathof(path, pth, executable))
+ {
+ if(checkifexecutable(pth))
+ {
+ _numInstanceMutex.lock() ; // lock to be alone (stl container write)
+ _library_map[executable] = (void *)1; // any non O value OK
+ _numInstanceMutex.unlock() ;
+ MESSAGE("import executable: "<< pth <<" OK");
+ reason="";
+ return true;
+ }
+ reason="Component ";
+ reason+=aCompName;
+ reason+=": implementation found ";
+ reason+=pth;
+ reason+=" but it is not executable";
+ std::cerr << reason << std::endl;
+ }
+ else
+ {
+ reason="ImplementationNotFound";
+ }
return false;
}
* \return a loaded component
*/
//=============================================================================
-
Engines::Component_ptr
Engines_Container_i::create_component_instance(const char*genericRegisterName,
CORBA::Long studyId)
{
- if (studyId < 0)
- {
- INFOS("studyId must be > 0 for mono study instance, =0 for multiStudy");
- return Engines::Component::_nil() ;
- }
-
- Engines::Component_var iobject = Engines::Component::_nil() ;
+ Engines::FieldsDict_var env = new Engines::FieldsDict;
+ char* reason;
+ Engines::Component_ptr compo = create_component_instance_env(genericRegisterName, studyId, env, reason);
+ CORBA::string_free(reason);
+ return compo;
+}
- string aCompName = genericRegisterName;
- if (_library_map.count(aCompName) != 0) // Python component
- {
- if (_isSupervContainer)
+//=============================================================================
+//! Create a new component instance with environment variables specified
+/*!
+* CORBA method: Creates a new servant instance of a component.
+* The servant registers itself to naming service and Registry.
+* \param genericRegisterName Name of the component instance to register
+* in Registry & Name Service (without _inst_n suffix)
+* \param studyId 0 for multiStudy instance,
+* study Id (>0) otherwise
+* \param env dict of env variables
+* \param reason explains error when create_component_instance_env fails
+* \return a loaded component
+*/
+//=============================================================================
+Engines::Component_ptr
+Engines_Container_i::create_component_instance_env(const char*genericRegisterName,
+ CORBA::Long studyId,
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason)
+{
+ if (studyId < 0)
{
- INFOS("Supervision Container does not support Python Component Engines");
- return Engines::Component::_nil();
+ INFOS("studyId must be > 0 for mono study instance, =0 for multiStudy");
+ reason=CORBA::string_dup("studyId must be > 0 for mono study instance, =0 for multiStudy");
+ return Engines::Component::_nil() ;
}
- _numInstanceMutex.lock() ; // lock on the instance number
- _numInstance++ ;
- int numInstance = _numInstance ;
- _numInstanceMutex.unlock() ;
-
- char aNumI[12];
- sprintf( aNumI , "%d" , numInstance ) ;
- string instanceName = aCompName + "_inst_" + aNumI ;
- string component_registerName =
- _containerName + "/" + instanceName;
- PyGILState_STATE gstate = PyGILState_Ensure();
- PyObject *result = PyObject_CallMethod(_pyCont,
- (char*)"create_component_instance",
- (char*)"ssl",
- aCompName.c_str(),
- instanceName.c_str(),
- studyId);
- string iors = PyString_AsString(result);
- Py_DECREF(result);
- SCRUTE(iors);
- PyGILState_Release(gstate);
+ std::string error;
+ if (_library_map.count(genericRegisterName) != 0)
+ {
+ // It's a Python component
+ Engines::Component_ptr compo = createPythonInstance(genericRegisterName, studyId, error);
+ reason=CORBA::string_dup(error.c_str());
+ return compo;
+ }
- if( iors!="" )
+ std::string impl_name = std::string(LIB) + genericRegisterName + ENGINESO;
+ if (_library_map.count(impl_name) != 0)
{
- CORBA::Object_var obj = _orb->string_to_object(iors.c_str());
- iobject = Engines::Component::_narrow( obj ) ;
- _listInstances_map[instanceName] = iobject;
+ // It's a C++ component
+ void* handle = _library_map[impl_name];
+ Engines::Component_ptr compo = createInstance(genericRegisterName, handle, studyId, error);
+ reason=CORBA::string_dup(error.c_str());
+ return compo;
}
- return iobject._retn();
- }
- //--- try C++
+ impl_name = std::string(genericRegisterName) + ".exe";
+ if (_library_map.count(impl_name) != 0)
+ {
+ //It's an executable component
+ Engines::Component_ptr compo = createExecutableInstance(genericRegisterName, studyId, env, error);
+ reason=CORBA::string_dup(error.c_str());
+ return compo;
+ }
-#ifndef WIN32
- string impl_name = string ("lib") + genericRegisterName +string("Engine.so");
-#else
- string impl_name = genericRegisterName +string("Engine.dll");
-#endif
- if (_library_map.count(impl_name) != 0) // C++ component
- {
- void* handle = _library_map[impl_name];
- iobject = createInstance(genericRegisterName,
- handle,
- studyId);
- return iobject._retn();
- }
+ error="load_component_Library has probably not been called for component: ";
+ error += genericRegisterName;
+ INFOS(error);
+ reason=CORBA::string_dup(error.c_str());
+ return Engines::Component::_nil() ;
+}
- // If it's not a Python or a C++ component try to launch a standalone component
- // in a sub directory
- // This component is implemented in an executable with name genericRegisterName.exe
- // It must register itself in Naming Service. The container waits some time (10 s max)
- // it's registration.
+//=============================================================================
+//! Create a new component instance (Executable implementation)
+/*!
+* \param CompName Name of the component instance
+* \param studyId 0 for multiStudy instance,
+* study Id (>0) otherwise
+* \param env dict of env variables
+* \param reason explains error when creation fails
+* \return a loaded component
+*
+* This component is implemented in an executable with name genericRegisterName.exe
+* It must register itself in Naming Service. The container waits some time (10 s max)
+* it's registration.
+*/
+//=============================================================================
+Engines::Component_ptr
+Engines_Container_i::createExecutableInstance(std::string CompName, int studyId,
+ const Engines::FieldsDict& env,
+ std::string& reason)
+{
+ Engines::Component_var iobject = Engines::Component::_nil() ;
_numInstanceMutex.lock() ; // lock on the instance number
_numInstance++ ;
char aNumI[12];
sprintf( aNumI , "%d" , numInstance ) ;
- string instanceName = aCompName + "_inst_" + aNumI ;
- string component_registerName = _containerName + "/" + instanceName;
+ std::string instanceName = CompName + "_inst_" + aNumI ;
+ std::string component_registerName = _containerName + "/" + instanceName;
//check if an entry exist in naming service
CORBA::Object_var nsobj = _NS->Resolve(component_registerName.c_str());
command+=";cd ";
command+=instanceName;
command+=";";
- command+=genericRegisterName ;
+ command+=CompName ;
command+=".exe";
command+=" ";
command+= sior; // container ior string
command+=instanceName; //instance name
command+=" &";
MESSAGE("SALOME_Container::create_component_instance command=" << command);
+
+#ifndef WIN32
+ // use fork/execl instead of system to get finer control on env variables
+ int status;
+ pid_t pid = fork();
+ if(pid == 0) // child
+ {
+ for (CORBA::ULong i=0; i < env.length(); i++)
+ {
+ if (env[i].value.type()->kind() == CORBA::tk_string)
+ {
+ const char* value;
+ env[i].value >>= value;
+ std::string s(env[i].key);
+ s+='=';
+ s+=value;
+ putenv(strdup(s.c_str()));
+ }
+ }
+
+ execl("/bin/sh", "sh", "-c", command.c_str() , (char *)0);
+ status=-1;
+ }
+ else if(pid < 0) // failed to fork
+ {
+ status=-1;
+ }
+ else //parent
+ {
+ pid_t tpid;
+ do
+ {
+ tpid = wait(&status);
+ } while (tpid != pid);
+ }
+#else
// launch component with a system call
int status=system(command.c_str());
+#endif
if (status == -1)
{
- MESSAGE("SALOME_Container::create_component_instance system failed " << "(system command status -1)");
+ reason="SALOME_Container::create_component_instance system failed (system command status -1)";
+ MESSAGE(reason);
return Engines::Component::_nil();
}
#ifndef WIN32
else if (WEXITSTATUS(status) == 217)
{
- MESSAGE("SALOME_Container::create_component_instance system failed " << "(system command status 217)");
+ reason="SALOME_Container::create_component_instance system failed (system command status 217)";
+ MESSAGE(reason);
return Engines::Component::_nil();
}
#endif
Sleep(1000);
#endif
count-- ;
- MESSAGE( count << ". Waiting for component " << genericRegisterName);
+ MESSAGE( count << ". Waiting for component " << CompName);
obj = _NS->Resolve(component_registerName.c_str());
}
if(CORBA::is_nil(obj))
{
- MESSAGE("SALOME_Container::create_component_instance failed");
+ reason="SALOME_Container::create_component_instance failed";
+ MESSAGE(reason);
return Engines::Component::_nil();
}
else
}
}
+
//=============================================================================
-//! Find an existing (in the container) component instance
+//! Create a new component instance (Python implementation)
/*!
-* CORBA method: Finds a servant instance of a component
-* \param registeredName Name of the component in Registry or Name Service,
-* without instance suffix number
-* \param studyId 0 if instance is not associated to a study,
-* >0 otherwise (== study id)
-* \return the first instance found with same studyId
+* \param CompName Name of the component instance
+* \param studyId 0 for multiStudy instance,
+* study Id (>0) otherwise
+* \param reason explains error when creation fails
+* \return a loaded component
*/
//=============================================================================
-
Engines::Component_ptr
-Engines_Container_i::find_component_instance( const char* registeredName,
- CORBA::Long studyId)
+Engines_Container_i::createPythonInstance(std::string CompName, int studyId,
+ std::string& reason)
{
- Engines::Component_var anEngine = Engines::Component::_nil();
- map<string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
- while (itm != _listInstances_map.end())
- {
- string instance = (*itm).first;
- SCRUTE(instance);
- if (instance.find(registeredName) == 0)
- {
- anEngine = (*itm).second;
- if (studyId == anEngine->getStudyId())
- {
- return anEngine._retn();
- }
- }
- itm++;
- }
- return anEngine._retn();
-}
-
-//=============================================================================
-//! Find or create a new component instance
-/*!
-* CORBA method: find or create an instance of the component (servant),
-* load a new component class (dynamic library) if required,
-*
-* ---- FOR COMPATIBILITY WITH 2.2 ----
-*
-* ---- USE ONLY FOR MULTISTUDY INSTANCES ! --------
-*
-* The servant registers itself to naming service and Registry.
-* \param genericRegisterName Name of the component to register
-* in Registry & Name Service
-* \param componentName Name of the constructed library of the component
-* \return a loaded component
-*/
-//=============================================================================
-
-Engines::Component_ptr
-Engines_Container_i::load_impl( const char* genericRegisterName,
- const char* componentName )
-{
- string impl_name = string ("lib") + genericRegisterName +string("Engine.so");
Engines::Component_var iobject = Engines::Component::_nil() ;
- if (load_component_Library(genericRegisterName))
- iobject = find_or_create_instance(genericRegisterName, impl_name);
- return iobject._retn();
-}
-
-
-//=============================================================================
-//! Remove the component instance from container
-/*!
-* CORBA method: Stops the component servant, and deletes all related objects
-* \param component_i Component to be removed
-*/
-//=============================================================================
-void Engines_Container_i::remove_impl(Engines::Component_ptr component_i)
-{
- ASSERT(! CORBA::is_nil(component_i));
- string instanceName = component_i->instanceName() ;
- MESSAGE("unload component " << instanceName);
- _numInstanceMutex.lock() ; // lock to be alone (stl container write)
- _listInstances_map.erase(instanceName);
+ _numInstanceMutex.lock() ; // lock on the instance number
+ _numInstance++ ;
+ int numInstance = _numInstance ;
_numInstanceMutex.unlock() ;
- component_i->destroy() ;
- _NS->Destroy_Name(instanceName.c_str());
-}
-
-//=============================================================================
-//! Unload component libraries from the container
-/*!
-* CORBA method: Discharges unused libraries from the container.
-*/
-//=============================================================================
-
-void Engines_Container_i::finalize_removal()
-{
- MESSAGE("finalize unload : dlclose");
- _numInstanceMutex.lock(); // lock to be alone
- // (see decInstanceCnt, load_component_Library)
- map<string, void *>::iterator ith;
- for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++)
- {
- void *handle = (*ith).second;
- string impl_name= (*ith).first;
- if (handle)
- {
- SCRUTE(handle);
- SCRUTE(impl_name);
- // dlclose(handle); // SALOME unstable after ...
- // _library_map.erase(impl_name);
- }
- }
- _toRemove_map.clear();
- _numInstanceMutex.unlock();
-}
-
-//=============================================================================
-//! Kill the container
-/*!
-* CORBA method: Kill the container process with exit(0).
-* To remove : never returns !
-*/
-//=============================================================================
-
-bool Engines_Container_i::Kill_impl()
-{
- MESSAGE("Engines_Container_i::Kill() pid "<< getpid() << " containerName "
- << _containerName.c_str() << " machineName "
- << Kernel_Utils::GetHostname().c_str());
- INFOS("===============================================================");
- INFOS("= REMOVE calls to Kill_impl in C++ container =");
- INFOS("===============================================================");
- //exit( 0 ) ;
- ASSERT(0);
- return false;
-}
-
-//=============================================================================
-//! Get or create a file reference object associated to a local file (to transfer it)
-/*!
-* CORBA method: get or create a fileRef object associated to a local file
-* (a file on the computer on which runs the container server), which stores
-* a list of (machine, localFileName) corresponding to copies already done.
-*
-* \param origFileName absolute path for a local file to copy on other
-* computers
-* \return a fileRef object associated to the file.
-*/
-//=============================================================================
-
-Engines::fileRef_ptr
-Engines_Container_i::createFileRef(const char* origFileName)
-{
- string origName(origFileName);
- Engines::fileRef_var theFileRef = Engines::fileRef::_nil();
-
- if (origName[0] != '/')
- {
- INFOS("path of file to copy must be an absolute path begining with '/'");
- return Engines::fileRef::_nil();
- }
-
- if (CORBA::is_nil(_fileRef_map[origName]))
- {
- CORBA::Object_var obj=_poa->id_to_reference(*_id);
- Engines::Container_var pCont = Engines::Container::_narrow(obj);
- fileRef_i* aFileRef = new fileRef_i(pCont, origFileName);
- theFileRef = Engines::fileRef::_narrow(aFileRef->_this());
- _numInstanceMutex.lock() ; // lock to be alone (stl container write)
- _fileRef_map[origName] = theFileRef;
- _numInstanceMutex.unlock() ;
- }
-
- theFileRef = Engines::fileRef::_duplicate(_fileRef_map[origName]);
- ASSERT(! CORBA::is_nil(theFileRef));
- return theFileRef._retn();
-}
-
-//=============================================================================
-//! Get a fileTransfer reference
-/*!
-* CORBA method:
-* \return a reference to the fileTransfer object
-*/
-//=============================================================================
-
-Engines::fileTransfer_ptr
-Engines_Container_i::getFileTransfer()
-{
- Engines::fileTransfer_var aFileTransfer
- = Engines::fileTransfer::_duplicate(_fileTransfer);
- return aFileTransfer._retn();
-}
-
-
-//! Create a Salome file
-Engines::Salome_file_ptr
-Engines_Container_i::createSalome_file(const char* origFileName)
-{
- string origName(origFileName);
- if (CORBA::is_nil(_Salome_file_map[origName]))
- {
- Salome_file_i* aSalome_file = new Salome_file_i();
- aSalome_file->setContainer(Engines::Container::_duplicate(this->_this()));
- try
- {
- aSalome_file->setLocalFile(origFileName);
- aSalome_file->recvFiles();
- }
- catch (const SALOME::SALOME_Exception& e)
- {
- return Engines::Salome_file::_nil();
- }
-
- Engines::Salome_file_var theSalome_file = Engines::Salome_file::_nil();
- theSalome_file = Engines::Salome_file::_narrow(aSalome_file->_this());
- _numInstanceMutex.lock() ; // lock to be alone (stl container write)
- _Salome_file_map[origName] = theSalome_file;
- _numInstanceMutex.unlock() ;
- }
-
- Engines::Salome_file_ptr theSalome_file =
- Engines::Salome_file::_duplicate(_Salome_file_map[origName]);
- ASSERT(!CORBA::is_nil(theSalome_file));
- return theSalome_file;
-}
-//=============================================================================
-//! Finds an already existing component instance or create a new instance
-/*!
-* C++ method: Finds an already existing servant instance of a component, or
-* create an instance.
-* ---- USE ONLY FOR MULTISTUDY INSTANCES ! --------
-* \param genericRegisterName Name of the component instance to register
-* in Registry & Name Service,
-* (without _inst_n suffix, like "COMPONENT")
-* \param componentLibraryName like "libCOMPONENTEngine.so"
-* \return a loaded component
-*
-* example with names:
-* - aGenRegisterName = COMPONENT (= first argument)
-* - impl_name = libCOMPONENTEngine.so (= second argument)
-* - _containerName = /Containers/cli76ce/FactoryServer
-* - factoryName = COMPONENTEngine_factory
-* - component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT
-* - instanceName = COMPONENT_inst_1
-* - component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
-*/
-//=============================================================================
-
-Engines::Component_ptr
-Engines_Container_i::find_or_create_instance(std::string genericRegisterName,
- std::string componentLibraryName)
-{
- string aGenRegisterName = genericRegisterName;
- string impl_name = componentLibraryName;
- if (_library_map.count(impl_name) == 0)
- {
- INFOS("shared library " << impl_name <<" must be loaded before creating instance");
- return Engines::Component::_nil() ;
- }
- else
- {
- // --- find a registered instance in naming service, or create
- void* handle = _library_map[impl_name];
- string component_registerBase =
- _containerName + "/" + aGenRegisterName;
- Engines::Component_var iobject = Engines::Component::_nil() ;
- try
- {
- CORBA::Object_var obj =
- _NS->ResolveFirst( component_registerBase.c_str());
- if ( CORBA::is_nil( obj ) )
- {
- iobject = createInstance(genericRegisterName,
- handle,
- 0); // force multiStudy instance here !
- }
- else
- {
- iobject = Engines::Component::_narrow( obj ) ;
- Engines_Component_i *servant =
- dynamic_cast<Engines_Component_i*>
- (_poa->reference_to_servant(iobject));
- ASSERT(servant)
- int studyId = servant->getStudyId();
- ASSERT (studyId >= 0);
- if (studyId == 0) // multiStudy instance, OK
- {
- // No ReBind !
- MESSAGE(component_registerBase.c_str()<<" already bound");
- }
- else // monoStudy instance: NOK
- {
- iobject = Engines::Component::_nil();
- INFOS("load_impl & find_component_instance methods "
- << "NOT SUITABLE for mono study components");
- }
- }
- }
- catch (...)
+ char aNumI[12];
+ sprintf( aNumI , "%d" , numInstance ) ;
+ std::string instanceName = CompName + "_inst_" + aNumI ;
+ std::string component_registerName = _containerName + "/" + instanceName;
+
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject *result = PyObject_CallMethod(_pyCont,
+ (char*)"create_component_instance",
+ (char*)"ssl",
+ CompName.c_str(),
+ instanceName.c_str(),
+ studyId);
+ const char *ior;
+ const char *error;
+ PyArg_ParseTuple(result,"ss", &ior, &error);
+ std::string iors = ior;
+ reason=error;
+ Py_DECREF(result);
+ PyGILState_Release(gstate);
+
+ if( iors!="" )
{
- INFOS( "Container_i::load_impl catched" ) ;
+ CORBA::Object_var obj = _orb->string_to_object(iors.c_str());
+ iobject = Engines::Component::_narrow( obj ) ;
+ _listInstances_map[instanceName] = iobject;
}
- return iobject._retn();
- }
+ return iobject._retn();
}
//=============================================================================
-//! Create a new component instance
+//! Create a new component instance (C++ implementation)
/*!
* C++ method: create a servant instance of a component.
* \param genericRegisterName Name of the component instance to register
* \param handle loaded library handle
* \param studyId 0 for multiStudy instance,
* study Id (>0) otherwise
+* \param reason explains error when creation fails
* \return a loaded component
*
* example with names:
* - component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
*/
//=============================================================================
-
Engines::Component_ptr
Engines_Container_i::createInstance(std::string genericRegisterName,
void *handle,
- int studyId)
+ int studyId,
+ std::string& reason)
{
// --- find the factory
- string aGenRegisterName = genericRegisterName;
- string factory_name = aGenRegisterName + string("Engine_factory");
+ std::string aGenRegisterName = genericRegisterName;
+ std::string factory_name = aGenRegisterName + std::string("Engine_factory");
SCRUTE(factory_name) ;
- typedef PortableServer::ObjectId * (*FACTORY_FUNCTION)
- (CORBA::ORB_ptr,
- PortableServer::POA_ptr,
- PortableServer::ObjectId *,
- const char *,
- const char *) ;
+ typedef PortableServer::ObjectId* (*FACTORY_FUNCTION) (CORBA::ORB_ptr,
+ PortableServer::POA_ptr,
+ PortableServer::ObjectId *,
+ const char *,
+ const char *) ;
#ifndef WIN32
FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION)dlsym( handle, factory_name.c_str() );
{
INFOS( "Can't resolve symbol: " + factory_name );
#ifndef WIN32
- SCRUTE( dlerror() );
+ reason=dlerror();
+ INFOS(reason);
#endif
return Engines::Component::_nil() ;
}
char aNumI[12];
sprintf( aNumI , "%d" , numInstance ) ;
- string instanceName = aGenRegisterName + "_inst_" + aNumI ;
- string component_registerName =
+ std::string instanceName = aGenRegisterName + "_inst_" + aNumI ;
+ std::string component_registerName =
_containerName + "/" + instanceName;
// --- Instanciate required CORBA object
PortableServer::ObjectId *id ; //not owner, do not delete (nore use var)
id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str(),
- aGenRegisterName.c_str() ) ;
+ aGenRegisterName.c_str() ) ;
if (id == NULL)
- return iobject._retn();
+ {
+ reason="Can't get ObjectId from factory";
+ INFOS(reason);
+ return iobject._retn();
+ }
// --- get reference & servant from id
}
catch (...)
{
- INFOS( "Container_i::createInstance exception catched" ) ;
+ reason="Container_i::createInstance exception catched";
+ INFOS(reason) ;
+ }
+ return iobject._retn();
+}
+
+//=============================================================================
+//! Find an existing (in the container) component instance
+/*!
+* CORBA method: Finds a servant instance of a component
+* \param registeredName Name of the component in Registry or Name Service,
+* without instance suffix number
+* \param studyId 0 if instance is not associated to a study,
+* >0 otherwise (== study id)
+* \return the first instance found with same studyId
+*/
+//=============================================================================
+Engines::Component_ptr
+Engines_Container_i::find_component_instance( const char* registeredName,
+ CORBA::Long studyId)
+{
+ Engines::Component_var anEngine = Engines::Component::_nil();
+ std::map<std::string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
+ while (itm != _listInstances_map.end())
+ {
+ std::string instance = (*itm).first;
+ SCRUTE(instance);
+ if (instance.find(registeredName) == 0)
+ {
+ anEngine = (*itm).second;
+ if (studyId == anEngine->getStudyId())
+ {
+ return anEngine._retn();
+ }
+ }
+ itm++;
+ }
+ return anEngine._retn();
+}
+
+//=============================================================================
+//! Remove the component instance from container
+/*!
+* CORBA method: Stops the component servant, and deletes all related objects
+* \param component_i Component to be removed
+*/
+//=============================================================================
+
+void Engines_Container_i::remove_impl(Engines::Component_ptr component_i)
+{
+ ASSERT(! CORBA::is_nil(component_i));
+ std::string instanceName = component_i->instanceName() ;
+ MESSAGE("unload component " << instanceName);
+ _numInstanceMutex.lock() ; // lock to be alone (stl container write)
+ _listInstances_map.erase(instanceName);
+ _numInstanceMutex.unlock() ;
+ component_i->destroy() ;
+ _NS->Destroy_Name(instanceName.c_str());
+}
+
+//=============================================================================
+//! Unload component libraries from the container
+/*!
+* CORBA method: Discharges unused libraries from the container.
+*/
+//=============================================================================
+void Engines_Container_i::finalize_removal()
+{
+ MESSAGE("finalize unload : dlclose");
+ _numInstanceMutex.lock(); // lock to be alone
+ // (see decInstanceCnt, load_component_Library)
+ std::map<std::string, void *>::iterator ith;
+ for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++)
+ {
+ void *handle = (*ith).second;
+ std::string impl_name= (*ith).first;
+ if (handle)
+ {
+ SCRUTE(handle);
+ SCRUTE(impl_name);
+ // dlclose(handle); // SALOME unstable after ...
+ // _library_map.erase(impl_name);
+ }
}
- return iobject._retn();
+ _toRemove_map.clear();
+ _numInstanceMutex.unlock();
}
//=============================================================================
//! Decrement component instance reference count
-/*!
+/*!
*
*/
//=============================================================================
-
void Engines_Container_i::decInstanceCnt(std::string genericRegisterName)
{
if(_cntInstances_map.count(genericRegisterName)==0)
return;
- string aGenRegisterName =genericRegisterName;
+ std::string aGenRegisterName =genericRegisterName;
MESSAGE("Engines_Container_i::decInstanceCnt " << aGenRegisterName);
- ASSERT(_cntInstances_map[aGenRegisterName] > 0);
+ ASSERT(_cntInstances_map[aGenRegisterName] > 0);
_numInstanceMutex.lock(); // lock to be alone
// (see finalize_removal, load_component_Library)
_cntInstances_map[aGenRegisterName] -= 1;
SCRUTE(_cntInstances_map[aGenRegisterName]);
if (_cntInstances_map[aGenRegisterName] == 0)
{
- string impl_name =
+ std::string impl_name =
Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str());
SCRUTE(impl_name);
void* handle = _library_map[impl_name];
_numInstanceMutex.unlock();
}
+//=============================================================================
+//! Find or create a new component instance
+/*!
+* CORBA method: find or create an instance of the component (servant),
+* load a new component class (dynamic library) if required,
+*
+* ---- FOR COMPATIBILITY WITH 2.2 ----
+*
+* ---- USE ONLY FOR MULTISTUDY INSTANCES ! --------
+*
+* The servant registers itself to naming service and Registry.
+* \param genericRegisterName Name of the component to register
+* in Registry & Name Service
+* \param componentName Name of the constructed library of the component
+* \return a loaded component
+*/
+//=============================================================================
+
+Engines::Component_ptr
+Engines_Container_i::load_impl( const char* genericRegisterName,
+ const char* componentName )
+{
+ char* reason;
+ std::string impl_name = std::string(LIB) + genericRegisterName + ENGINESO;
+ Engines::Component_var iobject = Engines::Component::_nil() ;
+ if (load_component_Library(genericRegisterName,reason))
+ iobject = find_or_create_instance(genericRegisterName, impl_name);
+ CORBA::string_free(reason);
+ return iobject._retn();
+}
+
+//=============================================================================
+//! Finds an already existing component instance or create a new instance
+/*!
+* C++ method: Finds an already existing servant instance of a component, or
+* create an instance.
+* ---- USE ONLY FOR MULTISTUDY INSTANCES ! --------
+* \param genericRegisterName Name of the component instance to register
+* in Registry & Name Service,
+* (without _inst_n suffix, like "COMPONENT")
+* \param componentLibraryName like "libCOMPONENTEngine.so"
+* \return a loaded component
+*
+* example with names:
+* - aGenRegisterName = COMPONENT (= first argument)
+* - impl_name = libCOMPONENTEngine.so (= second argument)
+* - _containerName = /Containers/cli76ce/FactoryServer
+* - factoryName = COMPONENTEngine_factory
+* - component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT
+* - instanceName = COMPONENT_inst_1
+* - component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
+*/
+//=============================================================================
+
+Engines::Component_ptr
+Engines_Container_i::find_or_create_instance(std::string genericRegisterName,
+ std::string componentLibraryName)
+{
+ std::string aGenRegisterName = genericRegisterName;
+ std::string impl_name = componentLibraryName;
+ if (_library_map.count(impl_name) == 0)
+ {
+ INFOS("shared library " << impl_name <<" must be loaded before creating instance");
+ return Engines::Component::_nil() ;
+ }
+ else
+ {
+ // --- find a registered instance in naming service, or create
+
+ void* handle = _library_map[impl_name];
+ std::string component_registerBase =
+ _containerName + "/" + aGenRegisterName;
+ Engines::Component_var iobject = Engines::Component::_nil() ;
+ std::string reason;
+ try
+ {
+ CORBA::Object_var obj =
+ _NS->ResolveFirst( component_registerBase.c_str());
+ if ( CORBA::is_nil( obj ) )
+ {
+ iobject = createInstance(genericRegisterName,
+ handle,
+ 0,
+ reason); // force multiStudy instance here !
+ }
+ else
+ {
+ iobject = Engines::Component::_narrow( obj ) ;
+ Engines_Component_i *servant =
+ dynamic_cast<Engines_Component_i*>
+ (_poa->reference_to_servant(iobject));
+ ASSERT(servant)
+ int studyId = servant->getStudyId();
+ ASSERT (studyId >= 0);
+ if (studyId == 0) // multiStudy instance, OK
+ {
+ // No ReBind !
+ MESSAGE(component_registerBase.c_str()<<" already bound");
+ }
+ else // monoStudy instance: NOK
+ {
+ iobject = Engines::Component::_nil();
+ INFOS("load_impl & find_component_instance methods "
+ << "NOT SUITABLE for mono study components");
+ }
+ }
+ }
+ catch (...)
+ {
+ INFOS( "Container_i::load_impl catched" ) ;
+ }
+ return iobject._retn();
+ }
+}
+
//=============================================================================
//! Indicate if container is a python one
/*!
* Retrieves only with container naming convention if it is a python container
*/
//=============================================================================
-
bool Engines_Container_i::isPythonContainer(const char* ContainerName)
{
bool ret=false;
return ret;
}
+//=============================================================================
+//! Kill the container
+/*!
+* CORBA method: Kill the container process with exit(0).
+* To remove : never returns !
+*/
+//=============================================================================
+bool Engines_Container_i::Kill_impl()
+{
+ MESSAGE("Engines_Container_i::Kill() pid "<< getpid() << " containerName "
+ << _containerName.c_str() << " machineName "
+ << Kernel_Utils::GetHostname().c_str());
+ INFOS("===============================================================");
+ INFOS("= REMOVE calls to Kill_impl in C++ container =");
+ INFOS("===============================================================");
+ //_exit( 0 ) ;
+ ASSERT(0);
+ return false;
+}
+
//=============================================================================
/*!
*
*/
//=============================================================================
-
void ActSigIntHandler()
{
#ifndef WIN32
// A stream operation may be interrupted by a signal and if the Handler use stream we
// may have a "Dead-Lock" ===HangUp
//==MESSAGE is commented
- // MESSAGE(pthread_self() << "SigIntHandler what " << what << endl
- // << " si_signo " << siginfo->si_signo << endl
- // << " si_code " << siginfo->si_code << endl
+ // MESSAGE(pthread_self() << "SigIntHandler what " << what << std::endl
+ // << " si_signo " << siginfo->si_signo << std::endl
+ // << " si_code " << siginfo->si_code << std::endl
// << " si_pid " << siginfo->si_pid) ;
if ( _Sleeping )
void SigIntHandler( int what )
{
#ifndef WIN32
- MESSAGE( pthread_self() << "SigIntHandler what " << what << endl );
+ MESSAGE( pthread_self() << "SigIntHandler what " << what << std::endl );
#else
- MESSAGE( "SigIntHandler what " << what << endl );
+ MESSAGE( "SigIntHandler what " << what << std::endl );
#endif
if ( _Sleeping )
{
}
#endif
+//=============================================================================
+//! Get or create a file reference object associated to a local file (to transfer it)
+/*!
+* CORBA method: get or create a fileRef object associated to a local file
+* (a file on the computer on which runs the container server), which stores
+* a list of (machine, localFileName) corresponding to copies already done.
+*
+* \param origFileName absolute path for a local file to copy on other
+* computers
+* \return a fileRef object associated to the file.
+*/
+//=============================================================================
+Engines::fileRef_ptr
+Engines_Container_i::createFileRef(const char* origFileName)
+{
+ std::string origName(origFileName);
+ Engines::fileRef_var theFileRef = Engines::fileRef::_nil();
+
+ if (origName[0] != '/')
+ {
+ INFOS("path of file to copy must be an absolute path begining with '/'");
+ return Engines::fileRef::_nil();
+ }
+
+ if (CORBA::is_nil(_fileRef_map[origName]))
+ {
+ CORBA::Object_var obj=_poa->id_to_reference(*_id);
+ Engines::Container_var pCont = Engines::Container::_narrow(obj);
+ fileRef_i* aFileRef = new fileRef_i(pCont, origFileName);
+ theFileRef = Engines::fileRef::_narrow(aFileRef->_this());
+ _numInstanceMutex.lock() ; // lock to be alone (stl container write)
+ _fileRef_map[origName] = theFileRef;
+ _numInstanceMutex.unlock() ;
+ }
+
+ theFileRef = Engines::fileRef::_duplicate(_fileRef_map[origName]);
+ ASSERT(! CORBA::is_nil(theFileRef));
+ return theFileRef._retn();
+}
+
+//=============================================================================
+//! Get a fileTransfer reference
+/*!
+* CORBA method:
+* \return a reference to the fileTransfer object
+*/
+//=============================================================================
+Engines::fileTransfer_ptr
+Engines_Container_i::getFileTransfer()
+{
+ Engines::fileTransfer_var aFileTransfer
+ = Engines::fileTransfer::_duplicate(_fileTransfer);
+ return aFileTransfer._retn();
+}
+
+//=============================================================================
+//! Create a Salome file
+//=============================================================================
+Engines::Salome_file_ptr
+Engines_Container_i::createSalome_file(const char* origFileName)
+{
+ std::string origName(origFileName);
+ if (CORBA::is_nil(_Salome_file_map[origName]))
+ {
+ Salome_file_i* aSalome_file = new Salome_file_i();
+ aSalome_file->setContainer(Engines::Container::_duplicate(this->_this()));
+ try
+ {
+ aSalome_file->setLocalFile(origFileName);
+ aSalome_file->recvFiles();
+ }
+ catch (const SALOME::SALOME_Exception& e)
+ {
+ return Engines::Salome_file::_nil();
+ }
+
+ Engines::Salome_file_var theSalome_file = Engines::Salome_file::_nil();
+ theSalome_file = Engines::Salome_file::_narrow(aSalome_file->_this());
+ _numInstanceMutex.lock() ; // lock to be alone (stl container write)
+ _Salome_file_map[origName] = theSalome_file;
+ _numInstanceMutex.unlock() ;
+ }
+
+ Engines::Salome_file_ptr theSalome_file =
+ Engines::Salome_file::_duplicate(_Salome_file_map[origName]);
+ ASSERT(!CORBA::is_nil(theSalome_file));
+ return theSalome_file;
+}
+
+//=============================================================================
/*! \brief copy a file from a remote host (container) to the local host
* \param container the remote container
* \param remoteFile the file to copy locally from the remote host into localFile
* \param localFile the local file
*/
+//=============================================================================
void Engines_Container_i::copyFile(Engines::Container_ptr container, const char* remoteFile, const char* localFile)
{
Engines::fileTransfer_var fileTransfer = container->getFileTransfer();
}
}
+//=============================================================================
/*! \brief create a PyNode object to execute remote python code
* \param nodeName the name of the node
* \param code the python code to load
* \return the PyNode
*/
+//=============================================================================
Engines::PyNode_ptr Engines_Container_i::createPyNode(const char* nodeName, const char* code)
{
Engines::PyNode_var node= Engines::PyNode::_nil();
}
}
+
+//=============================================================================
+/* int checkifexecutable(const char *filename)
+*
+* Return non-zero if the name is an executable file, and
+* zero if it is not executable, or if it does not exist.
+*/
+//=============================================================================
+int checkifexecutable(const std::string& filename)
+{
+ int result;
+ struct stat statinfo;
+
+ result = stat(filename.c_str(), &statinfo);
+ if (result < 0) return 0;
+ if (!S_ISREG(statinfo.st_mode)) return 0;
+
+#ifdef WIN32
+ return 1;
+#else
+ if (statinfo.st_uid == geteuid()) return statinfo.st_mode & S_IXUSR;
+ if (statinfo.st_gid == getegid()) return statinfo.st_mode & S_IXGRP;
+ return statinfo.st_mode & S_IXOTH;
+#endif
+}
+
+
+//=============================================================================
+/*! \brief Find a file by searching in a path
+ * \param filename file name to search
+ * \param path path to search in
+ * \param pth the complete file path if found
+ * \return 1 if found 0 if not
+*/
+//=============================================================================
+int findpathof(const std::string& path, std::string& pth, const std::string& filename)
+{
+ if ( path.size() == 0 ) return 0;
+
+ std::string::size_type offset = 0;
+ std::string::size_type pos = 0;
+ int found = 0;
+ struct stat statinfo;
+
+ while(!found)
+ {
+ pos = path.find( SEP, offset );
+ pth = path.substr( offset, pos - offset );
+ if ( pth.size() > 0 )
+ {
+ if( pth[pth.size()-1] != SLASH ) pth += SLASH;
+ pth += filename;
+ int result=stat(pth.c_str(), &statinfo);
+ if(result == 0) found=1;
+ }
+ if (pos == std::string::npos) break;
+ offset = pos+1;
+ }
+ return found;
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : Container_init_python.cxx
// Author : Paul RASCLE, EDF
#include "Container_init_python.hxx"
-using namespace std;
-
PyThreadState *KERNEL_PYTHON::_gtstate = 0;
PyObject *KERNEL_PYTHON::salome_shared_modules_module = NULL;
PyInterpreterState *KERNEL_PYTHON::_interp = NULL;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : Container_init_python.hxx
// Author : Paul RASCLE, EDF
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Container : implementation of container and engine for Kernel
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Container : implementation of container and engine for Kernel
# File : SALOME_ComponentPy.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# $Header$
-#
+
## @package SALOME_ComponentPy
# \brief python implementation of component interface for Kernel
#
-#
import os
import sys
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : SALOME_Component_i.hxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
// Module : SALOME
// $Header$
-
+//
#ifndef _SALOME_COMPONENT_I_HXX_
#define _SALOME_COMPONENT_I_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : SALOME_Container.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
#include "Container_init_python.hxx"
-using namespace std;
-
extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB);
#include <stdexcept>
# include <sys/wait.h>
#endif
+void AttachDebugger();
+void Handler(int);
+void terminateHandler();
+void unexpectedHandler();
+
#ifndef WIN32
+void (* setsig(int, void (*)(int)))(int);
+
typedef void (*sighandler_t)(int);
sighandler_t setsig(int sig, sighandler_t handler)
{
std::cerr << "SIGSEGV: " << std::endl;
AttachDebugger();
//to exit or not to exit
- exit(1);
+ _exit(1);
}
void terminateHandler(void)
if(getenv ("DEBUGGER"))
{
setsig(SIGSEGV,&Handler);
- set_terminate(&terminateHandler);
- set_unexpected(&unexpectedHandler);
+ std::set_terminate(&terminateHandler);
+ std::set_unexpected(&unexpectedHandler);
}
#endif
ASSERT(argc > 1);
SCRUTE(argv[1]);
- bool isSupervContainer = false;
- if (strcmp(argv[1],"SuperVisionContainer") == 0) isSupervContainer = true;
- if (!isSupervContainer)
- {
- // int _argc = 1;
- // char* _argv[] = {""};
- KERNEL_PYTHON::init_python(argc,argv);
- }
- else
- {
- Py_Initialize() ;
- PySys_SetArgv( argc , argv ) ;
- }
+ KERNEL_PYTHON::init_python(argc,argv);
char *containerName = (char *)"";
if(argc > 1)
// add new container to the kill list
#ifndef WIN32
- stringstream aCommand ;
- aCommand << "addToKillList.py " << getpid() << " SALOME_Container" << ends ;
+ std::stringstream aCommand ;
+ aCommand << "addToKillList.py " << getpid() << " SALOME_Container" << std::ends ;
system(aCommand.str().c_str());
#endif
HandleServerSideSignals(orb);
- if (!isSupervContainer)
- {
+//#define MEMORYLEAKS
+#ifdef MEMORYLEAKS
PyGILState_Ensure();
//Destroy orb from python (for chasing memory leaks)
- //PyRun_SimpleString("from omniORB import CORBA");
- //PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
- //PyRun_SimpleString("orb.destroy()");
+ PyRun_SimpleString("from omniORB import CORBA");
+ PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
+ PyRun_SimpleString("orb.destroy()");
Py_Finalize();
- }
- else
- {
- orb->destroy();
- }
+#endif
}
catch(CORBA::SystemException&)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Container.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Container : implementation of container and engine for Kernel
# File : SALOME_Container.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# $Header$
-#
+
## @package SALOME_Container
# \brief python implementation of container interface for Kernel
#
-#
import os
import sys
import string
import traceback
+import imp
from omniORB import CORBA, PortableServer
-import SALOMEDS
+import SALOMEDS
import Engines, Engines__POA
from SALOME_NamingServicePy import *
from SALOME_ComponentPy import *
if verbose(): print "try import ",componentName
__import__(componentName)
if verbose(): print "import ",componentName," successful"
+ except ImportError,e:
+ #can't import python module componentName
+ #try to find it in python path
+ try:
+ fp, pathname, description = imp.find_module(componentName)
+ if fp:fp.close()
+ #module file found in path
+ ret="Component "+componentName+": Python implementation found but it can't be loaded\n"
+ ret=ret+traceback.format_exc(10)
+ except ImportError,ee:
+ ret="ImplementationNotFound"
+ except:
+ if verbose():print "error when calling find_module"
+ ret="ImplementationNotFound"
except:
- import traceback
- ret=traceback.format_exc(10)
+ ret="Component "+componentName+": Python implementation found but it can't be loaded\n"
+ ret=ret+traceback.format_exc(10)
if verbose():
traceback.print_exc()
print "import ",componentName," not possible"
def create_component_instance(self, componentName, instanceName, studyId):
MESSAGE( "SALOME_Container_i::create_component_instance" )
comp_iors=""
+ ret=""
try:
component=__import__(componentName)
factory=getattr(component,componentName)
comp_o = comp_i._this()
comp_iors = self._orb.object_to_string(comp_o)
except:
- import traceback
+ ret=traceback.format_exc(10)
traceback.print_exc()
MESSAGE( "SALOME_Container_i::create_component_instance : NOT OK")
- return comp_iors
+ return comp_iors, ret
def create_pynode(self,nodeName,code):
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_ContainerManager.hxx"
#include "SALOME_NamingService.hxx"
#include "SALOME_ModuleCatalog.hh"
#include "Utils_CorbaException.hxx"
#include <sstream>
+#ifdef WNT
+#include <process.h>
+#define getpid _getpid
+#endif
+
#ifdef WITH_PACO_PARALLEL
#include "PaCOPP.hxx"
#endif
#define TIME_OUT_TO_LAUNCH_CONT 61
-using namespace std;
-
const char *SALOME_ContainerManager::_ContainerManagerNameInNS =
"/ContainerManager";
#ifdef WITHOPENMPI
if( getenv("OMPI_URI_FILE") != NULL ){
system("killall ompi-server");
- string command;
+ std::string command;
command = "ompi-server -r ";
command += getenv("OMPI_URI_FILE");
int status=system(command.c_str());
bool isOK;
isOK = _NS->Change_Directory("/Containers");
if( isOK ){
- vector<string> vec = _NS->list_directory_recurs();
- list<string> lstCont;
- for(vector<string>::iterator iter = vec.begin();iter!=vec.end();iter++)
+ std::vector<std::string> vec = _NS->list_directory_recurs();
+ std::list<std::string> lstCont;
+ for(std::vector<std::string>::iterator iter = vec.begin();iter!=vec.end();iter++)
{
SCRUTE((*iter));
CORBA::Object_var obj=_NS->Resolve((*iter).c_str());
}
}
MESSAGE("Container list: ");
- for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
+ for(std::list<std::string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
SCRUTE((*iter));
}
- for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++)
+ for(std::list<std::string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++)
{
try
{
Engines::Container_ptr
SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& params)
{
- string machFile;
+ std::string machFile;
Engines::Container_ptr ret = Engines::Container::_nil();
// Step 0: Default mode is start
{
if (mode == "find")
{
- MESSAGE("[GiveContainer] no container found");
- return ret;
+ MESSAGE("[GiveContainer] no container found");
+ return ret;
}
else
{
- mode = "start";
+ mode = "start";
}
}
}
Engines::Container_ptr cont = FindContainer(params, possibleResources[i].in());
try
{
- if(!cont->_non_existent())
- local_resources.push_back(string(possibleResources[i]));
+ if(!cont->_non_existent())
+ local_resources.push_back(std::string(possibleResources[i]));
}
catch(CORBA::Exception&) {}
}
}
else
for(unsigned int i=0; i < possibleResources->length(); i++)
- local_resources.push_back(string(possibleResources[i]));
+ local_resources.push_back(std::string(possibleResources[i]));
// Step 4: select the resource where to get/start the container
std::string resource_selected;
Engines::Container_var cont=Engines::Container::_narrow(obj);
if(!cont->_non_existent())
{
- if(std::string(params.mode.in())=="getorstart" || std::string(params.mode.in())=="get"){
- return cont._retn(); /* the container exists and params.mode is getorstart or get use it*/
- }
- else
- {
- INFOS("[GiveContainer] A container is already registered with the name: " << containerNameInNS << ", shutdown the existing container");
- cont->Shutdown(); // shutdown the registered container if it exists
- }
+ if(std::string(params.mode.in())=="getorstart" || std::string(params.mode.in())=="get"){
+ return cont._retn(); /* the container exists and params.mode is getorstart or get use it*/
+ }
+ else
+ {
+ INFOS("[GiveContainer] A container is already registered with the name: " << containerNameInNS << ", shutdown the existing container");
+ cont->Shutdown(); // shutdown the registered container if it exists
+ }
}
}
catch(CORBA::Exception&)
SALOME_ModuleCatalog::Acomponent_var compoInfo = Catalog->GetComponent(compoi);
if (CORBA::is_nil (compoInfo))
{
- continue;
+ continue;
}
SALOME_ModuleCatalog::ImplType impl=compoInfo->implementation_type();
container_exe_tmp=compoInfo->implementation_name();
if(impl==SALOME_ModuleCatalog::CEXE)
{
- if(found)
- {
- INFOS("ContainerManager Error: you can't have 2 CEXE component in the same container" );
- return Engines::Container::_nil();
- }
- MESSAGE("[GiveContainer] Exe container found !: " << container_exe_tmp);
- container_exe = container_exe_tmp.in();
- found=1;
+ if(found)
+ {
+ INFOS("ContainerManager Error: you can't have 2 CEXE component in the same container" );
+ return Engines::Container::_nil();
+ }
+ MESSAGE("[GiveContainer] Exe container found !: " << container_exe_tmp);
+ container_exe = container_exe_tmp.in();
+ found=1;
}
}
}
//redirect stdout and stderr in a file
#ifdef WNT
- string logFilename=getenv("TEMP");
+ std::string logFilename=getenv("TEMP");
logFilename += "\\";
#else
- string logFilename="/tmp";
+ std::string logFilename="/tmp";
char* val = getenv("SALOME_TMP_DIR");
if(val)
{
}
logFilename += "/";
#endif
- logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" )+".log" ;
+ logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" ) ;
+#ifdef WNT
+ std::ostringstream tmp;
+ tmp << "_" << getpid();
+ logFilename += tmp.str();
+#endif
+ logFilename += ".log" ;
command += " > " + logFilename + " 2>&1";
#ifdef WNT
command = "%PYTHONBIN% -c \"import win32pm ; win32pm.spawnpid(r'" + command + "', '')\"";
}
}
+
+bool isPythonContainer(const char* ContainerName);
+
//=============================================================================
/*!
* This is no longer valid (C++ container are also python containers)
*/
//=============================================================================
-string
+std::string
SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer
-(const string& resource_name,
+(const std::string& resource_name,
const Engines::ContainerParameters& params, const std::string& container_exe)
{
- string command;
+ std::string command;
if (!_isAppliSalomeDefined)
command = BuildTempFileToLaunchRemoteContainer(resource_name, params);
else
if (params.isMPI)
{
if ((params.resource_params.nb_node <= 0) && (params.resource_params.nb_proc_per_node <= 0))
- nbproc = 1;
+ nbproc = 1;
else if (params.resource_params.nb_node == 0)
- nbproc = params.resource_params.nb_proc_per_node;
+ nbproc = params.resource_params.nb_proc_per_node;
else if (params.resource_params.nb_proc_per_node == 0)
- nbproc = params.resource_params.nb_node;
+ nbproc = params.resource_params.nb_node;
else
- nbproc = params.resource_params.nb_node * params.resource_params.nb_proc_per_node;
+ nbproc = params.resource_params.nb_node * params.resource_params.nb_proc_per_node;
}
// "ssh -l user machine distantPath/runRemote.sh hostNS portNS WORKINGDIR workingdir \
command += " WORKINGDIR ";
command += " '";
if(wdir == "$TEMPDIR")
- wdir="\\$TEMPDIR";
+ wdir="\\$TEMPDIR";
command += wdir; // requested working directory
command += "'";
}
command += "-x PATH,LD_LIBRARY_PATH,OMNIORB_CONFIG,SALOME_trace ";
#elif defined(WITHOPENMPI)
if( getenv("OMPI_URI_FILE") == NULL )
- command += "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace";
+ command += "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace";
else{
- command += "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace -ompi-server file:";
- command += getenv("OMPI_URI_FILE");
+ command += "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace -ompi-server file:";
+ command += getenv("OMPI_URI_FILE");
}
#endif
command += " SALOME_MPIContainer ";
* builds the command to be launched.
*/
//=============================================================================
-string
+std::string
SALOME_ContainerManager::BuildCommandToLaunchLocalContainer
(const Engines::ContainerParameters& params, const std::string& machinesFile, const std::string& container_exe)
{
_TmpFileName = BuildTemporaryFileName();
- string command;
+ std::string command;
int nbproc = 0;
- ostringstream o;
+ std::ostringstream o;
if (params.isMPI)
{
o << nbproc << " ";
if( getenv("LIBBATCH_NODEFILE") != NULL )
- o << "-machinefile " << machinesFile << " ";
+ o << "-machinefile " << machinesFile << " ";
#ifdef WITHLAM
o << "-x PATH,LD_LIBRARY_PATH,OMNIORB_CONFIG,SALOME_trace ";
if(wdir == "$TEMPDIR")
{
// a new temporary directory is requested
- string dir = Kernel_Utils::GetTmpDir();
+ std::string dir = Kernel_Utils::GetTmpDir();
#ifdef WIN32
- o << "cd /d " << dir << endl;
+ o << "cd /d " << dir << std::endl;
#else
o << "cd " << dir << ";";
#endif
{
// a permanent directory is requested use it or create it
#ifdef WIN32
- o << "mkdir " + wdir << endl;
- o << "cd /D " + wdir << endl;
+ o << "mkdir " + wdir << std::endl;
+ o << "cd /D " + wdir << std::endl;
#else
o << "mkdir -p " << wdir << " && cd " << wdir + ";";
#endif
o << " -";
AddOmninamesParams(o);
- ofstream command_file( _TmpFileName.c_str() );
+ std::ofstream command_file( _TmpFileName.c_str() );
command_file << o.str();
command_file.close();
if ( lenght > 0)
{
#ifdef WIN32
- string command = "del /F ";
+ std::string command = "del /F ";
#else
- string command = "rm ";
+ std::string command = "rm ";
#endif
if ( lenght > 4 )
command += tmpFileName.substr(0, lenght - 3 );
command += '*';
system(command.c_str());
//if dir is empty - remove it
- string tmp_dir = Kernel_Utils::GetDirByPath( tmpFileName );
+ std::string tmp_dir = Kernel_Utils::GetDirByPath( tmpFileName );
if ( Kernel_Utils::IsEmptyDir( tmp_dir ) )
{
#ifdef WIN32
*/
//=============================================================================
-void SALOME_ContainerManager::AddOmninamesParams(string& command) const
+void SALOME_ContainerManager::AddOmninamesParams(std::string& command) const
{
CORBA::String_var iorstr = _NS->getIORaddr();
command += "ORBInitRef NameService=";
*/
//=============================================================================
-void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const
+void SALOME_ContainerManager::AddOmninamesParams(std::ofstream& fileStream) const
{
CORBA::String_var iorstr = _NS->getIORaddr();
fileStream << "ORBInitRef NameService=";
*/
//=============================================================================
-void SALOME_ContainerManager::AddOmninamesParams(ostringstream& oss) const
+void SALOME_ContainerManager::AddOmninamesParams(std::ostringstream& oss) const
{
CORBA::String_var iorstr = _NS->getIORaddr();
oss << "ORBInitRef NameService=";
*/
//=============================================================================
-string SALOME_ContainerManager::BuildTemporaryFileName() const
+std::string SALOME_ContainerManager::BuildTemporaryFileName() const
{
//build more complex file name to support multiple salome session
- string aFileName = Kernel_Utils::GetTmpFileName();
+ std::string aFileName = Kernel_Utils::GetTmpFileName();
#ifndef WIN32
aFileName += ".sh";
#else
*/
//=============================================================================
-string
+std::string
SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer
-(const string& resource_name,
+(const std::string& resource_name,
const Engines::ContainerParameters& params) throw(SALOME_Exception)
{
int status;
_TmpFileName = BuildTemporaryFileName();
- ofstream tempOutputFile;
- tempOutputFile.open(_TmpFileName.c_str(), ofstream::out );
+ std::ofstream tempOutputFile;
+ tempOutputFile.open(_TmpFileName.c_str(), std::ofstream::out );
const ParserResourcesType& resInfo = _ResManager->GetImpl()->GetResourcesDescr(resource_name);
- tempOutputFile << "#! /bin/sh" << endl;
+ tempOutputFile << "#! /bin/sh" << std::endl;
// --- set env vars
- tempOutputFile << "export SALOME_trace=local" << endl; // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace"
+ tempOutputFile << "export SALOME_trace=local" << std::endl; // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace"
//tempOutputFile << "source " << resInfo.PreReqFilePath << endl;
// ! env vars
tempOutputFile << _NS->ContainerName(params) << " -";
AddOmninamesParams(tempOutputFile);
- tempOutputFile << " &" << endl;
+ tempOutputFile << " &" << std::endl;
tempOutputFile.flush();
tempOutputFile.close();
#ifndef WIN32
// --- Build command
- string command;
+ std::string command;
if (resInfo.Protocol == rsh)
{
command = "rsh ";
- string commandRcp = "rcp ";
+ std::string commandRcp = "rcp ";
commandRcp += _TmpFileName;
commandRcp += " ";
commandRcp += resInfo.HostName;
else if (resInfo.Protocol == ssh)
{
command = "ssh ";
- string commandRcp = "scp ";
+ std::string commandRcp = "scp ";
commandRcp += _TmpFileName;
commandRcp += " ";
commandRcp += resInfo.HostName;
}
-string SALOME_ContainerManager::GetMPIZeroNode(const string machine, const string machinesFile)
+std::string SALOME_ContainerManager::GetMPIZeroNode(const std::string machine, const std::string machinesFile)
{
int status;
- string zeronode;
- string command;
- string tmpFile = BuildTemporaryFileName();
+ std::string zeronode;
+ std::string command;
+ std::string tmpFile = BuildTemporaryFileName();
if( getenv("LIBBATCH_NODEFILE") == NULL )
{
status = system(command.c_str());
if( status == 0 ){
- ifstream fp(tmpFile.c_str(),ios::in);
+ std::ifstream fp(tmpFile.c_str(),std::ios::in);
fp >> zeronode;
}
return zeronode;
}
-string SALOME_ContainerManager::machinesFile(const int nbproc)
+std::string SALOME_ContainerManager::machinesFile(const int nbproc)
{
- string tmp;
- string nodesFile = getenv("LIBBATCH_NODEFILE");
- string machinesFile = Kernel_Utils::GetTmpFileName();
- ifstream fpi(nodesFile.c_str(),ios::in);
- ofstream fpo(machinesFile.c_str(),ios::out);
+ std::string tmp;
+ std::string nodesFile = getenv("LIBBATCH_NODEFILE");
+ std::string machinesFile = Kernel_Utils::GetTmpFileName();
+ std::ifstream fpi(nodesFile.c_str(),std::ios::in);
+ std::ofstream fpo(machinesFile.c_str(),std::ios::out);
_numInstanceMutex.lock();
for(int i=0;i<nbproc;i++)
if( fpi >> tmp )
- fpo << tmp << endl;
+ fpo << tmp << std::endl;
else
throw SALOME_Exception("You ask more processes than batch session have allocated!");
//=============================================================================
Engines::Container_ptr
SALOME_ContainerManager::StartPaCOPPContainer(const Engines::ContainerParameters& params_const,
- std::string resource_selected)
+ std::string resource_selected)
{
CORBA::Object_var obj;
PaCO::InterfaceManager_var container_proxy;
// Step 2 : Get a MachineFile for the parallel container
std::string machine_file_name = _ResManager->getMachineFile(resource_selected,
- params.nb_proc,
- params.parallelLib.in());
+ params.nb_proc,
+ params.parallelLib.in());
if (machine_file_name == "")
{
std::string
SALOME_ContainerManager::BuildCommandToLaunchPaCOProxyContainer(const Engines::ContainerParameters& params,
- std::string machine_file_name,
- std::string & proxy_hostname)
+ std::string machine_file_name,
+ std::string & proxy_hostname)
{
// In the proxy case, we always launch a Dummy Proxy
std::string exe_name = "SALOME_ParallelContainerProxyDummy";
std::ifstream machine_file(machine_file_name.c_str());
std::getline(machine_file, hostname, ' ');
size_t found = hostname.find('\n');
- if (found!=string::npos)
+ if (found!=std::string::npos)
hostname.erase(found, 1); // Remove \n
proxy_hostname = hostname;
MESSAGE("[BuildCommandToLaunchPaCOProxyContainer] machine file name extracted is " << hostname);
std::string
SALOME_ContainerManager::BuildCommandToLaunchPaCONodeContainer(const Engines::ContainerParameters& params,
- const std::string & machine_file_name,
- SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
- const std::string & proxy_hostname)
+ const std::string & machine_file_name,
+ SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
+ const std::string & proxy_hostname)
{
// Name of exe
std::string exe_name = "SALOME_ParallelContainerNode";
bool remote_execution = false;
if (hostname != std::string(Kernel_Utils::GetHostname()))
{
- MESSAGE("[BuildCommandToLaunchPaCONodeContainer] remote machine case detected !");
- remote_execution = true;
+ MESSAGE("[BuildCommandToLaunchPaCONodeContainer] remote machine case detected !");
+ remote_execution = true;
}
// For each node we have a new command
// a SALOME application
if (remote_execution)
{
- ASSERT(getenv("NSHOST"));
- ASSERT(getenv("NSPORT"));
-
- command_node_stream << resource_definition->protocol.in();
- command_node_stream << " -l ";
- command_node_stream << resource_definition->username.in();
- command_node_stream << " " << hostname;
- command_node_stream << " " << resource_definition->applipath.in();
- command_node_stream << "/runRemote.sh ";
- command_node_stream << getenv("NSHOST") << " "; // hostname of CORBA name server
- command_node_stream << getenv("NSPORT") << " "; // port of CORBA name server
+ ASSERT(getenv("NSHOST"));
+ ASSERT(getenv("NSPORT"));
+
+ command_node_stream << resource_definition->protocol.in();
+ command_node_stream << " -l ";
+ command_node_stream << resource_definition->username.in();
+ command_node_stream << " " << hostname;
+ command_node_stream << " " << resource_definition->applipath.in();
+ command_node_stream << "/runRemote.sh ";
+ command_node_stream << getenv("NSHOST") << " "; // hostname of CORBA name server
+ command_node_stream << getenv("NSPORT") << " "; // port of CORBA name server
}
command_node_stream << exe_name;
void
SALOME_ContainerManager::LogConfiguration(const std::string & log_type,
- const std::string & exe_type,
- const std::string & container_name,
- const std::string & hostname,
- std::string & begin,
- std::string & end)
+ const std::string & exe_type,
+ const std::string & container_name,
+ const std::string & hostname,
+ std::string & begin,
+ std::string & end)
{
if(log_type == "xterm")
{
CORBA::Object_ptr
SALOME_ContainerManager::LaunchPaCOProxyContainer(const std::string& command,
- const Engines::ContainerParameters& params,
- const std::string & hostname)
+ const Engines::ContainerParameters& params,
+ const std::string & hostname)
{
PaCO::InterfaceManager_ptr container_proxy = PaCO::InterfaceManager::_nil();
int count = TIME_OUT_TO_LAUNCH_CONT;
CORBA::Object_var obj = CORBA::Object::_nil();
std::string containerNameInNS = _NS->BuildContainerNameForNS(params.container_name.in(),
- hostname.c_str());
+ hostname.c_str());
MESSAGE("[LaunchParallelContainer] Waiting for Parallel Container proxy : " << containerNameInNS);
while (CORBA::is_nil(obj) && count)
Engines::Container_ptr
SALOME_ContainerManager::StartPaCOPPContainer(const Engines::ContainerParameters& params,
- std::string resource_selected)
+ std::string resource_selected)
{
Engines::Container_ptr ret = Engines::Container::_nil();
INFOS("[StarPaCOPPContainer] is disabled !");
std::string
SALOME_ContainerManager::BuildCommandToLaunchPaCOProxyContainer(const Engines::ContainerParameters& params,
- std::string machine_file_name,
- std::string & proxy_hostname)
+ std::string machine_file_name,
+ std::string & proxy_hostname)
{
return "";
}
std::string
SALOME_ContainerManager::BuildCommandToLaunchPaCONodeContainer(const Engines::ContainerParameters& params,
- const std::string & machine_file_name,
- SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
- const std::string & proxy_hostname)
+ const std::string & machine_file_name,
+ SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
+ const std::string & proxy_hostname)
{
return "";
}
void
SALOME_ContainerManager::LogConfiguration(const std::string & log_type,
- const std::string & exe_type,
- const std::string & container_name,
- const std::string & hostname,
- std::string & begin,
- std::string & end)
+ const std::string & exe_type,
+ const std::string & container_name,
+ const std::string & hostname,
+ std::string & begin,
+ std::string & end)
{
}
CORBA::Object_ptr
SALOME_ContainerManager::LaunchPaCOProxyContainer(const std::string& command,
- const Engines::ContainerParameters& params,
- const std::string& hostname)
+ const Engines::ContainerParameters& params,
+ const std::string& hostname)
{
CORBA::Object_ptr ret = CORBA::Object::_nil();
return ret;
bool
SALOME_ContainerManager::LaunchPaCONodeContainer(const std::string& command,
- const Engines::ContainerParameters& params,
- const std::string& name,
- SALOME_ContainerManager::actual_launch_machine_t & vect_machine)
+ const Engines::ContainerParameters& params,
+ const std::string& name,
+ SALOME_ContainerManager::actual_launch_machine_t & vect_machine)
{
return false;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOME_CONTAINERMANAGER_HXX__
#define __SALOME_CONTAINERMANAGER_HXX__
const std::string& container_exe="SALOME_Container");
std::string BuildCommandToLaunchLocalContainer(const Engines::ContainerParameters& params,
- const std::string& machinesFile,
+ const std::string& machinesFile,
const std::string& container_exe="SALOME_Container");
std::string BuildTempFileToLaunchRemoteContainer(const std::string& resource_name,
std::string BuildCommandToLaunchPaCOProxyContainer(const Engines::ContainerParameters& params,
- std::string machine_file_name,
- std::string & proxy_hostname);
+ std::string machine_file_name,
+ std::string & proxy_hostname);
std::string BuildCommandToLaunchPaCONodeContainer(const Engines::ContainerParameters& params,
- const std::string & machine_file_name,
- SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
- const std::string & proxy_hostname);
+ const std::string & machine_file_name,
+ SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
+ const std::string & proxy_hostname);
void LogConfiguration(const std::string & log_type,
- const std::string & exe_type,
- const std::string & container_name,
- const std::string & hostname,
- std::string & begin,
- std::string & end);
+ const std::string & exe_type,
+ const std::string & container_name,
+ const std::string & hostname,
+ std::string & begin,
+ std::string & end);
CORBA::Object_ptr
LaunchPaCOProxyContainer(const std::string& command,
- const Engines::ContainerParameters& params,
- const std::string& hostname);
+ const Engines::ContainerParameters& params,
+ const std::string& hostname);
bool
LaunchPaCONodeContainer(const std::string& command,
- const Engines::ContainerParameters& params,
- const std::string& name,
- SALOME_ContainerManager::actual_launch_machine_t & vect_machine);
+ const Engines::ContainerParameters& params,
+ const std::string& name,
+ SALOME_ContainerManager::actual_launch_machine_t & vect_machine);
// End of PaCO++ Parallel extension
};
#endif
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Container : implementation of container and engine for Kernel
# File : SALOME_ContainerPy.py
# Author : Paul RASCLE, EDF
ret = 0
instanceName = componentName + "_inst_" + `self._numInstance`
interfaceName = componentName
- return self.import_component(componentName)
+ return self.import_component(componentName), ""
#-------------------------------------------------------------------------
+ def create_component_instance_env(self, componentName, studyId, env):
+ return self.create_component_instance(componentName, studyId), ""
+
def create_component_instance(self, componentName, studyId):
MESSAGE( "SALOME_ContainerPy_i::create_component_instance ==> " + str(componentName) + ' ' + str(studyId) )
if studyId < 0:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <SALOMEconfig.h>
#include <stdexcept>
#include <omniORB4/CORBA.h>
// CCRT porting
// #include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-using namespace std;
-
extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB)
{
// CCRT porting
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Container : implementation of container and engine for Kernel
// File : SALOME_Container_i.hxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
// --- CORBA methods
- virtual bool load_component_Library(const char* componentName);
+ virtual bool load_component_Library(const char* componentName, CORBA::String_out reason);
virtual Engines::Component_ptr
create_component_instance( const char* componentName,
CORBA::Long studyId); // 0 for multiStudy
+ virtual Engines::Component_ptr
+ create_component_instance_env( const char* componentName,
+ CORBA::Long studyId, // 0 for multiStudy
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason);
Engines::Component_ptr
find_component_instance( const char* registeredName,
CORBA::Long studyId); // 0 for multiStudy
find_or_create_instance( std::string genericRegisterName,
std::string componentLibraryName);
- Engines::Component_ptr
- createInstance(std::string genericRegisterName,
- void *handle,
- int studyId);
+ bool load_component_CppImplementation(const char* componentName,std::string& reason);
+ bool load_component_PythonImplementation(const char* componentName,std::string& reason);
+ bool load_component_ExecutableImplementation(const char* componentName,std::string& reason);
+
+ Engines::Component_ptr createPythonInstance(std::string CompName, int studyId, std::string& error);
+ Engines::Component_ptr createExecutableInstance(std::string CompName, int studyId, const Engines::FieldsDict& env, std::string& error);
+ Engines::Component_ptr createInstance(std::string genericRegisterName, void *handle, int studyId, std::string& error);
static bool isPythonContainer(const char* ContainerName);
static void decInstanceCnt(std::string genericRegisterName);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_FileRef_i.cxx
// Author : Paul RASCLE, EDF
// Module : SALOME
#include "Basics_Utils.hxx"
#include <string>
-using namespace std;
-
//=============================================================================
/*!
* Default constructor, not for use
const char* fileName)
{
MESSAGE("fileRef_i::addRef " << machine << " " << fileName);
- string theMachine = machine;
- string theFileName = fileName;
+ std::string theMachine = machine;
+ std::string theFileName = fileName;
if (theFileName[0] != '/')
{
char* fileRef_i::getRef(const char* machine)
{
MESSAGE("fileRef_i::getRef "<< machine);
- string theMachine = machine;
- string theFileName = _copies[theMachine];
+ std::string theMachine = machine;
+ std::string theFileName = _copies[theMachine];
if (_copies[theMachine].empty())
{
MESSAGE("no copy of " << _machine << _origFileName << " available on "
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_FileRef_i.hxx
// Author : Paul RASCLE, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_FileTransfer_i.cxx
// Author : Paul RASCLE, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_FileTransfer_i.hxx
// Author : Paul RASCLE, EDF
// Module : SALOME
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SALOME_PyNode.py
# Author : Christian CAREMOLI, EDF
# Module : SALOME
# $Header$
#
-
import sys,traceback,string
import linecache
import cPickle
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Salome_file_i.cxx
// Author : André RIBES, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Salome_file_i.hxx
// Author : André RIBES, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Salome_file_i.hxx"
#include <iostream>
#include <fstream>
#include "HDFascii.hxx"
#include <stdlib.h>
-using namespace std;
+void print_infos(Engines::file*);
+void print_state(Engines::SfState*);
void print_infos(Engines::file * infos)
{
- cerr << "-------------------------------------------------------------------" << endl;
- cerr << "file_name = " << infos->file_name << endl;
- cerr << "path = " << infos->path << endl;
- cerr << "type = " << infos->type << endl;
- cerr << "source_file_name = " << infos->source_file_name << endl;
- cerr << "status = " << infos->status << endl;
+ std::cerr << "-------------------------------------------------------------------" << std::endl;
+ std::cerr << "file_name = " << infos->file_name << std::endl;
+ std::cerr << "path = " << infos->path << std::endl;
+ std::cerr << "type = " << infos->type << std::endl;
+ std::cerr << "source_file_name = " << infos->source_file_name << std::endl;
+ std::cerr << "status = " << infos->status << std::endl;
}
void print_state(Engines::SfState * state)
{
- cerr << "-------------------------------------------------------------------" << endl;
- cerr << "name = " << state->name << endl;
- cerr << "hdf5_file_name = " << state->hdf5_file_name << endl;
- cerr << "number_of_files = " << state->number_of_files << endl;
- cerr << "files_ok = " << state->files_ok << endl;
+ std::cerr << "-------------------------------------------------------------------" << std::endl;
+ std::cerr << "name = " << state->name << std::endl;
+ std::cerr << "hdf5_file_name = " << state->hdf5_file_name << std::endl;
+ std::cerr << "number_of_files = " << state->number_of_files << std::endl;
+ std::cerr << "files_ok = " << state->files_ok << std::endl;
}
PortableServer::POAManager_var pman;
CORBA::Object_var obj;
- cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
- cerr << "Test of setLocalFile()" << endl;
+ std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
+ std::cerr << "Test of setLocalFile()" << std::endl;
file.setLocalFile("/tmp/toto");
infos = file.getFileInfos("toto");
print_infos(infos);
- cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
- cerr << "Test of getFilesInfos()" << endl;
+ std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
+ std::cerr << "Test of getFilesInfos()" << std::endl;
all_infos = file.getFilesInfos();
for (int i = 0; i < all_infos->length(); i++)
{
print_infos(&((*all_infos)[i]));
}
- cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
- cerr << "Test of getSalome_fileState()" << endl;
+ std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
+ std::cerr << "Test of getSalome_fileState()" << std::endl;
state = file.getSalome_fileState();
print_state(state);
file2.setLocalFile("/tmp/toto_distributed_source");
Engines::Salome_file_ptr file2_ref = file2._this();
- cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
- cerr << "Test of setDistributedFile()" << endl;
+ std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
+ std::cerr << "Test of setDistributedFile()" << std::endl;
file.setDistributedFile("/tmp/toto_distributed");
file.connectDistributedFile("toto_distributed", file2_ref);
// file.setDistributedSourceFile("toto_distributed", "toto_distributed_source");
}
catch (SALOME::SALOME_Exception & e)
{
- cerr << "Exception : " << e.details.text << endl;
+ std::cerr << "Exception : " << e.details.text << std::endl;
}
- cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
- cerr << "Test of getFilesInfos()" << endl;
+ std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
+ std::cerr << "Test of getFilesInfos()" << std::endl;
all_infos = file.getFilesInfos();
for (int i = 0; i < all_infos->length(); i++)
{
print_infos(&((*all_infos)[i]));
}
- cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
- cerr << "Test of getSalome_fileState()" << endl;
+ std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
+ std::cerr << "Test of getSalome_fileState()" << std::endl;
state = file.getSalome_fileState();
print_state(state);
// Test of ConvertFromHDFToASCII
// and ConvertFromASCIIToHDF
- cerr << "Test of ConvertFromASCIIToHDF" << endl;
+ std::cerr << "Test of ConvertFromASCIIToHDF" << std::endl;
HDFascii::ConvertFromASCIIToHDF("/tmp/toto"); // RETURN NULL !
- cerr << "Test of ConvertFromHDFToASCII" << endl;
- cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", false) << endl;
- cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", true) << endl;
+ std::cerr << "Test of ConvertFromHDFToASCII" << std::endl;
+ std::cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", false) << std::endl;
+ std::cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", true) << std::endl;
- cerr << "End of tests" << endl;
+ std::cerr << "End of tests" << std::endl;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DF_definitions.hxx"
#include "DF_Application.hxx"
-using namespace std;
-
//Constructor
DF_Application::DF_Application()
{
//Creates a new document with given type, returns a smart pointer to
//newly created document.
-DF_Document* DF_Application::NewDocument(const string& theDocumentType)
+DF_Document* DF_Application::NewDocument(const std::string& theDocumentType)
{
DF_Document* aDoc = new DF_Document(theDocumentType);
aDoc->_id = ++_currentID;
}
//Returns a list of IDs of all currently opened documents
-vector<int> DF_Application::GetDocumentIDs()
+std::vector<int> DF_Application::GetDocumentIDs()
{
- vector<int> ids;
- typedef map<int, DF_Document*>::const_iterator DI;
+ std::vector<int> ids;
+ typedef std::map<int, DF_Document*>::const_iterator DI;
for(DI p = _documents.begin(); p!=_documents.end(); p++)
ids.push_back(p->first);
return ids;
//Restores a Document from the given file, returns a smart
//pointer to opened document.
-DF_Document* DF_Application::Open(const string& theFileName)
+DF_Document* DF_Application::Open(const std::string& theFileName)
{
//Not implemented
return NULL;
//Saves a Document in a given file with name theFileName
-void DF_Application::SaveAs(const DF_Document* theDocument, const string& theFileName)
+void DF_Application::SaveAs(const DF_Document* theDocument, const std::string& theFileName)
{
//Not implemented
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DFAPPLICATION_HXX
#define DFAPPLICATION_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DF_definitions.hxx"
#include "DF_Label.hxx"
#include "DF_Attribute.hxx"
-using namespace std;
-
//Class DF_Attribute is used to store some data defined by the DF_Attribute type
//Constructor
//Remove an attribute from a map of the node's attributes to
//avoid double deletion on the node destruction
if(_node) {
- map<string, DF_Attribute*>::iterator mi;
+ std::map<std::string, DF_Attribute*>::iterator mi;
for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) {
if(mi->second == this) {
_node->_attributes.erase(mi);
}
//Searches an Attribute with given ID located on the same Label as this Attribute.
-DF_Attribute* DF_Attribute::FindAttribute(const string& theID) const
+DF_Attribute* DF_Attribute::FindAttribute(const std::string& theID) const
{
if(!_node) return NULL;
return Label().FindAttribute(theID);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DFATTRIBUTE_HXX
#define DFATTRIBUTE_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "DF_ChildIterator.hxx"
-
-using namespace std;
+#include "DF_ChildIterator.hxx"
//Constructor
DF_ChildIterator::DF_ChildIterator(const DF_Label& theLabel, bool allLevels)
//Returns true if there is a current Label
bool DF_ChildIterator::More()
{
- return bool(_current);
+ return _current!=0;
}
//Moves to the next Label
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DFCHILDITERATOR_HXX
#define DFCHILDITERATOR_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DF_definitions.hxx"
#include "DF_Label.hxx"
#include "DF_Container.hxx"
-using namespace std;
-
//Static method that returns an ID of the give type of attributes
-const string& DF_Container::GetID()
+const std::string& DF_Container::GetID()
{
- static string id = "DF_Container_srn";
+ static std::string id = "DF_Container_srn";
return id;
}
}
//Sets an integer value of the attribute with given ID
-void DF_Container::SetInt(const string& theID, int theValue)
+void DF_Container::SetInt(const std::string& theID, int theValue)
{
_ints[theID] = theValue;
}
//Returns an integer value of the attribute with given ID
-int DF_Container::GetInt(const string& theID)
+int DF_Container::GetInt(const std::string& theID)
{
if(!HasIntID(theID))
return 0;
}
//Returns True if there is an integer with given ID
-bool DF_Container::HasIntID(const string& theID)
+bool DF_Container::HasIntID(const std::string& theID)
{
if(_ints.find(theID) != _ints.end()) return true;
return false;
}
//Sets a double value of the attribute with given ID
-void DF_Container::SetDouble(const string& theID, const double& theValue)
+void DF_Container::SetDouble(const std::string& theID, const double& theValue)
{
_doubles[theID] = theValue;
}
//Returns a double value of the attribute with given ID
-double DF_Container::GetDouble(const string& theID)
+double DF_Container::GetDouble(const std::string& theID)
{
if(!HasDoubleID(theID)) return 0.0;
return _doubles[theID];
}
//Returns True if there is a double with given ID
-bool DF_Container::HasDoubleID(const string& theID)
+bool DF_Container::HasDoubleID(const std::string& theID)
{
if(_doubles.find(theID) != _doubles.end()) return true;
return false;
}
//Sets a string value of the attribute with given ID
-void DF_Container::SetString(const string& theID, const string& theValue)
+void DF_Container::SetString(const std::string& theID, const std::string& theValue)
{
_strings[theID] = theValue;
}
//Returns a string value of the attribute with given ID
-string DF_Container::GetString(const string& theID)
+std::string DF_Container::GetString(const std::string& theID)
{
if(!HasStringID(theID)) return "";
return _strings[theID];
}
//Returns True if there is a string with given ID
-bool DF_Container::HasStringID(const string& theID)
+bool DF_Container::HasStringID(const std::string& theID)
{
if(_strings.find(theID) != _strings.end()) return true;
return false;
}
//Sets a boolean value of the attribute with given ID
-void DF_Container::SetBool(const string& theID, bool theValue)
+void DF_Container::SetBool(const std::string& theID, bool theValue)
{
_bools[theID] = theValue;
}
//Returns a boolean value of the attribute with given ID
-bool DF_Container::GetBool(const string& theID)
+bool DF_Container::GetBool(const std::string& theID)
{
if(!HasBoolID(theID)) return false;
return _bools[theID];
}
//Returns True if there is a boolean value with given ID
-bool DF_Container::HasBoolID(const string& theID)
+bool DF_Container::HasBoolID(const std::string& theID)
{
if(_bools.find(theID) != _bools.end()) return true;
return false;
}
//ID is a string that uniquely identify the given type of Attributes within the Application.
-const string& DF_Container::ID() const
+const std::string& DF_Container::ID() const
{
return GetID();
}
DF_Container* attr = dynamic_cast<DF_Container*>(theAttribute);
if(!attr) return;
- typedef map<string, int>::const_iterator SI;
+ typedef std::map<std::string, int>::const_iterator SI;
for(SI p = attr->_ints.begin(); p != attr->_ints.end(); p++)
_ints[p->first] = p->second;
- typedef map<string, double>::const_iterator SD;
+ typedef std::map<std::string, double>::const_iterator SD;
for(SD p = attr->_doubles.begin(); p != attr->_doubles.end(); p++)
_doubles[p->first] = p->second;
- typedef map<string, string>::const_iterator SS;
+ typedef std::map<std::string, std::string>::const_iterator SS;
for(SS p = attr->_strings.begin(); p != attr->_strings.end(); p++)
_strings[p->first] = p->second;
- typedef map<string, bool>::const_iterator SB;
+ typedef std::map<std::string, bool>::const_iterator SB;
for(SB p = attr->_bools.begin(); p != attr->_bools.end(); p++)
_bools[p->first] = p->second;
}
attr->Clear();
- typedef map<string, int>::const_iterator SI;
+ typedef std::map<std::string, int>::const_iterator SI;
for(SI p = _ints.begin(); p != _ints.end(); p++)
attr->_ints[p->first] = p->second;
- typedef map<string, double>::const_iterator SD;
+ typedef std::map<std::string, double>::const_iterator SD;
for(SD p = _doubles.begin(); p != _doubles.end(); p++)
attr->_doubles[p->first] = p->second;
- typedef map<string, string>::const_iterator SS;
+ typedef std::map<std::string, std::string>::const_iterator SS;
for(SS p = _strings.begin(); p != _strings.end(); p++)
attr->_strings[p->first] = p->second;
- typedef map<string, bool>::const_iterator SB;
+ typedef std::map<std::string, bool>::const_iterator SB;
for(SB p = _bools.begin(); p != _bools.end(); p++)
attr-> _bools[p->first] = p->second;
}
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DFCONTAINER_HXX
#define DFCONTAINER_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DF_definitions.hxx"
#include "DF_Document.hxx"
#include "DF_Label.hxx"
#include "DF_ChildIterator.hxx"
-using namespace std;
-
//Class DF_Document is container for user's data stored as a tree of Labels
//with assigned Attributes
-DF_Document::DF_Document(const string& theDocumentType)
+DF_Document::DF_Document(const std::string& theDocumentType)
{
_id = -1;
_type = theDocumentType;
}
//Returns a type of the Document
-string DF_Document::GetDocumentType()
+std::string DF_Document::GetDocumentType()
{
return _type;
}
{
if(_root.IsNull()) return;
- vector<DF_LabelNode*> vn;
+ std::vector<DF_LabelNode*> vn;
DF_ChildIterator CI(_root, true);
for(; CI.More(); CI.Next()) {
DF_LabelNode* node = CI.Value()._node;
}
//Converts a content of the Document into the std::string
-string DF_Document::Save()
+std::string DF_Document::Save()
{
//Not implemented
return "";
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DFDOCUMENT_HXX
#define DFDOCUMENT_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DF_definitions.hxx"
#include "DF_Label.hxx"
#include "DF_Document.hxx"
#include <algorithm>
-using namespace std;
-
//Class DF_Label defines a persistence reference in DF_Document that contains a tree of Labels.
//This reference is named "entry" and is a sequence of tags divided by ":". The root entry is "0:".
//For example "0:1:1" corresponds the following structure
// |
// |_ 1
-DF_Label DF_Label::Label(const DF_Label& theLabel, const string& theEntry, bool isCreated)
+DF_Label DF_Label::Label(const DF_Label& theLabel, const std::string& theEntry, bool isCreated)
{
if(theLabel.IsNull()) return DF_Label();
char* cc = (char*)theEntry.c_str();
int n = 0;
- vector<int> tags;
+ std::vector<int> tags;
while (*cc != '\0') {
while ( *cc >= '0' && *cc <= '9') {
bool DF_Label::IsAttached()
{
if(!_node) return false;
- return (bool)(_node->_document);
+ return _node->_document != 0;
}
//Searches an Attribute with given ID located on this Label.
{
if(!_node) return false;
- vector<DF_Attribute*> va = GetAttributes();
+ std::vector<DF_Attribute*> va = GetAttributes();
_node->_attributes.clear();
for(int i = 0, len = va.size(); i<len; i++) {
}
//Returns a list of Attributes of this Label.
-vector<DF_Attribute*> DF_Label::GetAttributes() const
+std::vector<DF_Attribute*> DF_Label::GetAttributes() const
{
- vector<DF_Attribute*> attributes;
+ std::vector<DF_Attribute*> attributes;
if(!_node) return attributes;
- typedef map<string, DF_Attribute*>::const_iterator AI;
- vector<string> sorted;
+ typedef std::map<std::string, DF_Attribute*>::const_iterator AI;
+ std::vector<std::string> sorted;
for(AI p = _node->_attributes.begin(); p!=_node->_attributes.end(); p++)
sorted.push_back(p->first);
{
if(!_node) return false;
- return (bool)(_node->_firstChild);
+ return _node->_firstChild != 0;
}
//Returns a number of child Labels.
}
//Returns a string entry of this Label
-string DF_Label::Entry() const
+std::string DF_Label::Entry() const
{
- string entry = "";
- vector<int> vi;
+ std::string entry = "";
+ std::vector<int> vi;
DF_LabelNode* father = this->_node;
while(father) {
vi.push_back(father->_tag);
for(int i = len-1; i>=0; i--) {
int tag = vi[i];
sprintf(buffer, "%d", tag);
- entry+=string(buffer);
+ entry+=std::string(buffer);
if(i) entry += ":";
}
}
void DF_Label::dump()
{
- if(!_node) cout << "DF_Label addr : " << this << " NULL " << endl;
+ if(!_node) std::cout << "DF_Label addr : " << this << " NULL " << std::endl;
else {
- cout << "DF_Label addr : " << this->_node << " entry : " << Entry() << endl;
- if(_node->_father) cout << " Father : " << _node->_father << " entry : " << Father().Entry() << endl;
- else cout << " Father : NULL " << endl;
+ std::cout << "DF_Label addr : " << this->_node << " entry : " << Entry() << std::endl;
+ if(_node->_father) std::cout << " Father : " << _node->_father << " entry : " << Father().Entry() << std::endl;
+ else std::cout << " Father : NULL " << std::endl;
- if(_node->_firstChild) cout << " FirstChild : " << _node->_firstChild << " entry : " << DF_Label(_node->_firstChild).Entry() << endl;
- else cout << " FirstChild : NULL " << endl;
+ if(_node->_firstChild) std::cout << " FirstChild : " << _node->_firstChild << " entry : " << DF_Label(_node->_firstChild).Entry() << std::endl;
+ else std::cout << " FirstChild : NULL " << std::endl;
- if(_node->_lastChild) cout << " LastChild : " << _node->_lastChild << " entry : " << DF_Label(_node->_lastChild).Entry() << endl;
- else cout << " LastChild : NULL " << endl;
+ if(_node->_lastChild) std::cout << " LastChild : " << _node->_lastChild << " entry : " << DF_Label(_node->_lastChild).Entry() << std::endl;
+ else std::cout << " LastChild : NULL " << std::endl;
- if(_node->_previous) cout << " Previous : " << _node->_previous << " entry : " << DF_Label(_node->_previous).Entry() << endl;
- else cout << " Previous : NULL " << endl;
+ if(_node->_previous) std::cout << " Previous : " << _node->_previous << " entry : " << DF_Label(_node->_previous).Entry() << std::endl;
+ else std::cout << " Previous : NULL " << std::endl;
- if(_node->_next) cout << " Next : " << _node->_next << " entry : " << DF_Label(_node->_next).Entry() << endl;
- else cout << " Next : NULL " << endl;
+ if(_node->_next) std::cout << " Next : " << _node->_next << " entry : " << DF_Label(_node->_next).Entry() << std::endl;
+ else std::cout << " Next : NULL " << std::endl;
}
}
DF_LabelNode::~DF_LabelNode()
{
- vector<DF_Attribute*> va;
- typedef map<string, DF_Attribute*>::const_iterator AI;
+ std::vector<DF_Attribute*> va;
+ typedef std::map<std::string, DF_Attribute*>::const_iterator AI;
for(AI p = _attributes.begin(); p!=_attributes.end(); p++)
va.push_back(p->second);
_depth = 0;
_tag = 0;
- vector<DF_Attribute*> va;
- typedef map<string, DF_Attribute*>::const_iterator AI;
+ std::vector<DF_Attribute*> va;
+ typedef std::map<std::string, DF_Attribute*>::const_iterator AI;
for(AI p = _attributes.begin(); p!=_attributes.end(); p++)
va.push_back(p->second);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DFLABEL_HXX
#define DFLABEL_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DF_DEF_HXX
#define DF_DEF_HXX
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//File: testDF.cxx
//Author: Sergey RUIN
//
#include <pwd.h>
#else
#include <time.h>
-#include <lmcons.h>
#include <windows.h>
+#include <lmcons.h>
#endif
-using namespace std;
-void printStr(const string& theValue)
+void printStr(const std::string& theValue)
{
- cout << "printStr: " << theValue << endl;
+ std::cout << "printStr: " << theValue << std::endl;
}
void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds)
#endif
}
-string GetUserName()
+std::string GetUserName()
{
#ifdef WIN32
char* pBuff = new char[UNLEN + 1];
DWORD dwSize = UNLEN + 1;
- string retVal;
+ std::string retVal;
GetUserName ( pBuff, &dwSize );
- string theTmpUserName(pBuff,(int)dwSize -1 );
+ std::string theTmpUserName(pBuff,(int)dwSize -1 );
retVal = theTmpUserName;
delete [] pBuff;
return retVal;
#else
struct passwd *infos;
infos = getpwuid(getuid());
- return string(infos->pw_name);
+ return std::string(infos->pw_name);
#endif
}
-string GetNameFromPath(const string& thePath) {
+std::string GetNameFromPath(const std::string& thePath) {
if (thePath.empty()) return "";
int pos1 = thePath.rfind('/');
int pos2 = thePath.rfind('\\');
return thePath;
}
-string GetDirFromPath(const string& thePath) {
+std::string GetDirFromPath(const std::string& thePath) {
if (thePath.empty()) return "";
int pos = thePath.rfind('/');
- string path;
+ std::string path;
if(pos > 0) {
path = thePath.substr(0, pos+1);
}
}
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
}
-string divideString(const string& theValue, int nbChars)
+std::string divideString(const std::string& theValue, int nbChars)
{
return theValue.substr(nbChars, theValue.size());
}
-vector<string> splitString(const string& theValue, char separator)
+std::vector<std::string> splitString(const std::string& theValue, char separator)
{
- vector<string> vs;
+ std::vector<std::string> vs;
if(theValue[0] == separator && theValue.size() == 1) return vs;
int pos = theValue.find(separator);
if(pos < 0) {
return vs;
}
- string s = theValue;
+ std::string s = theValue;
if(s[0] == separator) s = s.substr(1, s.size());
while((pos = s.find(separator)) >= 0) {
vs.push_back(s.substr(0, pos));
int main (int argc, char * argv[])
{
- cout << "Test started " << endl;
+ std::cout << "Test started " << std::endl;
DF_Application* appli = new DF_Application;
/*
DF_Attribute* attr = NULL;
if(!(attr = child.FindAttribute(DF_Container::GetID()))) {
- cout << "Attribute wasn't found" << endl;
+ std::cout << "Attribute wasn't found" << std::endl;
}
else {
attr1 = dynamic_cast<DF_Container*>(attr);
- cout << "Attribute was found " << " HasID " << attr1->HasIntID("eighteen") << " value = " << attr1->GetInt("eighteen")<< endl;
+ std::cout << "Attribute was found " << " HasID " << attr1->HasIntID("eighteen") << " value = " << attr1->GetInt("eighteen")<< std::endl;
}
DF_Container *attr2 = (DF_Container*)child.FindAttribute(DF_Container::GetID());
if(!attr2) cout << "Can't find the attribute" << endl;
- cout << "Change find : " << attr2->GetInt("eighteen") << endl;
+ std::cout << "Change find : " << attr2->GetInt("eighteen") << std::endl;
- cout << "Forgetting " << child.ForgetAttribute(DF_Container::GetID()) << endl;
+ std::cout << "Forgetting " << child.ForgetAttribute(DF_Container::GetID()) << std::endl;
if(!child.FindAttribute(DF_Container::GetID())) {
- cout << "Attribute wasn't found" << endl;
+ std::cout << "Attribute wasn't found" << std::endl;
}
child.NewChild();//0:1:4:2
- cout << "Is equal " << (child == child) << endl;
- cout << "Is equal " << (child == root1) << endl;
+ std::cout << "Is equal " << (child == child) << std::endl;
+ std::cout << "Is equal " << (child == root1) << std::endl;
child = root1.NewChild(); //0:1:5
DF_ChildIterator CI(root1.Father(), true);
//root1.dump();
for(; CI.More(); CI.Next()) {
- cout << CI.Value().Entry() << endl;
+ std::cout << CI.Value().Entry() << std::endl;
//CI.Value().dump();
}
DF_Label L = DF_Label::Label(child, "0:1:4:1");
- cout << "Found Label " << L.Entry() << endl;
+ std::cout << "Found Label " << L.Entry() << std::endl;
std::string s("012-56");
int pos = s.find('-');
- cout << "Fisrt part : " << s.substr(0, pos) << endl;
- cout << "Last part : " << s.substr(pos+1, s.size()) << endl;
+ std::cout << "Fisrt part : " << s.substr(0, pos) << std::endl;
+ std::cout << "Last part : " << s.substr(pos+1, s.size()) << std::endl;
- vector<string> vs = splitString("/dn20/salome/srn/salome2/", '/');
+ std::vector<std::string> vs = splitString("/dn20/salome/srn/salome2/", '/');
for(int i = 0; i<vs.size(); i++)
- cout << vs[i] << endl;
+ std::cout << vs[i] << std::endl;
- cout << "Diveded str = " << divideString("abcdefg",3) << endl;
+ std::cout << "Diveded str = " << divideString("abcdefg",3) << std::endl;
//mkdir("/dn20/salome/srn/salome2", 0x1ff);
int month=0,day=0,year=0,hh=0,mn=0,ss=0;
GetSystemDate(year, month, day, hh, mn, ss);
- cout << "Date: " << year << " " << month << " " << day << " " << hh << " " << mn << " " << ss << endl;
+ std::cout << "Date: " << year << " " << month << " " << day << " " << hh << " " << mn << " " << ss << std::endl;
- string t("absd");
+ std::string t("absd");
t.insert(t.begin(), 'b');
cout << "Result = " << t << endl;
char* cstr = (char*)t.c_str();
DF_ChildIterator CI2(so5, true);
so5.dump();
for(; CI2.More(); CI2.Next()) {
- cout << " ###### Found child with entry = " << CI2.Value().Entry() << endl;
+ std::cout << " ###### Found child with entry = " << CI2.Value().Entry() << std::endl;
//CI2.Value().dump();
}
delete appli;
- cout << "Test finished " << endl;
+ std::cout << "Test finished " << std::endl;
return 0;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ConnectionManager_i.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
connection_infos * infos = ids[id];
try
{
- infos->provides_component->disconnect_provides_port(infos->provides_port_name.c_str(),
- message);
+ infos->provides_component->disconnect_provides_port(infos->provides_port_name.c_str(), message);
}
catch(CORBA::SystemException& ex)
{
try
{
infos->uses_component->disconnect_uses_port(infos->uses_port_name.c_str(),
- infos->provides_port,
- message);
+ infos->provides_port, message);
}
catch(CORBA::SystemException& ex)
{
void
ConnectionManager_i::ShutdownWithExit()
{
+ ids_it = ids.begin();
+ while(ids_it != ids.end())
+ {
+ disconnect(ids_it->first, Engines::DSC::RemovingConnection);
+ ids_it = ids.begin();
+ }
+
if(!CORBA::is_nil(_orb))
_orb->shutdown(0);
- //exit( EXIT_SUCCESS );
}
CORBA::Long
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ConnectionManager_i.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_Basic.hxx
// Author : Natalia ERMOLAYEVA
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_Callbacks.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_i.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_i.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_interface.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_interface.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PortProperties_i.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PortProperties_i.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_ConnectionManagerServer.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
#include "utilities.h"
#include <iostream>
-using namespace std;
-
int main(int argc, char* argv[])
{
PortableServer::POA_var root_poa;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF), Eric Fayolle (EDF)
# Module : KERNEL
-#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
# ===============================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
%define DOCSTRING
"CALCIUM python wrapping : Superv_Component class
"
%feature("autodoc", "1");
+%include cstring.i
+
%{
//C++ Includes
#include <SALOMEconfig.h>
#define array_size(a,i) (((PyArrayObject *)a)->dimensions[i])
#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
+const char* pytype_string(PyObject*);
+const char* typecode_string(int);
+int type_match(int, int);
+int require_size(PyArrayObject*, int*, int);
+int require_dimensions_n(PyArrayObject*, int*, int);
+int require_dimensions(PyArrayObject*, int);
+int require_contiguous(PyArrayObject*);
+PyArrayObject* make_contiguous(PyArrayObject*, int*, int, int);
+PyArrayObject* obj_to_array_no_conversion(PyObject*, int);
+PyArrayObject* obj_to_array_allow_conversion(PyObject*, int, int*);
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject*, int, int*);
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject*, int, int*);
+
/* Given a PyObject, return a string describing its type.
*/
const char* pytype_string(PyObject* py_obj) {
%include "carrays.i"
-%array_class(int, intArray);
-%array_class(float, floatArray);
+%array_class(int, intArray);
+%array_class(long, longArray);
+%array_class(float, floatArray);
%array_class(double, doubleArray);
/* special struct to handle string arrays */
{
stringArray(int nelements,int size=0) {
nelem=nelements;
+ size=size;
data= new char*[nelements];
for(int i=0;i<nelements;i++)
{
}
char** data;
int nelem;
+ int size;
};
%}
/* End of special struct to handle string arrays */
}
}
%typemap(freearg) type* IN_ARRAY3 {
- if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+%#ifdef WITH_NUMPY
+ if (is_new_object$argnum && array$argnum)
+ {
+ Py_DECREF(array$argnum);
+ }
+%#endif
}
%enddef
TYPEMAP_IN3(int, PyArray_INT)
+TYPEMAP_IN3(long, PyArray_LONG)
TYPEMAP_IN3(float, PyArray_FLOAT )
TYPEMAP_IN3(double, PyArray_DOUBLE)
#undef TYPEMAP_IN3
%apply int* IN_ARRAY3 {int *eval};
+%apply long* IN_ARRAY3 {long *eval};
%apply float* IN_ARRAY3 {float *eval};
%apply double* IN_ARRAY3 {double *eval};
}
}
%typemap(freearg) float* ecpval {
- if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+%#ifdef WITH_NUMPY
+ if (is_new_object$argnum && array$argnum)
+ {
+ Py_DECREF(array$argnum);
+ }
+%#endif
}
/* End of Specific typemap for complex */
/* array of strings on input */
-%typemap(in) char** eval
+%typemap(in) (char** eval,int strSize)
(ArrayObject* array=NULL, int is_new_object) {
stringArray* sarray;
if ((SWIG_ConvertPtr($input, (void **) &sarray, $descriptor(stringArray *),0)) == -1)
array = obj_to_array_contiguous_allow_conversion($input, PyArray_STRING, &is_new_object);
if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
$1 = (char**) malloc(array_size(array,0)*sizeof(char*));
+ $2 = array->strides[0];
for(int i=0;i<array_size(array,0);i++)
- $1[i]=(char*) array->data + i* array->strides[0];
+ {
+ $1[i]=(char*) malloc(sizeof(char)*(array->strides[0]+1));
+ strncpy($1[i],(char*) array->data + i* array->strides[0],array->strides[0]);
+ *($1[i]+array->strides[0])='\0';
+ }
%#else
SWIG_exception(SWIG_TypeError, "string array expected");
%#endif
else
{
$1=sarray->data;
+ $2=sarray->size;
}
}
-%typemap(freearg) char** eval {
- if (array$argnum) free($1);
- if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+%typemap(freearg) (char** eval,int strSize) {
+%#ifdef WITH_NUMPY
+ if (array$argnum)
+ {
+ for(int i=0;i<array_size(array$argnum,0);i++)
+ free($1[i]);
+ free($1);
+ }
+ if (is_new_object$argnum && array$argnum)
+ {
+ Py_DECREF(array$argnum);
+ }
+%#endif
}
/* End of array of strings on input */
%enddef
TYPEMAP_INPLACE3(int, PyArray_INT)
+TYPEMAP_INPLACE3(long, PyArray_LONG)
TYPEMAP_INPLACE3(float, PyArray_FLOAT )
TYPEMAP_INPLACE3(double, PyArray_DOUBLE)
#undef TYPEMAP_INPLACE3
%apply int* INPLACE_ARRAY3 {int *lval};
+%apply long* INPLACE_ARRAY3 {long *lval};
%apply float* INPLACE_ARRAY3 {float *lval};
%apply double* INPLACE_ARRAY3 {double *lval};
/* End of typemap for complex inout */
/* typemap for array of strings on input/output */
-%typemap(in) char** lval
+%typemap(in) (char** lval,int strSize)
(ArrayObject* temp=NULL) {
stringArray* sarray;
if ((SWIG_ConvertPtr($input, (void **) &sarray, $descriptor(stringArray *) ,0)) == -1)
temp = obj_to_array_no_conversion($input,PyArray_STRING);
if (!temp || !require_contiguous(temp)) SWIG_fail;
$1 = (char**) malloc(array_size(temp,0)*sizeof(char*));
+ $2 = temp->strides[0];
for(int i=0;i<array_size(temp,0);i++)
- $1[i]=(char*) temp->data+i*temp->strides[0];
+ {
+ $1[i]=(char*) temp->data+i*temp->strides[0];
+ memset($1[i],0,temp->strides[0]); //numpy strings must be completed with 0 up to elsize
+ }
%#else
temp = NULL;
SWIG_exception(SWIG_TypeError, "string array expected");
else
{
$1=sarray->data;
+ $2=sarray->size;
}
}
-%typemap(freearg) char** lval {
+%typemap(freearg) (char** lval,int strSize) {
+%#ifdef WITH_NUMPY
if (temp$argnum) free($1);
+%#endif
}
/* End of typemap for array of strings on input/output */
%ignore CPMESSAGE;
%include "calciumP.h"
-int cp_cd(Superv_Component_i *component,char *name);
+%cstring_bounded_output(char *instanceName, 1024);
+
+int cp_cd(Superv_Component_i *component,char *instanceName);
int cp_een(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,int *eval);
int cp_edb(Superv_Component_i *component,int dep,double t,int n,char *nom,int nval,double *eval);
int cp_ecp(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,float *ecpval);
int cp_elo(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,int *eval);
int cp_ech(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,char** eval,int strSize);
+int cp_elg(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,long *eval);
+int cp_eln(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,long *eval);
int cp_len(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
int cp_lcp(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lcpval);
int cp_llo(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
int cp_lch(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,char** lval,int strSize);
+int cp_llg(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,long *lval);
+int cp_lln(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,long *lval);
+
+int cp_fini(Superv_Component_i *component,char *nom, int n);
+int cp_fint(Superv_Component_i *component,char *nom, float t);
+int cp_effi(Superv_Component_i *component,char *nom, int n);
+int cp_efft(Superv_Component_i *component,char *nom, float t);
int cp_fin(Superv_Component_i *component,int cp_end);
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## @package dsccalcium
# \brief Module that provides the base class for DSC components implemented in python
#
-#
import calcium
import SALOME_ComponentPy
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : basic_port_factory.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
#include "basic_port_factory.hxx"
#include "Superv_Component_i.hxx"
-using namespace std;
basic_port_factory::basic_port_factory() {
Superv_Component_i::register_factory("BASIC",this);
basic_port_factory::~basic_port_factory() {}
provides_port *
-basic_port_factory::create_data_servant(string type) {
+basic_port_factory::create_data_servant(std::string type) {
provides_port * rtn_port = NULL;
if (type == "short") {
rtn_port = new data_short_port_provides();
}
uses_port *
-basic_port_factory::create_data_proxy(string type) {
+basic_port_factory::create_data_proxy(std::string type) {
uses_port * rtn_port = NULL;
if (type == "short")
rtn_port = new data_short_port_uses();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : basic_port_factory.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : data_short_port_provides.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : data_short_port_provides.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : data_short_port_uses.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
//
#include "data_short_port_uses.hxx"
#include <iostream>
-using namespace std;
data_short_port_uses::data_short_port_uses() {
_my_ports = NULL;
// if (!CORBA::is_nil(_my_port))
// _my_port->put(data);
if (!_my_ports)
- cerr << "data_short_port_uses::put is NULL" << endl;
+ std::cerr << "data_short_port_uses::put is NULL" << std::endl;
else
{
for(int i = 0; i < _my_ports->length(); i++)
if (_my_ports)
delete _my_ports;
- cerr << "data_short_port_uses::uses_port_changed" << endl;
+ std::cerr << "data_short_port_uses::uses_port_changed" << std::endl;
_my_ports = new Engines::DSC::uses_port(*new_uses_port);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : data_short_port_uses.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DSC_Exception.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : AdjacentFunctor.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : AdjacentPredicate.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Calcium.c
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-
+//
#include "calcium.h"
#include "calciumf.h"
#include "CalciumFortranInt.h"
#include <string.h>
#include <stddef.h>
-// Interface C de SalomeCalcium
+// Interface C de SalomeCalcium
typedef int InfoType;
typedef char bool;
+//TODO: ajouter les prototypes pour eviter les pbs de passage par valeur
+InfoType ecp_fint_ (void * component, char* nomVar, float t);
+InfoType ecp_fini_ (void * component, char* nomVar, int i);
+InfoType ecp_efft_ (void * component, char* nomVar, float t);
+InfoType ecp_effi_ (void * component, char* nomVar, int i);
/************************************/
/* INTERFACES DE LECTURE EN 0 COPIE */
char * nomvar, int bufferLength, int * nRead,
char *** data, int strSize) {
- size_t _nRead;
- long _i=*i;
- fflush(stdout);fflush(stderr);
-
- InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
- nomvar, bufferLength, &_nRead,
- data);/*, strSize );
+ size_t _nRead;
+ long _i=*i;
+ fflush(stdout);fflush(stderr);
+
+ InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
+ nomvar, bufferLength, &_nRead,
+ data);/*, strSize );
strSize est inutile pour les ports CALCIUM
qui gèrent des tailles quelconques de chaines. */
- if(mode == CP_SEQUENTIEL)
- *i = _i;
- *nRead=_nRead;
- fflush(stdout);fflush(stderr);
-
- return info;
-};
+ if(mode == CP_SEQUENTIEL)
+ *i = _i;
+ *nRead=_nRead;
+ fflush(stdout);fflush(stderr);
+ return info;
+};
void ecp_lch_free (char* * data) { \
ecp_lecture_str_free(data); \
/* long _i=*i; */
/* fflush(stdout);fflush(stderr); */
/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */
-
/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */
-
/* InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, */
/* nomvar, bufferLength, &_nRead, */
/* &data);*/
/* *nRead=_nRead; */
/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */
/* fflush(stdout);fflush(stderr); */
-
/* return info; */
/* }; */
<type de données>, <nom de l'interface C2CPP à utiliser>, <qualificateur de type optionnel des données>,<paramètres supplémentaire ignoré>)*/
CALCIUM_LECT_INTERFACE_C_(len,float ,int,int ,int2integer,,);
-/*llg ne sera pas disponible si sizeof(long) == 64 bits && cal_int==int
- sinon problème de conversion de 64bits vers 32bits */
+/*llg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_LECT_INTERFACE_C_(llg,float ,int,long ,long2integer,,);
+CALCIUM_LECT_INTERFACE_C_(lln,float ,int,long ,long,,);
+
CALCIUM_LECT_INTERFACE_C_(lre,float ,int,float ,float,,);
CALCIUM_LECT_INTERFACE_C_(ldb,double,int,double ,double,,);
-CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,);
+CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,);
CALCIUM_LECT_INTERFACE_C_(lcp,float ,int,float ,cplx,,);
#define STAR *
#define LCH_LAST_PARAM ,int strsize
CALCIUM_LECT_INTERFACE_C_(len_fort_,float ,cal_int,cal_int ,integer,,);
CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int ,int2integer,,);
-/*llg ne sera pas disponible si sizeof(long) == 64 bits && cal_int==int
- sinon problème de conversion de 64bits vers 32bits */
+/*llg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_LECT_INTERFACE_C_(llg_fort_,float ,cal_int,long ,long2integer,,);
CALCIUM_LECT_INTERFACE_C_(lre_fort_,float ,cal_int,float ,float,,);
CALCIUM_LECT_INTERFACE_C_(lcp_fort_,float ,cal_int,float ,cplx,,);
CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM );
+CALCIUM_LECT_INTERFACE_C_(lln_fort_,float ,cal_int,long ,long,,);
/**********************************************/
/* INTERFACES DE DÉBUT ET DE FIN DE COUPLAGE */
InfoType cp_fin (void * component, int code) {
/* TODO : gérer avec les callbacks des ports DSC */
-
+
InfoType info = ecp_fin_(component,code);
-
+
return info;
}
/* InfoType cp_ech(void * component, int mode, float t, int i, */
/* char * nomvar, int nbelem, */
/* char ** data, int strSize) { */
-
-/*long _i=i;*/
+
+/*long _i=i;*/
/* fflush(stdout);fflush(stderr); */
/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */
/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */
-
+
/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */
/* nomvar, nbelem, */
/* data); */
/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */
/* fflush(stdout); */
/* fflush(stderr); */
-
+
/* return info; */
/* }; */
/* Definition des méthodes calcium standard */
/* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */
CALCIUM_ECR_INTERFACE_C_(een,float ,int,int ,int2integer,,);
+/*elg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_ECR_INTERFACE_C_(elg,float ,int,long ,long2integer,,);
CALCIUM_ECR_INTERFACE_C_(ere,float ,int,float ,float,,);
CALCIUM_ECR_INTERFACE_C_(edb,double,int,double,double,,);
CALCIUM_ECR_INTERFACE_C_(ecp,float ,int,float ,cplx,,);
CALCIUM_ECR_INTERFACE_C_(ech,float ,int,char ,str,STAR,LCH_LAST_PARAM );
+CALCIUM_ECR_INTERFACE_C_(eln,float ,int,long ,long,,);
+
/* Definition des méthodes calcium destinées à l'interfaçage fortran
avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */
CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,);
+/*elg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_ECR_INTERFACE_C_(elg_fort_,float ,cal_int,long ,long2integer,,);
CALCIUM_ECR_INTERFACE_C_(ein_fort_,float ,cal_int,int ,int2integer,,);
CALCIUM_ECR_INTERFACE_C_(ere_fort_,float ,cal_int,float ,float,,);
CALCIUM_ECR_INTERFACE_C_(elo_fort_,float ,cal_int,int ,bool,,);
CALCIUM_ECR_INTERFACE_C_(ecp_fort_,float ,cal_int,float ,cplx,,);
CALCIUM_ECR_INTERFACE_C_(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM );
+
+CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,);
+
+/***************************/
+/* Interface for cleaning */
+/***************************/
+
+InfoType cp_fini (void * component, char * nomvar, int i)
+{
+ InfoType info = ecp_fini_(component,nomvar,i);
+ return info;
+}
+
+InfoType cp_fint (void * component, char * nomvar, float t)
+{
+ InfoType info = ecp_fint_(component,nomvar,t);
+ return info;
+}
+
+InfoType cp_effi (void * component, char * nomvar, int i)
+{
+ InfoType info = ecp_effi_(component,nomvar,i);
+ return info;
+}
+
+InfoType cp_efft (void * component, char * nomvar, float t)
+{
+ InfoType info = ecp_efft_(component,nomvar,t);
+ return info;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Calcium.hxx"
#include "CalciumInterface.hxx"
#include "calcium.h"
}
-extern "C"
+extern "C"
{
void cp_exit(int);
void setDependency(provides_port*, char*, CalciumTypes::DependencyType);
{
dynamic_cast<calcium_integer_port_provides *>(port)->setDependencyType(depend);
}
+ else if(std::string(type)=="CALCIUM_long")
+ {
+ dynamic_cast<calcium_long_port_provides *>(port)->setDependencyType(depend);
+ }
else if(std::string(type)=="CALCIUM_string")
{
dynamic_cast<calcium_string_port_provides *>(port)->setDependencyType(depend);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Superv_Component_i.hxx"
#include "calcium_port_factory.hxx"
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
#include "CalciumCInterface.hxx"
#include "CalciumCxxInterface.hxx"
return CalciumTypes::CPOK;
}
+// Interface for cleaning
+extern "C" CalciumTypes::InfoType
+ecp_fini_ (void * component, char* nomvar, int i)
+{
+ Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);
+ try
+ {
+ CalciumInterface::ecp_fini( *_component,nomvar,i);
+ }
+ catch ( const CalciumException & ex)
+ {
+ DEBTRACE( ex.what() );
+ return ex.getInfo();
+ }
+ return CalciumTypes::CPOK;
+
+}
+
+extern "C" CalciumTypes::InfoType
+ecp_fint_ (void * component, char* nomvar, float t)
+{
+ Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);
+ try
+ {
+ CalciumInterface::ecp_fint( *_component,nomvar,t);
+ }
+ catch ( const CalciumException & ex)
+ {
+ DEBTRACE( ex.what() );
+ return ex.getInfo();
+ }
+ return CalciumTypes::CPOK;
+}
+
+extern "C" CalciumTypes::InfoType
+ecp_effi_ (void * component, char* nomvar, int i)
+{
+ Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);
+ try
+ {
+ CalciumInterface::ecp_effi( *_component,nomvar,i);
+ }
+ catch ( const CalciumException & ex)
+ {
+ DEBTRACE( ex.what() );
+ return ex.getInfo();
+ }
+ return CalciumTypes::CPOK;
+
+}
+
+extern "C" CalciumTypes::InfoType
+ecp_efft_ (void * component, char* nomvar, float t)
+{
+ Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);
+ try
+ {
+ CalciumInterface::ecp_efft( *_component,nomvar,t);
+ }
+ catch ( const CalciumException & ex)
+ {
+ DEBTRACE( ex.what() );
+ return ex.getInfo();
+ }
+ return CalciumTypes::CPOK;
+}
+
// INTERFACE C/CPP pour les chaines de caractères
// Le paramètre supplémentaire strsize n'étant pas utilisé
// j'utilise la génération par la macro CALCIUM_C2CPP_INTERFACE_(str,char*,);
-/* Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- See http: www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
- File : CalciumInterface.hxx
- Author : Eric Fayolle (EDF)
- Module : KERNEL
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+/*
+ File : CalciumInterface.hxx
+ Author : Eric Fayolle (EDF)
+ Module : KERNEL
Modified by : $LastChangedBy$
Date : $LastChangedDate: 2007-03-01 13:27:58 +0100 (jeu, 01 mar 2007) $
Id : $Id$
/* Déclaration de ecp_fin */
extern "C" CalciumTypes::InfoType ecp_fin_ (void * component, int code);
extern "C" CalciumTypes::InfoType ecp_cd_ (void * component, char* instanceName);
+extern "C" CalciumTypes::InfoType ecp_fini_ (void * component, char* nomVar, int i);
+extern "C" CalciumTypes::InfoType ecp_fint_ (void * component, char* nomVar, float t);
+extern "C" CalciumTypes::InfoType ecp_effi_ (void * component, char* nomVar, int i);
+extern "C" CalciumTypes::InfoType ecp_efft_ (void * component, char* nomVar, float t);
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumCouplingPolicy.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumCouplingPolicy.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
template <typename DataManipulator,
class EnableIf > friend class BoundedDataIdProcessor;
template <typename DataManipulator > friend class EraseDataIdProcessor;
+ template <typename DataManipulator > friend class EraseDataIdBeforeOrAfterTagProcessor;
template <typename DataManipulator > friend class DisconnectProcessor;
typedef CalciumTypes::DependencyType DependencyType;
class EnableIf = void > struct BoundedDataIdProcessor;
//template <typename DataManipulator> struct BoundedDataIdProcessor;
template <typename DataManipulator> struct EraseDataIdProcessor;
+ template <typename DataManipulator> struct EraseDataIdBeforeOrAfterTagProcessor;
template <typename DataManipulator> struct DisconnectProcessor;
// Renvoie isEqual si le dataId attendu est trouvé dans storedDataIds :
return isEqual || isBounded;
}
+//Remove DataId before or after a given time or tag
+template < typename DataManipulator >
+struct CalciumCouplingPolicy::EraseDataIdBeforeOrAfterTagProcessor
+{
+ CalciumCouplingPolicy &_couplingPolicy;
+
+ EraseDataIdBeforeOrAfterTagProcessor(CalciumCouplingPolicy &couplingPolicy):
+ _couplingPolicy(couplingPolicy) {};
+
+ template < typename Container,typename TimeType,typename TagType >
+ void apply(Container & storedDatas, TimeType time, TagType tag, bool before) const
+ {
+ typedef typename Container::iterator iterator;
+ typedef typename Container::reverse_iterator riterator;
+
+ if(_couplingPolicy._dependencyType == CalciumTypes::TIME_DEPENDENCY)
+ {
+ if(before)
+ {
+ iterator it=storedDatas.begin();
+ while(it != storedDatas.end() && it->first.first <= time)
+ {
+ DataManipulator::delete_data(it->second);
+ storedDatas.erase(it);
+ it=storedDatas.begin();
+ }
+ }
+ else
+ {
+ riterator it=storedDatas.rbegin();
+ while(it != storedDatas.rend() && it->first.first >= time)
+ {
+ DataManipulator::delete_data(it->second);
+ storedDatas.erase(it->first);
+ it=storedDatas.rbegin();
+ }
+ }
+ }
+ else
+ {
+ if(before)
+ {
+ iterator it=storedDatas.begin();
+ while(it != storedDatas.end() && it->first.second <= tag)
+ {
+ DataManipulator::delete_data(it->second);
+ storedDatas.erase(it);
+ it=storedDatas.begin();
+ }
+ }
+ else
+ {
+ riterator it=storedDatas.rbegin();
+ while(it != storedDatas.rend() && it->first.second >= tag)
+ {
+ DataManipulator::delete_data(it->second);
+ storedDatas.erase(it->first);
+ it=storedDatas.rbegin();
+ }
+ }
+ }
+ }
+};
+
// TODO :PAS ENCORE TESTE AVEC UN NIVEAU POSITIONNE
// Supprime les DataId et les données associées
// du container associatif quand le nombre
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumCxxInterface.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
// Date : $LastChangedDate: 2007-03-01 13:27:58 +0100 (jeu, 01 mar 2007) $
// Id : $Id$
//
-
#include "CalciumCxxInterface.hxx"
#define PRG_MAIN
#include "calciumP.h"
-using namespace std;
-
namespace CalciumInterface
{
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumCxxInterface.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
Engines_DSC_interface::writeEvent("CP_CD",containerName,componentName,"","","");
}
- static void
+ static inline void
ecp_fin (Superv_Component_i & component, bool provideLastGivenValue)
{
CORBA::String_var componentName=component.instanceName();
ecp_ecriture<T1,T1> (component,dependencyType,t,i,nomVar,bufferLength,data);
};
+ static inline void
+ ecp_fini(Superv_Component_i & component,const std::string & nomVar,long const & i)
+ {
+ CORBA::String_var componentName=component.instanceName();
+ std::string containerName=component.getContainerName();
+
+ if (nomVar.empty())
+ {
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],"");
+ throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name"));
+ }
+
+ calcium_provides_port* port;
+
+ try
+ {
+ port = component.Superv_Component_i::get_port< calcium_provides_port >(nomVar.c_str());
+ }
+ catch ( const Superv_Component_i::PortNotDefined & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPNMVR,ex));
+ }
+ catch ( const Superv_Component_i::PortNotConnected & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what());
+ throw (CalciumException(CalciumTypes::CPLIEN,ex));
+ }
+ catch ( const Superv_Component_i::BadCast & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPTPVR,ex));
+ }
+
+ // get dependency mode
+ CalciumTypes::DependencyType portDependencyType = port->getDependencyType();
+
+ if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined");
+ throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined."));
+ }
+
+ if ( portDependencyType != CalciumTypes::ITERATION_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],
+ "Dependency mode must be iteration mode");
+ throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": "
+ << portDependencyType << " must be iteration mode."));
+ }
+
+ port->calcium_erase(0., i,true);
+
+ std::stringstream msg;
+ msg << "i<=" << i ;
+ Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),"",msg.str().c_str());
+
+ };
+
+ static inline void
+ ecp_fint(Superv_Component_i & component,const std::string & nomVar,double const & t)
+ {
+ CORBA::String_var componentName=component.instanceName();
+ std::string containerName=component.getContainerName();
+
+ if (nomVar.empty())
+ {
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],"");
+ throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name"));
+ }
+
+ calcium_provides_port* port;
+
+ try
+ {
+ port = component.Superv_Component_i::get_port< calcium_provides_port >(nomVar.c_str());
+ }
+ catch ( const Superv_Component_i::PortNotDefined & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPNMVR,ex));
+ }
+ catch ( const Superv_Component_i::PortNotConnected & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what());
+ throw (CalciumException(CalciumTypes::CPLIEN,ex));
+ }
+ catch ( const Superv_Component_i::BadCast & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPTPVR,ex));
+ }
+
+ // get dependency mode
+ CalciumTypes::DependencyType portDependencyType = port->getDependencyType();
+
+ if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined");
+ throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined."));
+ }
+
+ if ( portDependencyType != CalciumTypes::TIME_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],
+ "Dependency mode must be time mode");
+ throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": "
+ << portDependencyType << " must be time mode."));
+ }
+
+ port->calcium_erase(t, 0,true);
+
+ std::stringstream msg;
+ msg << "t<=" << t ;
+ Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),"",msg.str().c_str());
+
+ };
+
+ static inline void
+ ecp_effi(Superv_Component_i & component,const std::string & nomVar,long const & i)
+ {
+ CORBA::String_var componentName=component.instanceName();
+ std::string containerName=component.getContainerName();
+
+ if (nomVar.empty())
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],"");
+ throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name"));
+ }
+
+ calcium_provides_port* port;
+
+ try
+ {
+ port = component.Superv_Component_i::get_port< calcium_provides_port >(nomVar.c_str());
+ }
+ catch ( const Superv_Component_i::PortNotDefined & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPNMVR,ex));
+ }
+ catch ( const Superv_Component_i::PortNotConnected & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what());
+ throw (CalciumException(CalciumTypes::CPLIEN,ex));
+ }
+ catch ( const Superv_Component_i::BadCast & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPTPVR,ex));
+ }
+
+ // get dependency mode
+ CalciumTypes::DependencyType portDependencyType = port->getDependencyType();
+
+ if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined");
+ throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined."));
+ }
+
+ if ( portDependencyType != CalciumTypes::ITERATION_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],
+ "Dependency mode must be iteration mode");
+ throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": "
+ << portDependencyType << " must be iteration mode."));
+ }
+
+ port->calcium_erase(0., i,false);
+
+ std::stringstream msg;
+ msg << "i>=" << i ;
+ Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),"",msg.str().c_str());
+
+ };
+
+ static inline void
+ ecp_efft(Superv_Component_i & component,const std::string & nomVar,double const & t)
+ {
+ CORBA::String_var componentName=component.instanceName();
+ std::string containerName=component.getContainerName();
+
+ if (nomVar.empty())
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],"");
+ throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name"));
+ }
+
+ calcium_provides_port* port;
+
+ try
+ {
+ port = component.Superv_Component_i::get_port< calcium_provides_port >(nomVar.c_str());
+ }
+ catch ( const Superv_Component_i::PortNotDefined & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPNMVR,ex));
+ }
+ catch ( const Superv_Component_i::PortNotConnected & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what());
+ throw (CalciumException(CalciumTypes::CPLIEN,ex));
+ }
+ catch ( const Superv_Component_i::BadCast & ex)
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what());
+ throw (CalciumException(CalciumTypes::CPTPVR,ex));
+ }
+
+ // get dependency mode
+ CalciumTypes::DependencyType portDependencyType = port->getDependencyType();
+
+ if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined");
+ throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined."));
+ }
+
+ if ( portDependencyType != CalciumTypes::TIME_DEPENDENCY )
+ {
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],
+ "Dependency mode must be time mode");
+ throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": "
+ << portDependencyType << " must be time mode."));
+ }
+
+ port->calcium_erase(t, 0,false);
+
+ std::stringstream msg;
+ msg << "t>=" << t ;
+ Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),"",msg.str().c_str());
+
+ };
+
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumException.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-/* Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- See http: www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
- File : CalciumInterface.hxx
- Author : Eric Fayolle (EDF)
- Module : KERNEL
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+/*
+ File : CalciumInterface.hxx
+ Author : Eric Fayolle (EDF)
+ Module : KERNEL
Modified by : $LastChangedBy$
Date : $LastChangedDate: 2007-03-01 13:27:58 +0100 (jeu, 01 mar 2007) $
Id : $Id$
*/
+
#ifndef _CALCIUM_FORTRAN_INT_H_
#define _CALCIUM_FORTRAN_INT_H_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumGenericProvidesPort.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
virtual void provides_port_changed(int connection_nbr, \
const Engines::DSC::Message message) { \
if ( message == Engines::DSC::AddingConnection) \
- { \
- _disconnect_mutex.lock(); \
- _mustnotdisconnect++; \
- _disconnect_mutex.unlock(); \
- } \
+ { \
+ _disconnect_mutex.lock(); \
+ _mustnotdisconnect++; \
+ _disconnect_mutex.unlock(); \
+ } \
else if ( message == Engines::DSC::RemovingConnection ) \
- { \
- disconnect(false); \
- } \
+ { \
+ disconnect(false); \
+ } \
+ } \
+ \
+ inline void calcium_erase(float t,long i, bool before) \
+ { \
+ erase(t,i,before); \
} \
}; \
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumGenericUsesPort.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumInterface.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-/* Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
-Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See http: www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+/*
File : CalciumInterface.hxx
Author : Eric Fayolle (EDF)
Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumPortTraits.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CalciumProvidesPort.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
// Id : $Id$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumTypes.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
// Id : $Id$
#include "utilities.h"
#include <iostream>
-using namespace std;
-CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : map<CalciumTypes::DateCalSchem,
+CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem>()
{
- map<CalciumTypes::DateCalSchem,
+ std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem > &
- table = ( map<CalciumTypes::DateCalSchem,
+ table = ( std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem > & ) *this ;
table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ;
Ports::Calcium_Ports::DateCalSchem CORBA_DATE_CAL_SCHEM::operator[]( const CalciumTypes::DateCalSchem &c ) const
{
- map<CalciumTypes::DateCalSchem,
- Ports::Calcium_Ports::DateCalSchem > &table = (map<CalciumTypes::DateCalSchem,
+ std::map<CalciumTypes::DateCalSchem,
+ Ports::Calcium_Ports::DateCalSchem > &table = (std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem >&)*this ;
assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ;
return table[ (CalciumTypes::DateCalSchem)c ] ;
-CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map<CalciumTypes::DependencyType,
+CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType >()
{
- map<CalciumTypes::DependencyType,
+ std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > &
- table = ( map<CalciumTypes::DependencyType,
+ table = ( std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > & ) *this ;
table[CalciumTypes::TIME_DEPENDENCY ] = Ports::Calcium_Ports::TIME_DEPENDENCY ;
Ports::Calcium_Ports::DependencyType CORBA_DEPENDENCY_TYPE::operator[]( const CalciumTypes::DependencyType &c ) const
{
- map<CalciumTypes::DependencyType,
+ std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > &
- table = (map<CalciumTypes::DependencyType,
+ table = (std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType >& ) *this ;
MESSAGE("CORBA_DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c]);
-CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : map<CalciumTypes::InterpolationSchem,
+CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > ()
{
- map<CalciumTypes::InterpolationSchem,
+ std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > &
- table = ( map<CalciumTypes::InterpolationSchem,
+ table = ( std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > & ) *this ;
table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ;
Ports::Calcium_Ports::InterpolationSchem CORBA_INTERPOLATION_SCHEM::operator[]( const CalciumTypes::InterpolationSchem &c ) const
{
- map<CalciumTypes::InterpolationSchem,
+ std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > &table =
- (map<CalciumTypes::InterpolationSchem,
+ (std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem >& ) *this ;
assert( table.find( (CalciumTypes::InterpolationSchem)c ) != table.end() ) ;
-CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map<CalciumTypes::ExtrapolationSchem,
+CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > ()
{
- map<CalciumTypes::ExtrapolationSchem,
+ std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > &
- table = ( map<CalciumTypes::ExtrapolationSchem,
+ table = ( std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ;
table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ;
Ports::Calcium_Ports::ExtrapolationSchem CORBA_EXTRAPOLATION_SCHEM::operator[]( const CalciumTypes::ExtrapolationSchem &c ) const
{
- map<CalciumTypes::ExtrapolationSchem,
+ std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > &table =
- (map<CalciumTypes::ExtrapolationSchem,
+ (std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem >& ) *this ;
assert( table.find( (CalciumTypes::ExtrapolationSchem)c ) != table.end() ) ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
// Id : $Id$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CalciumTypesManipulator.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Copy2CorbaSpace.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Copy2UserSpace.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
// Id : $Id$
#include "utilities.h"
#include <iostream>
-using namespace std;
-
-DATE_CAL_SCHEM::DATE_CAL_SCHEM() : map<Ports::Calcium_Ports::DateCalSchem,
+DATE_CAL_SCHEM::DATE_CAL_SCHEM() : std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem>()
{
- map<Ports::Calcium_Ports::DateCalSchem,
+ std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem > &
- table = ( map<Ports::Calcium_Ports::DateCalSchem,
+ table = ( std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem > & ) *this ;
table[Ports::Calcium_Ports::TI_SCHEM ] = CalciumTypes::TI_SCHEM ;
CalciumTypes::DateCalSchem DATE_CAL_SCHEM::operator[]( const Ports::Calcium_Ports::DateCalSchem &c ) const
{
- map<Ports::Calcium_Ports::DateCalSchem,
- CalciumTypes::DateCalSchem> &table = (map<Ports::Calcium_Ports::DateCalSchem,
+ std::map<Ports::Calcium_Ports::DateCalSchem,
+ CalciumTypes::DateCalSchem> &table = (std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem>&)*this ;
assert( table.find( (Ports::Calcium_Ports::DateCalSchem)c ) != table.end() ) ;
return table[ (Ports::Calcium_Ports::DateCalSchem)c ] ;
-DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map<Ports::Calcium_Ports::DependencyType,
+DEPENDENCY_TYPE::DEPENDENCY_TYPE() : std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType>()
{
- map<Ports::Calcium_Ports::DependencyType,
+ std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType > &
- table = ( map<Ports::Calcium_Ports::DependencyType,
+ table = ( std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType > & ) *this ;
table[Ports::Calcium_Ports::TIME_DEPENDENCY ] = CalciumTypes::TIME_DEPENDENCY ;
CalciumTypes::DependencyType DEPENDENCY_TYPE::operator[]( const Ports::Calcium_Ports::DependencyType &c ) const
{
- map<Ports::Calcium_Ports::DependencyType,
- CalciumTypes::DependencyType> &table = (map<Ports::Calcium_Ports::DependencyType,
+ std::map<Ports::Calcium_Ports::DependencyType,
+ CalciumTypes::DependencyType> &table = (std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType>&)*this ;
MESSAGE("DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c]);
-INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : map<Ports::Calcium_Ports::InterpolationSchem,
+INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > ()
{
- map<Ports::Calcium_Ports::InterpolationSchem,
+ std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > &
- table = ( map<Ports::Calcium_Ports::InterpolationSchem,
+ table = ( std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > & ) *this ;
table[Ports::Calcium_Ports::L0_SCHEM ] = CalciumTypes::L0_SCHEM ;
CalciumTypes::InterpolationSchem INTERPOLATION_SCHEM::operator[]( const Ports::Calcium_Ports::InterpolationSchem &c ) const
{
- map<Ports::Calcium_Ports::InterpolationSchem,
+ std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem> &table =
- (map<Ports::Calcium_Ports::InterpolationSchem,
+ (std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem>& ) *this ;
assert( table.find( (Ports::Calcium_Ports::InterpolationSchem)c ) != table.end() ) ;
-EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map<Ports::Calcium_Ports::ExtrapolationSchem,
+EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > ()
{
- map<Ports::Calcium_Ports::ExtrapolationSchem,
+ std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > &
- table = ( map<Ports::Calcium_Ports::ExtrapolationSchem,
+ table = ( std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > & ) *this ;
table[Ports::Calcium_Ports::E0_SCHEM ] = CalciumTypes::E0_SCHEM ;
CalciumTypes::ExtrapolationSchem EXTRAPOLATION_SCHEM::operator[]( const Ports::Calcium_Ports::ExtrapolationSchem &c ) const
{
- map<Ports::Calcium_Ports::ExtrapolationSchem,
+ std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem> &table =
- (map<Ports::Calcium_Ports::ExtrapolationSchem,
+ (std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem>& ) *this ;
assert( table.find( (Ports::Calcium_Ports::ExtrapolationSchem)c ) != table.end() ) ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
// Id : $Id$
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF), Eric Fayolle (EDF)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium.h
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-
+//
/* Outils d'Aide au Couplage de Code de Calcul : $Id$ */
#ifndef __CALCIUM_H
#endif
);
+extern int cp_llg(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ long * /* S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_lln(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ long * /* S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
extern int cp_lre(
/* ------ */
#if CPNeedPrototype
#endif
);
+extern int cp_eln(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ long * /* E Tableau d'entiers a ecrire */
+#endif
+);
+
extern int cp_ere(
/* ------ */
#if CPNeedPrototype
#if CPNeedPrototype
void * component /* Pointeur de type Superv_Component_i* sur le */
/* composant SALOME Supervisable */,
+ char * /* E Nom de la variable (not in original CALCIUM API) */,
int /* E Tous les pas <= a cette valeur */
/* seront oublies par le coupleur */
#endif
#if CPNeedPrototype
void * component /* Pointeur de type Superv_Component_i* sur le */
/* composant SALOME Supervisable */,
+ char * /* E Nom de la variable (not in original CALCIUM API) */,
float /* E Tous les pas <= a cette valeur */
/* seront oublies par le coupleur */
#endif
-C Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+C Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
C
C Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
C CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
C
C See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
C
+
C File : version.h
C Author : Eric Fayolle (EDF)
C Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium.h
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-
+//
/* Outils d'Aide au Couplage de Code de Calcul : $Id$ */
#ifndef __CALCIUM_E_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calciumP.h
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-
+//
/* Outils d'Aide au Couplage de Code de Calcul : $Id$ */
#ifndef __CONST_H
#define __CONST_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_complex_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_destructors_port_uses.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_double_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_int_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_integer_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_logical_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_long_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_port_factory.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
#include "calcium_port_factory.hxx"
#include "Superv_Component_i.hxx"
-using namespace std;
calcium_port_factory::calcium_port_factory() {
Superv_Component_i::register_factory("CALCIUM",this);
calcium_port_factory::~calcium_port_factory() {}
provides_port *
-calcium_port_factory::create_data_servant(string type) {
+calcium_port_factory::create_data_servant(std::string type) {
provides_port * rtn_port = NULL;
if ( type == "integer")
}
uses_port *
-calcium_port_factory::create_data_proxy(string type) {
+calcium_port_factory::create_data_proxy(std::string type) {
uses_port * rtn_port = NULL;
if ( type == "integer")
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_port_factory.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-02-28 15:26:32 +0100 (Wed, 28 Feb 2007) $
// Id : $Id$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-02-28 15:26:32 +0100 (Wed, 28 Feb 2007) $
// Id : $Id$
virtual InterpolationSchem getInterpolationSchem () const =0;
virtual ExtrapolationSchem getExtrapolationSchem () const =0;
+ virtual void calcium_erase (float t,long i, bool before) {};
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_real_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_repository_types.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_string_port_uses.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_uses_port.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium_uses_port.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <string.h>
#include <stdlib.h>
#include "fortoc.h"
#include "CalciumFortranInt.h"
#include <stdio.h>
-static void* COMPO=0;
-
#ifdef __cplusplus
extern "C" {
#endif
-static void fstrtocstr(char *cstr, char *fstr,cal_int fstr_len)
+static void fstrtocstr(char *cstr, char *fstr,cal_int fstr_len)
{
cal_int i,iend;
- for (iend = fstr_len-1; iend >= 0; iend--)
+ for (iend = fstr_len-1; iend >= 0; iend--)
if (fstr[iend] != ' ') break;
for (i = 0; i <= iend; i++)
cstr[i] = fstr[i];
cstr[i] = '\0';
}
-static void cstrtofstr(char *cstr, char *fstr,cal_int fstr_len)
+static void cstrtofstr(char *cstr, char *fstr,cal_int fstr_len)
{
cal_int i, len;
len = strlen(cstr);
*err=cp_fin((void *)*compo,(int)*dep);
}
+/**************************************/
+/* ERASE INTERFACE */
+/**************************************/
+void F_FUNC(cpfini,CPFINI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom));
+void F_FUNC(cpfint,CPFINT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom));
+void F_FUNC(cpeffi,CPEFFI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom));
+void F_FUNC(cpefft,CPEFFT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom));
+
+void F_FUNC(cpfini,CPFINI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom))
+{
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+ *err=cp_fini((void *)*compo,cnom,*i);
+ free_str1(cnom);
+}
+
+void F_FUNC(cpfint,CPFINT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom))
+{
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+ *err=cp_fint((void *)*compo,cnom,*t);
+ free_str1(cnom);
+}
+
+void F_FUNC(cpeffi,CPEFFI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom))
+{
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+ *err=cp_effi((void *)*compo,cnom,*i);
+ free_str1(cnom);
+}
+
+void F_FUNC(cpefft,CPEFFT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom))
+{
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+ *err=cp_efft((void *)*compo,cnom,*t);
+ free_str1(cnom);
+}
+
/**************************************/
/* INTERFACES DE LECTURE */
/**************************************/
cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplln,CPLLN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+ cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpllo,CPLLO)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_INT
-#error "The macro SIZEOF_INT must be defined."
+#error "The macro SIZEOF_INT must be defined."
#elif SIZEOF_INT == 4
*err=cp_lin_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
#else
{
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_LONG
-#error "The macro SIZEOF_LONG must be defined."
+#error "The macro SIZEOF_LONG must be defined."
#elif SIZEOF_LONG == 8
*err=cp_llg_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
#else
free_str1(cnom);
}
+void F_FUNC(cplln,CPLLN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+ cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom))
+{
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+#if !SIZEOF_LONG
+#error "The macro SIZEOF_LONG must be defined."
+#elif SIZEOF_LONG == 8
+ *err=cp_lln_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
+#else
+ fprintf(stderr,"End of CPLLN: %s : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
+ cnom);
+#endif
+ free_str1(cnom);
+}
+
+
void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom))
{
*err=cp_lch_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tabChaine,STR_LEN(tab));
- for (index = 0; index < *n; index++)
- strncpy(&tab[index * STR_LEN(tab)], tabChaine[index], strlen(tabChaine[index]));
+ if (*err == CPOK )
+ {
+ for (index = 0; index < *n; index++)
+ {
+ strncpy(&tab[index * STR_LEN(tab)], tabChaine[index], strlen(tabChaine[index]));
+ if(STR_LEN(tab) > strlen(tabChaine[index]))
+ memset(&tab[index * STR_LEN(tab)+strlen(tabChaine[index])],' ',STR_LEN(tab)-strlen(tabChaine[index]));
+ }
+ }
- if (tabChaine != (char **) NULL) {
- for (index = 0; index < *n; index++)
- free(tabChaine[index]);
- free(tabChaine);
- }
+ if (tabChaine != (char **) NULL)
+ {
+ for (index = 0; index < *max; index++)
+ free(tabChaine[index]);
+ free(tabChaine);
+ }
free_str1(cnom);
}
/***************************/
/* INTERFACES D'ECRITURE */
/***************************/
-void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
+void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
STR_PLEN(nom) STR_PLEN(tab));
void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpeln,CPELN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpelo,CPELO)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
-void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
+void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
STR_PLEN(nom) STR_PLEN(tab))
{
char ** tabChaine=NULL;
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
tabChaine = (char **) malloc(sizeof(char *) * *n);
- for (index = 0; index < *n; index++) {
-
- tabChaine[index] = (char *) malloc(sizeof(char) * (STR_LEN(tab) + 1));
- strncpy(tabChaine[index],&tab[STR_LEN(tab) * index],STR_LEN(tab));
- tabChaine[index][STR_LEN(tab)]='\0';
- for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--) {
- if ( tabChaine[index][index2] == ' ' ||
- tabChaine[index][index2] == '\0' )
- tabChaine[index][index2]='\0';
+ for (index = 0; index < *n; index++)
+ {
+ tabChaine[index] = (char *) malloc(sizeof(char) * (STR_LEN(tab) + 1));
+ strncpy(tabChaine[index],&tab[STR_LEN(tab) * index],STR_LEN(tab));
+ tabChaine[index][STR_LEN(tab)]='\0';
+ for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--)
+ {
+ if ( tabChaine[index][index2] == ' ' || tabChaine[index][index2] == '\0' )
+ tabChaine[index][index2]='\0';
+ }
}
- }
*err=cp_ech_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tabChaine,STR_LEN(tab) );
- if (tabChaine != (char **) NULL) {
- for (index = 0; index < *n; index++)
- free(tabChaine[index]);
-
- free(tabChaine);
- }
+ if (tabChaine != (char **) NULL)
+ {
+ for (index = 0; index < *n; index++)
+ free(tabChaine[index]);
+ free(tabChaine);
+ }
free_str1(cnom);
}
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_INT
-#error "The macro SIZEOF_INT must be defined."
+#error "The macro SIZEOF_INT must be defined."
#elif SIZEOF_INT == 4
*err=cp_ein_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
#else
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_LONG
-#error "The macro SIZEOF_LONG must be defined."
+#error "The macro SIZEOF_LONG must be defined."
#elif SIZEOF_LONG == 8
*err=cp_elg_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
#else
free_str1(cnom);
}
+void F_FUNC(cpeln,CPELN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom))
+{
+
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+#if !SIZEOF_LONG
+#error "The macro SIZEOF_LONG must be defined."
+#elif SIZEOF_LONG == 8
+ *err=cp_eln_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
+#else
+ fprintf(stderr,"CPELN: %s %f %d : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
+ cnom, *ti,*iter);
+#endif
+ free_str1(cnom);
+}
+
+
void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom))
{
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : calcium.h
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-
+//
/* Outils d'Aide au Couplage de Code de Calcul : $Id$ */
#ifndef __CALCIUMF_H
CALCIUM_ECR_INTERFACE_C_H(een_fort_,float ,cal_int,cal_int,integer,,);
CALCIUM_ECR_INTERFACE_C_H(elg_fort_,float ,cal_int,long ,long2integer,,);
+CALCIUM_ECR_INTERFACE_C_H(eln_fort_,float ,cal_int,long ,long,,);
CALCIUM_ECR_INTERFACE_C_H(ein_fort_,float ,cal_int,int ,int2integer,,);
CALCIUM_ECR_INTERFACE_C_H(ere_fort_,float ,cal_int,float ,float,,);
CALCIUM_ECR_INTERFACE_C_H(edb_fort_,double,cal_int,double,double,,);
#define CALCIUM_LECT_INTERFACE_C_H(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
+ extern void cp_##_name##_free ( _type _qual * data); \
extern _calInt cp_##_name (void * component, _calInt mode, \
_timeType * ti, _timeType * tf, _calInt * i, \
char * nomvar, _calInt bufferLength, \
_calInt * nRead, _type _qual * data \
lastarg ) ; \
\
-
+
CALCIUM_LECT_INTERFACE_C_H(len_fort_,float ,cal_int,cal_int ,integer,,);
CALCIUM_LECT_INTERFACE_C_H(llg_fort_,float ,cal_int,long ,long2integer,,);
+CALCIUM_LECT_INTERFACE_C_H(lln_fort_,float ,cal_int,long ,long,,);
CALCIUM_LECT_INTERFACE_C_H(lin_fort_,float ,cal_int,int ,int2integer,,);
CALCIUM_LECT_INTERFACE_C_H(lre_fort_,float ,cal_int,float ,float,,);
CALCIUM_LECT_INTERFACE_C_H(ldb_fort_,double,cal_int,double ,double,,);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef FORTRAN_H
#define FORTRAN_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : testInterpolation.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : test_CalciumInterface.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : test_DataIdContainer.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : version.h
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-
+//
/* Outils d'Aide au Couplage de Code de Calcul : $Id$ */
#ifndef __VERSION_H
#define __VERSION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ConstTraits.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CorbaTypeManipulator.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CouplingPolicy.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
}
};
+ // Remove all DataId from a container before a given time or tag
+ template <typename DataManipulator>
+ struct EraseDataIdBeforeOrAfterTagProcessor {
+
+ EraseDataIdBeforeOrAfterTagProcessor(CouplingPolicy couplingPolicy) {};
+
+ template < typename Container , typename TimeType , typename TagType >
+ void apply(Container & storedDatas, TimeType time, TagType tag, bool before ) const {
+ typedef typename Container::key_type key_type;
+ typedef typename Container::value_type value_type;
+ typedef typename Container::iterator iterator;
+ }
+ };
+
// Permet de réveiller les méthodes d'un GenericPort en attente
// depuis une CouplingPolicy
virtual void wakeupWaiting(){};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DataIdFilter.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : DisplayPair.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : FindKeyPredicate.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : GenericPort.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
template <typename TimeType,typename TagType> DataType next(TimeType &t, TagType &tag );
void close (PortableServer::POA_var poa, PortableServer::ObjectId_var id);
void wakeupWaiting();
+ template <typename TimeType,typename TagType> void erase(TimeType time, TagType tag, bool before );
private:
}
+// erase data before time or tag
+template < typename DataManipulator, typename COUPLING_POLICY >
+template <typename TimeType,typename TagType>
+void
+GenericPort<DataManipulator, COUPLING_POLICY>::erase(TimeType time, TagType tag, bool before)
+{
+ typename COUPLING_POLICY::template EraseDataIdBeforeOrAfterTagProcessor<DataManipulator> processEraseDataId(*this);
+ processEraseDataId.apply(storedDatas,time,tag,before);
+}
// Version du Get en 0 copy
// ( n'effectue pas de recopie de la donnée trouvée dans storedDatas )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Modified by : $LastChangedBy$
// Date : $LastChangedDate: 2007-02-28 15:26:32 +0100 (Wed, 28 Feb 2007) $
// Id : $Id$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : GenericUsesPort.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : IteratorTraits.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF), Eric Fayolle (EDF)
# Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF), Eric Fayolle (EDF)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PalmCouplingPolicy.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : palm_data_seq_short_port_provides.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : palm_data_short_port_provides.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : palm_port_factory.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
#include "palm_port_factory.hxx"
#include "Superv_Component_i.hxx"
-using namespace std;
-
palm_port_factory::palm_port_factory() {
Superv_Component_i::register_factory("PALM",this);
}
palm_port_factory::~palm_port_factory() {}
provides_port *
-palm_port_factory::create_data_servant(string type) {
+palm_port_factory::create_data_servant(std::string type) {
provides_port * rtn_port = NULL;
if (type == "short") {
rtn_port = new palm_data_short_port_provides();
}
uses_port *
-palm_port_factory::create_data_proxy(string type) {
+palm_port_factory::create_data_proxy(std::string type) {
uses_port * rtn_port = NULL;
return rtn_port;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : palm_port_factory.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : test_DataIdContainer.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ProcessTimeIntervalTraits.hxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : fake.cc
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : testAdjacentFunctor.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : testAdjacentPredicate.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Superv_Component_i.cxx
// Author : André RIBES (EDF), Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Superv_Component_i.hxx
// Author : André RIBES (EDF), Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "base_port.hxx"
#include <omniORB4/CORBA.h>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : base_port.hxx
// Author : Eric Fayolle (EDF), André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : port_factory.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : provides_port.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : provides_port.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : test_DSC_Exception.cxx
// Author : Eric Fayolle (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "uses_port.hxx"
uses_port::uses_port()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : uses_port.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF)
# Module : KERNEL
#
-
SUBDIRS_COMMON = DSC_Basic
if !WINDOWS
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ParallelDSC_i.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ParallelDSC_i.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-// Copyright (C) 2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : param_double_port_provides.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-
+//
#include <iostream>
#include <string>
#include <sstream>
-// Copyright (C) 2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : param_double_port_provides.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-
+//
#ifndef _PARAM_DOUBLE_PORT_PROVIDES_HXX_
#define _PARAM_DOUBLE_PORT_PROVIDES_HXX_
-// Copyright (C) 2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : param_double_port_uses.cxx
// Author : André RIBES (EDF)
// Module : KERNEL
-
+//
#include "Param_Double_Port_uses_i.hxx"
Param_Double_Port_uses_i::Param_Double_Port_uses_i(Engines_ParallelDSC_i * par_compo,
-// Copyright (C) 2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : param_double_port_uses.hxx
// Author : André RIBES (EDF)
// Module : KERNEL
-
+//
#ifndef _PARAM_DOUBLE_PORT_USES_HXX_
#define _PARAM_DOUBLE_PORT_USES_HXX_
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_GenericObj_i_CC
// File : SALOME_GenericObj_i.cc
// Author : Alexey PETROV
#endif
using namespace SALOME;
-using namespace std;
GenericObj_i::GenericObj_i(PortableServer::POA_ptr thePOA): myRefCounter(1){
if(MYDEBUG)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_GenericObj_i_HH
// File : SALOME_GenericObj_i.hh
// Author : Alexey PETROV
# define GENERICOBJ_EXPORT
#endif
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
namespace SALOME{
class GENERICOBJ_EXPORT GenericObj_i :
public virtual POA_SALOME::GenericObj,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFOI.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Tool.cxx
// Created : Mon Oct 21 16:24:34 2002
// Author : Sergey RUIN
#include <io.h>
#include <time.h>
#include <windows.h>
+#define open _open
+#define read _read
+#define close _close
#define dir_separator '\\'
#else
#define dir_separator '/'
#endif
-using namespace std;
-
-void Move(const string& fName, const string& fNameDst);
-bool Exists(const string thePath);
+void Move(const std::string& fName, const std::string& fNameDst);
+bool Exists(const std::string thePath);
bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp);
bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp);
bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp);
void SaveGroupInASCIIfile(HDFgroup *hdf_group, FILE* fp, int ident);
void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident);
-string GetTmpDir();
+std::string GetTmpDir();
char* makeName(char* name);
char* restoreName(char* name);
void write_float64(FILE* fp, hdf_float64* value);
bool isReplace,
const char* theExtension)
{
- string aPath(thePath);
+ std::string aPath(thePath);
if(!isReplace) {
if(theExtension == NULL) aPath += ".asc";
else aPath += (char*)theExtension;
}
- string aFileName(aPath);
+ std::string aFileName(aPath);
if(isReplace) aFileName=aPath+".ascii_tmp";
HDFfile *hdf_file = new HDFfile((char*)thePath);
fprintf(fp, "%s\n", ASCIIHDF_ID);
fprintf(fp, "%i\n", nbsons+nbAttr);
- for(unsigned j=0; j<nbAttr; j++) {
+ for(int j=0; j<nbAttr; j++) {
char* attr_name = hdf_file->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(attr_name, hdf_file);
delete attr_name;
fprintf(fp, "%s %i\n", name, nbsons+nbAttr);
delete [] name;
- for(unsigned j=0; j<nbAttr; j++) {
+ for(int j=0; j<nbAttr; j++) {
name = hdf_group->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(name, hdf_group);
delete [] name;
{
hdf_dataset->OpenOnDisk();
- long size = hdf_dataset->GetSize();
+ long size = (long) hdf_dataset->GetSize();
long ndim = hdf_dataset->nDim(); //Get number of dimesions
hdf_size *dim = new hdf_size[ndim];
hdf_type type = hdf_dataset->GetType();
fprintf(fp, "\n");
- for ( unsigned j=0; j<nbAttr; j++ )
+ for ( int j=0; j<nbAttr; j++ )
{
name = hdf_dataset->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(name, hdf_dataset);
// Returns a name of directory where a created HDF file is placed
// The created file is named "hdf_from_ascii.hdf"
//============================================================================
-char* HDFascii::ConvertFromASCIIToHDF(const char* thePath)
+char* HDFascii::ConvertFromASCIIToHDF(const char* thePath,
+ bool isReplace)
{
- // Get a temporary directory to store a file
- string aTmpDir = GetTmpDir(), aFileName("hdf_from_ascii.hdf");
- // Build a full file name of temporary file
- string aFullName = aTmpDir + aFileName;
+ std::string aTmpDir, aFullName;
+ if(!isReplace) {
+ // Get a temporary directory to store a file
+ aTmpDir = GetTmpDir();
+ // Build a full file name of temporary file
+ aFullName = aTmpDir + "hdf_from_ascii.hdf";
+ }
+ else {
+ aTmpDir = thePath;
+ aFullName = std::string(thePath)+".ascii_tmp";
+ }
- HDFfile *hdf_file = new HDFfile((char*)aFullName.c_str());
- hdf_file->CreateOnDisk();
-
FILE *fp = fopen(thePath, "r");
if(!fp) return NULL;
+ HDFfile *hdf_file = new HDFfile((char*)aFullName.c_str());
+ hdf_file->CreateOnDisk();
+
char type[9];
int nbsons, i;
fscanf(fp, "%s", type);
if(strcmp(id_of_begin, GROUP_ID) == 0) {
if(!CreateGroupFromASCII(hdf_file, fp)) {
- cout << "ConvertFromASCIIToHDF : Can not create group number " << i << endl;
+ std::cout << "ConvertFromASCIIToHDF : Can not create group number " << i << std::endl;
return NULL;
}
}
else if(strcmp(id_of_begin, DATASET_ID) == 0) {
if(!CreateDatasetFromASCII(hdf_file, fp)) {
- cout << "ConvertFromASCIIToHDF :Can not create dataset number " << i << endl;
+ std::cout << "ConvertFromASCIIToHDF :Can not create dataset number " << i << std::endl;
return NULL;
}
}
else if(strcmp(id_of_begin, ATTRIBUTE_ID) == 0) {
if(!CreateAttributeFromASCII(hdf_file, fp)) {
- cout << "ConvertFromASCIIToHDF :Can not create attribute number " << i << endl;
+ std::cout << "ConvertFromASCIIToHDF :Can not create attribute number " << i << std::endl;
return NULL;
}
}
else
- cout << "ConvertFromASCIIToHDF : Unrecognized type " << id_of_begin << endl;
+ std::cout << "ConvertFromASCIIToHDF : Unrecognized type " << id_of_begin << std::endl;
}
char id_of_end[MAX_ID_SIZE];
fscanf(fp, "%s", id_of_end);
if(strcmp(id_of_end, ASCIIHDF_ID_END) != 0) {
- cout << "ConvertFromASCIIToHDF : Can not find the end ASCII token " << endl;
+ std::cout << "ConvertFromASCIIToHDF : Can not find the end ASCII token " << std::endl;
return false;
}
hdf_file->CloseOnDisk();
delete hdf_file;
+ if(isReplace) {
+ if(Exists(aFullName))
+ Move(aFullName, thePath);
+ else
+ return NULL;
+ }
+
int length = strlen(aTmpDir.c_str());
char *new_str = new char[ 1+length ];
strcpy(new_str , aTmpDir.c_str()) ;
if(strcmp(id_of_begin, GROUP_ID) == 0) {
if(!CreateGroupFromASCII(hdf_group, fp)) {
- cout << "Can not create subgroup " << i << " for group " << name << endl;
+ std::cout << "Can not create subgroup " << i << " for group " << name << std::endl;
return false;
}
}
else if(strcmp(id_of_begin, DATASET_ID) == 0) {
if(!CreateDatasetFromASCII(hdf_group, fp)) {
- cout << "Can not create dataset " << i << " for group " << name << endl;
+ std::cout << "Can not create dataset " << i << " for group " << name << std::endl;
return false;
}
}
else if(strcmp(id_of_begin, ATTRIBUTE_ID) == 0) {
if(!CreateAttributeFromASCII(hdf_group, fp)) {
- cout << "Can not create attribute " << i << " for group " << name << endl;
+ std::cout << "Can not create attribute " << i << " for group " << name << std::endl;
return false;
}
}
else
- cout << "CreateGroupFromASCII : Unrecognized type " << id_of_begin << endl;
+ std::cout << "CreateGroupFromASCII : Unrecognized type " << id_of_begin << std::endl;
}
hdf_group->CloseOnDisk();
char id_of_end[MAX_ID_SIZE];
fscanf(fp, "%s\n", id_of_end);
if(strcmp(id_of_end, GROUP_ID_END) != 0) {
- cout << "CreateGroupFromASCII : Invalid end token : " << id_of_end << endl;
+ std::cout << "CreateGroupFromASCII : Invalid end token : " << id_of_end << std::endl;
return false;
}
if(strcmp(token, ATTRIBUTE_ID) == 0) {
if(!CreateAttributeFromASCII(hdf_dataset, fp)) {
- cout << "Can not create attribute " << i << " for dataset " << name << endl;
+ std::cout << "Can not create attribute " << i << " for dataset " << name << std::endl;
return false;
}
}
else {
- cout << "CreateGroupFromASCII : Unrecognized type " << token << endl;
+ std::cout << "CreateGroupFromASCII : Unrecognized type " << token << std::endl;
return false;
}
}
fscanf(fp, "%s\n", token);
if(strcmp(token, DATASET_ID_END) != 0) {
- cout << "CreateDatasetFromASCII : Invalid end token : " << token << endl;
+ std::cout << "CreateDatasetFromASCII : Invalid end token : " << token << std::endl;
return false;
}
char id_of_end[MAX_ID_SIZE];
fscanf(fp, "%s\n", id_of_end);
if(strcmp(id_of_end, ATTRIBUTE_ID_END) != 0) {
- cout << "CreateAttributeFromASCII : Invalid end token : " << id_of_end << endl;
+ std::cout << "CreateAttributeFromASCII : Invalid end token : " << id_of_end << std::endl;
return false;
}
// function : GetTempDir
// purpose : Return a temp directory to store created files like "/tmp/sub_dir/"
//============================================================================
-string GetTmpDir()
+std::string GetTmpDir()
{
//Find a temporary directory to store a file
- string aTmpDir;
+ std::string aTmpDir;
char *Tmp_dir = getenv("SALOME_TMP_DIR");
if(Tmp_dir != NULL) {
- aTmpDir = string(Tmp_dir);
+ aTmpDir = std::string(Tmp_dir);
if(aTmpDir[aTmpDir.size()-1] != dir_separator) aTmpDir+=dir_separator;
/*#ifdef WIN32
if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\';
}
else {
#ifdef WIN32
- aTmpDir = string("C:\\");
+ aTmpDir = std::string("C:\\");
#else
- aTmpDir = string("/tmp/");
+ aTmpDir = std::string("/tmp/");
#endif
}
int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory
char buffer[127];
sprintf(buffer, "%d", aRND);
- string aSubDir(buffer);
- if(aSubDir.size() <= 1) aSubDir = string("123409876");
+ std:: string aSubDir(buffer);
+ if(aSubDir.size() <= 1) aSubDir = std::string("123409876");
aTmpDir += aSubDir; //Get RND sub directory
#endif
*/
- string aDir = aTmpDir;
+ std::string aDir = aTmpDir;
for(aRND = 0; Exists(aDir); aRND++) {
sprintf(buffer, "%d", aRND);
char* makeName(char* name)
{
- string aName(name), aNewName;
+ std::string aName(name), aNewName;
int i, length = aName.size();
char replace = (char)19;
char* restoreName(char* name)
{
- string aName(name), aNewName;
+ std::string aName(name), aNewName;
int i, length = aName.size();
char replace = (char)19;
}
}
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
return true;
}
-void Move(const string& fName, const string& fNameDst)
+void Move(const std::string& fName, const std::string& fNameDst)
{
#ifdef WIN32
MoveFileEx (fName.c_str(), fNameDst.c_str(),MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : HDFascii.hxx
// Created : Mon Jun 10 16:24:50 2003
// Author : Sergey RUIN
bool isReplaced = true,
const char* theExtension = NULL);
- static char* ConvertFromASCIIToHDF(const char* thePath);
+ static char* ConvertFromASCIIToHDF(const char* thePath,
+ bool isReplaced = false);
static bool isASCII(const char* thePath);
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFattrCreate.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFattrGetSize.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFattrGetType.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
File : HDFattrOpen.c
Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFattrRead.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFattrWrite.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFattribute.cc
// Module : SALOME
#include "HDFexception.hxx"
#include "HDFattribute.hxx"
#include "HDFinternalObject.hxx"
-using namespace std;
HDFattribute::HDFattribute(char *name,HDFinternalObject *father,hdf_type type, size_t size)
: HDFobject(name)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFattribute.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFcontainerObject.cc
// Module : SALOME
}
#include "HDFcontainerObject.hxx"
#include "HDFexception.hxx"
-using namespace std;
HDFcontainerObject::HDFcontainerObject(const char *name)
: HDFinternalObject(name)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFcontainerObject.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFconvert.cc
// Module : SALOME
//
#include "HDFconvert.hxx"
-using namespace std;
#ifdef WIN32
#include <io.h>
#include <windows.h>
+#define open _open
+#define close _close
#endif
-int HDFConvert::FromAscii(const string& file, const HDFcontainerObject & hdf_container, const string& nomdataset)
+int HDFConvert::FromAscii(const std::string& file, const HDFcontainerObject & hdf_container, const std::string& nomdataset)
{
HDFdataset * hdf_dataset;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFconvert.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFdataset.cc
// Module : SALOME
#include "HDFexception.hxx"
#include <iostream>
-using namespace std;
herr_t dataset_attr(hid_t loc_id, const char *attr_name, void *operator_data)
{
dim[i] = _dim[i];
}
-int HDFdataset::GetSize()
+hdf_size HDFdataset::GetSize()
{
int size_type;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFdataset.hxx
// Module : SALOME
hdf_type _type;
hdf_size *_dim;
hdf_byte_order _byte_order;
- int _size;
+ hdf_size _size;
int _ndim;
char* _attribute;
hdf_type GetType();
int nDim();
void GetDim(hdf_size dim[]);
- int GetSize();
+ hdf_size GetSize();
hdf_object_type GetObjectType();
hdf_byte_order GetOrder();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetClose.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetCreate.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetGetDim.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetGetOrder.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetGetSize.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetGetType.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetGetnDim.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetOpen.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetRead.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFdatasetWrite.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFerrorModeLock.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFexception.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFexplorer.cc
// Module : SALOME
#include "HDFexception.hxx"
#include "HDFinternalObject.hxx"
#include "HDFexplorer.hxx"
-using namespace std;
HDFexplorer::HDFexplorer(HDFcontainerObject *container)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFexplorer.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : HDFexport.hxx
// Author : Andre Ribes - EDF R&D
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFfile.cc
// Module : SALOME
#else
#include <io.h>
#define F_OK 0
+#define access _access
#endif
#include <string.h>
}
#include <iostream>
#include "HDFfile.hxx"
#include "HDFexception.hxx"
-using namespace std;
herr_t file_attr(hid_t loc_id, const char *attr_name, void *operator_data)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFfile.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFfileClose.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFfileCreate.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFfileMount.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFfileOpen.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFfileUmount.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFgroup.cc
// Module : SALOME
}
#include "HDFgroup.hxx"
#include "HDFexception.hxx"
-using namespace std;
herr_t group_attr(hid_t loc_id, const char *attr_name, void *operator_data)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFgroup.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFgroupClose.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFgroupCreate.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFgroupOpen.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFinternalObject.cc
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFinternalObject.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFnObjects.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFobject.cc
// Module : SALOME
#include <cstring>
#include <stdlib.h>
-using namespace std;
+
+#ifdef WNT
+#define strdup _strdup
+#endif
HDFobject::HDFobject(const char *name)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : HDFobject.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFobjectIdentify.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFobjectType.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : HDFtypes.h
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
# File : Makefile.in
# Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : hdfi.h
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : test1.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*----------------------------------------------------------------------------
SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
File : test2.c
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test3.cxx
// Module : SALOME
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test4.cxx
// Module : SALOME
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test5.cxx
// Module : SALOME
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test6.cxx
// Module : SALOME
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test7.cxx
// Module : SALOME
//
#include "HDFIO.hxx"
#include <iostream.h>
-using namespace std;
+
int main()
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test8.cxx
// Module : SALOME
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
// File : test9.cxx
// Module : SALOME
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Help.py
# Author : Paul RASCLE, EDF
# Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : PyInterp.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : batchmode_salome.py
# Module : SALOME
#import salome_shared_modules
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""
This module replaces the standard import mechanism with one
that filters some imports that can't be done more than once.
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import salome
import string
import SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""
"""
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""
This patch of omniORB is made to make it work with multiple interpreters
and to correct the problem of incomplete import of CORBA packages
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
"""
When imported this module adds to CORBA objref from GenericObj type
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome_iapp.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# $Header$
-#
## @package salome_iapp
# Module salome gives access to Salome GUI ressources (if GUI has been launched).
#
-
import salome_ComponentGUI
#--------------------------------------------------------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome_kernel.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
# File : salome_notebook.py
# Author : Roman NIKOLAEV, Open CASCADE S.A.S.
# Module : SALOME
# $Header:
+#
"""
Module salome_notebook gives access to Salome Notebook.
"""
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome_pynode.py
# Author : Christian CAREMOLI, EDF
# Module : SALOME
# $Header$
#
-
"""
When imported this module adds to CORBA proxy (from PyNode type) automatic pickle and unpickle
of arguments and results when calling execute method. It also converts the SALOME exception into a standard python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome_shared_modules.py
# Module : SALOME
#
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome_study.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME SALOME_SWIG : binding of C++ implementation and Python
# File : salome_test.py
# Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : salome_version.py
# Author : Vadim SANDLER
# Module : SALOME
#
+__ALL__ = [
+ "getVersion",
+ "getVersionMajor",
+ "getVersionMinor",
+ "getVersionRelease",
+ "getVersions",
+ "getXVersion",
+ ]
+
_salome_versions = {}
def getVersion( mod = "KERNEL" ):
pass
return [ major, minor, rel ]
+def getXVersion( mod = "KERNEL" ):
+ """
+ Get SALOME module version as list of [major, minor, release] numbers
+ Returns: version numbers list
+ """
+ major, minor, rel = getVersions( mod )
+ return hex( (major<<16) + (minor<<8) + rel )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "BatchTest.hxx"
#include "Launcher.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __BatchTest_HXX__
#define __BatchTest_HXX__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <sys/stat.h>
#include <time.h>
-using namespace std;
-
//=============================================================================
/*!
* Constructor
{
LAUNCHER_MESSAGE("Launcher_cpp destructor");
#ifdef WITH_LIBBATCH
- std::map < string, Batch::BatchManager_eClient * >::const_iterator it1;
+ std::map < std::string, Batch::BatchManager_eClient * >::const_iterator it1;
for(it1=_batchmap.begin();it1!=_batchmap.end();it1++)
delete it1->second;
std::map<int, Launcher::Job *>::const_iterator it_job;
// Creating a new job
Launcher::Job_Command * new_job = new Launcher::Job_Command();
- string cmdFile = Kernel_Utils::GetTmpFileName();
+ std::string cmdFile = Kernel_Utils::GetTmpFileName();
#ifndef WIN32
cmdFile += ".sh";
#else
cmdFile += ".bat";
#endif
- ofstream os;
- os.open(cmdFile.c_str(), ofstream::out );
- os << "#! /bin/sh" << endl;
+ std::ofstream os;
+ os.open(cmdFile.c_str(), std::ofstream::out );
+ os << "#! /bin/sh" << std::endl;
os << job_params.Command;
os.close();
#endif
ParserLauncherType
-Launcher_cpp::ParseXmlFile(string xmlExecuteFile)
+Launcher_cpp::ParseXmlFile(std::string xmlExecuteFile)
{
ParserLauncherType job_params;
SALOME_Launcher_Handler * handler = new SALOME_Launcher_Handler(job_params);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __LAUNCHER_HXX__
#define __LAUNCHER_HXX__
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#include "Launcher_Job.hxx"
#include "Launcher.hxx"
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#ifndef _LAUNCHER_JOB_HXX_
#define _LAUNCHER_JOB_HXX_
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#include "Launcher_Job_Command.hxx"
Launcher::Job_Command::Job_Command() {}
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#ifndef _LAUNCHER_JOB_COMMAND_HXX_
#define _LAUNCHER_JOB_COMMAND_HXX_
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#include "Launcher_Job_PythonSALOME.hxx"
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#ifndef _LAUNCHER_JOB_PYTHONSALOME_HXX_
#define _LAUNCHER_JOB_PYTHONSALOME_HXX_
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#include "Launcher_Job_SALOME.hxx"
Launcher::Job_SALOME::Job_SALOME() {}
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#ifndef _LAUNCHER_JOB_SALOME_HXX_
#define _LAUNCHER_JOB_SALOME_HXX_
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#include "Launcher_Job_YACSFile.hxx"
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2010 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#ifndef _LAUNCHER_JOB_YACSFILE_HXX_
#define _LAUNCHER_JOB_YACSFILE_HXX_
-// Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: André RIBES - EDF R&D
+// Author: André RIBES - EDF R&D
+//
#ifndef __LAUNCHER_UTILS_HXX__
#define __LAUNCHER_UTILS_HXX__
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
#
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_Launcher.hxx"
#include "BatchTest.hxx"
#include "OpUtil.hxx"
#include <sys/types.h>
#include <vector>
-using namespace std;
-
const char *SALOME_Launcher::_LauncherNameInNS = "/SalomeLauncher";
//=============================================================================
throw SALOME_Exception("No resources have been found with your parameters");
const Engines::ResourceDefinition* p = _ResManager->GetResourceDefinition((*aMachineList)[0]);
- string resource_name(p->name);
+ std::string resource_name(p->name);
INFOS("Choose resource for test: " << resource_name);
BatchTest t(*p);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOME_LAUNCHER_HXX__
#define __SALOME_LAUNCHER_HXX__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_Launcher.hxx"
#include "utilities.h"
#include <sstream>
#include <stdexcept>
#include <libxml/parser.h>
-using namespace std;
-
void AttachDebugger()
{
#ifndef WIN32
if(getenv ("DEBUGGER"))
{
// setsig(SIGSEGV,&Handler);
- set_terminate(&terminateHandler);
- set_unexpected(&unexpectedHandler);
+ std::set_terminate(&terminateHandler);
+ std::set_unexpected(&unexpectedHandler);
}
/* Init libxml
* To avoid memory leak, need to call xmlInitParser in the main thread
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
// File : SALOME_Laucher_Handler.cxx
// Author : Bernard Secher
#include <iostream>
#include <map>
-using namespace std;
-
//=============================================================================
/*!
* Constructor
if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
_machp.Clear();
xmlChar* name = xmlNodeGetContent(aCurNode2);
- string clusterName = (const char*)name;
+ std::string clusterName = (const char*)name;
xmlFree(name);
if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
// File : SALOME_Launcher_Handler.hxx
// Author : Bernard SECHER
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_Launcher_Parser.hxx"
#include <iostream>
#include <sstream>
#define NULL_VALUE 0
-using namespace std;
-
void MachineParameters::Clear()
{
EnvFile = "";
void MachineParameters::Print() const
{
- ostringstream oss;
+ std::ostringstream oss;
oss << " EnvFile: " << EnvFile
- << " WorkDirectory: " << WorkDirectory << endl;
+ << " WorkDirectory: " << WorkDirectory << std::endl;
- cout << oss.str();
+ std::cout << oss.str();
}
void ParserLauncherType::Print() const
{
- ostringstream oss;
- oss << endl <<
- "RefDirectory: " << RefDirectory << endl <<
- "NbOfProcesses: " << NbOfProcesses << endl <<
+ std::ostringstream oss;
+ oss << std::endl <<
+ "RefDirectory: " << RefDirectory << std::endl <<
+ "NbOfProcesses: " << NbOfProcesses << std::endl <<
"InputFile: ";
for(int i=0; i <InputFile.size();i++)
oss << InputFile[i] << " ";
- oss << endl << "OutputFile: ";
+ oss << std::endl << "OutputFile: ";
for(int i=0; i <OutputFile.size();i++)
oss << OutputFile[i] << " ";
- oss << endl <<
- "Command: " << Command << endl <<
- "Machines: " << endl;
+ oss << std::endl <<
+ "Command: " << Command << std::endl <<
+ "Machines: " << std::endl;
- cout << oss.str();
+ std::cout << oss.str();
- std::map < string, MachineParameters >::const_iterator it;
+ std::map < std::string, MachineParameters >::const_iterator it;
for(it=MachinesList.begin();it!=MachinesList.end();it++){
- cout << " " << it->first;
+ std::cout << " " << it->first;
it->second.Print();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
// File : SALOME_Launcher_Parser.hxx
// Author : Bernard Secher
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOME_LAUNCHER_DEFS_HXX__
#define __SALOME_LAUNCHER_DEFS_HXX__
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
# File : Makefile.am
# Author : Guillaume Boulant
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_FileTransferCORBA.cxx
// Author : Paul RASCLE, EDF
// Module : SALOME
#include "Basics_Utils.hxx"
#include <cstdio>
-using namespace std;
-
/*! \class SALOME_FileTransferCORBA
\brief A class to manage file transfer in SALOME (CORBA context)
*/
//=============================================================================
-SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(string refMachine,
- string origFileName,
- string containerName)
+SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(std::string refMachine,
+ std::string origFileName,
+ std::string containerName)
{
MESSAGE("SALOME_FileTransferCORBA::SALOME_FileTransferCORBA"
<< refMachine << " " << origFileName << " " << containerName);
*/
//=============================================================================
-string SALOME_FileTransferCORBA::getLocalFile(string localFile)
+std::string SALOME_FileTransferCORBA::getLocalFile(std::string localFile)
{
MESSAGE("SALOME_FileTransferCORBA::getLocalFile " << localFile);
container = _theFileRef->getContainer();
ASSERT(! CORBA::is_nil(container));
- string myMachine = Kernel_Utils::GetHostname();
- string localCopy = _theFileRef->getRef(myMachine.c_str());
+ std::string myMachine = Kernel_Utils::GetHostname();
+ std::string localCopy = _theFileRef->getRef(myMachine.c_str());
if (localCopy.empty()) // no existing copy available
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_FileTransferCORBA.hxx
// Author : Paul RASCLE, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
// File : SALOME_LifeCycleCORBA.cxx
// Author : Paul RASCLE, EDF
#include <time.h>
#ifndef WIN32
#include <sys/time.h>
+ #include <unistd.h>
#endif
#include "Basics_Utils.hxx"
#include "SALOME_NamingService.hxx"
#include "SALOME_FileTransferCORBA.hxx"
-using namespace std;
-
IncompatibleComponent::IncompatibleComponent( void ):
SALOME_Exception( "IncompatibleComponent" )
{
convert(params, new_params);
new_params.resource_params.componentList.length(1);
new_params.resource_params.componentList[0] = componentName;
- Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ Engines::ResourceList_var listOfResources;
+ try
+ {
+ listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ }
+ catch( const SALOME::SALOME_Exception& ex )
+ {
+ return Engines::Component::_nil();
+ }
Engines::Component_var compo = _FindComponent(new_params,
componentName,
new_params.resource_params.componentList.length(1);
new_params.resource_params.componentList[0] = componentName;
- Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ Engines::ResourceList_var listOfResources;
+ try
+ {
+ listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ }
+ catch( const SALOME::SALOME_Exception& ex )
+ {
+ return Engines::Component::_nil();
+ }
new_params.resource_params.resList = listOfResources;
Engines::Component_var compo = _LoadComponent(new_params,
new_params.resource_params.name = CORBA::string_dup(Kernel_Utils::GetHostname().c_str());
}
- Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ Engines::ResourceList_var listOfResources;
+ try
+ {
+ listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ }
+ catch( const SALOME::SALOME_Exception& ex )
+ {
+ return Engines::Component::_nil();
+ }
Engines::Component_var compo = _FindComponent(new_params,
componentName,
new_params.resource_params.componentList.length(1);
new_params.resource_params.componentList[0] = componentName;
- Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ Engines::ResourceList_var listOfResources;
+ try
+ {
+ listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
+ }
+ catch( const SALOME::SALOME_Exception& ex )
+ {
+ return Engines::Component::_nil();
+ }
Engines::Component_var compo = _FindComponent(new_params,
componentName,
// --- Check if containerName contains machine name (if yes: rg>0)
char *stContainer=strdup(containerName);
- string st2Container(stContainer);
+ std::string st2Container(stContainer);
int rg=st2Container.find("/");
Engines::MachineParameters_var params=new Engines::MachineParameters;
Catalog->GetComponent(componentName);
if (CORBA::is_nil (compoInfo))
{
- INFOS("Catalog Error: Component not found in the catalog" );
- INFOS( componentName );
+ MESSAGE("Catalog Error: Component not found in the catalog " << componentName);
return false;
}
else return true;
}
}
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
- // 1) SalomeLauncher
- CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher");
- Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL);
- if (!CORBA::is_nil(launcher) && (pid != launcher->getPID()))
- launcher->Shutdown();
-
- // 2) ConnectionManager
- CORBA::Object_var objCnM=_NS->Resolve("/ConnectionManager");
- Engines::ConnectionManager_var connMan=Engines::ConnectionManager::_narrow(objCnM);
- if ( !CORBA::is_nil(connMan) && ( pid != connMan->getPID() ) )
- connMan->ShutdownWithExit();
-
- // 3) SALOMEDS
- CORBA::Object_var objSDS = _NS->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ;
- if ( !CORBA::is_nil(studyManager) && ( pid != studyManager->getPID() ) )
- studyManager->Shutdown();
-
- // 4) ModuleCatalog
- CORBA::Object_var objMC=_NS->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objMC);
- if ( !CORBA::is_nil(catalog) && ( pid != catalog->getPID() ) )
- catalog->shutdown();
+ // 1) ConnectionManager
+ try
+ {
+ CORBA::Object_var objCnM=_NS->Resolve("/ConnectionManager");
+ Engines::ConnectionManager_var connMan=Engines::ConnectionManager::_narrow(objCnM);
+ if ( !CORBA::is_nil(connMan) && ( pid != connMan->getPID() ) )
+ connMan->ShutdownWithExit();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore and continue
+ }
+
+ timespec ts_req;
+ ts_req.tv_nsec=100000000;
+ ts_req.tv_sec=0;
+
+//Wait some time so that ConnectionManager be completely shutdown
+#ifndef WIN32
+ nanosleep(&ts_req,0);
+#endif
+
+ // 2) SALOMEDS
+ try
+ {
+ CORBA::Object_var objSDS = _NS->Resolve("/myStudyManager");
+ SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ;
+ if ( !CORBA::is_nil(studyManager) && ( pid != studyManager->getPID() ) )
+ studyManager->Shutdown();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore and continue
+ }
+
+//Wait some time so that study be completely shutdown
+#ifndef WIN32
+ nanosleep(&ts_req,0);
+#endif
+
+ // 3) ModuleCatalog
+ try
+ {
+ CORBA::Object_var objMC=_NS->Resolve("/Kernel/ModulCatalog");
+ SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objMC);
+ if ( !CORBA::is_nil(catalog) && ( pid != catalog->getPID() ) )
+ catalog->shutdown();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore and continue
+ }
+
+//Wait some time so that ModulCatalog be completely shutdown
+#ifndef WIN32
+ nanosleep(&ts_req,0);
+#endif
+
+ // 4) SalomeLauncher
+ try
+ {
+ CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher");
+ Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL);
+ if (!CORBA::is_nil(launcher) && (pid != launcher->getPID()))
+ launcher->Shutdown();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore and continue
+ }
+//Wait some time so that launcher be completely shutdown
+#ifndef WIN32
+ nanosleep(&ts_req,0);
+#endif
+
// 5) Registry
- CORBA::Object_var objR = _NS->Resolve("/Registry");
- Registry::Components_var registry = Registry::Components::_narrow(objR);
- if ( !CORBA::is_nil(registry) && ( pid != registry->getPID() ) )
- registry->Shutdown();
+ try
+ {
+ CORBA::Object_var objR = _NS->Resolve("/Registry");
+ Registry::Components_var registry = Registry::Components::_narrow(objR);
+ if ( !CORBA::is_nil(registry) && ( pid != registry->getPID() ) )
+ registry->Shutdown();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore and continue
+ }
// 6) Logger
int argc = 0;
void SALOME_LifeCycleCORBA::killOmniNames()
{
- string portNumber (::getenv ("NSPORT") );
+ std::string portNumber (::getenv ("NSPORT") );
if ( !portNumber.empty() )
{
#ifdef WNT
#else
- string cmd ;
- cmd = string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*")
+ std::string cmd ;
+ cmd = std::string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*")
+ portNumber
- + string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" );
+ + std::string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" );
MESSAGE(cmd);
try {
system ( cmd.c_str() );
// NPAL 18309 (Kill Notifd)
if ( !portNumber.empty() )
{
- string cmd = ("from killSalomeWithPort import killNotifdAndClean; ");
- cmd += string("killNotifdAndClean(") + portNumber + "); ";
- cmd = string("python -c \"") + cmd +"\" >& /dev/null";
+ std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; ");
+ cmd += std::string("killNotifdAndClean(") + portNumber + "); ";
+ cmd = std::string("python -c \"") + cmd +"\" >& /dev/null";
MESSAGE(cmd);
system( cmd.c_str() );
}
Engines::Container_var cont = _ContManager->GiveContainer(local_params);
if (CORBA::is_nil(cont)) return Engines::Component::_nil();
- bool isLoadable = cont->load_component_Library(componentName);
- if (!isLoadable) return Engines::Component::_nil();
+ char* reason;
+ bool isLoadable = cont->load_component_Library(componentName,reason);
+ if (!isLoadable)
+ {
+ //std::cerr << reason << std::endl;
+ CORBA::string_free(reason);
+ return Engines::Component::_nil();
+ }
+ CORBA::string_free(reason);
Engines::Component_var myInstance =
cont->create_component_instance(componentName, studyId);
}
MESSAGE("Loading component library");
- bool isLoadable = cont->load_component_Library(componentName);
+ char* reason;
+ bool isLoadable = cont->load_component_Library(componentName,reason);
if (!isLoadable) {
INFOS(componentName <<" library is not loadable !");
+ //std::cerr << reason << std::endl;
+ CORBA::string_free(reason);
return Engines::Component::_nil();
}
+ CORBA::string_free(reason);
MESSAGE("Creating component instance");
// @PARALLEL@ permits to identify that the component requested
// is a parallel component.
- string name = string(componentName);
+ std::string name = std::string(componentName);
Engines::Component_var myInstance = cont->create_component_instance(name.c_str(), studyId);
if (CORBA::is_nil(myInstance))
INFOS("create_component_instance returns a NULL component !");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
// File : SALOME_LifeCycleCORBA.hxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LifeCycleCORBATest.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "SALOME_FileTransferCORBA.hxx"
#include <string>
#include <cstdlib>
-using namespace std;
// --- uncomment to have some traces on standard error
// (useful only when adding new tests...)
// --- trace on file
const char *theFileName = TRACEFILE;
- string s = "file:";
+ std::string s = "file:";
s += theFileName;
//s="local";
//s="with_logger";
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
- ofstream traceFile;
- // traceFile.open(theFileName, ios::out | ios::trunc);
- traceFile.open(theFileName, ios::out | ios::app);
+ std::ofstream traceFile;
+ // traceFile.open(theFileName, std::ios::out | std::ios::trunc);
+ traceFile.open(theFileName, std::ios::out | std::ios::app);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
// --- get a local container,
// load an engine, check that the CORBA object is not null
- string containerName = "myContainer";
+ std::string containerName = "myContainer";
Engines::Component_var mycompo =
_LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
CPPUNIT_ASSERT(!CORBA::is_nil(mycompo));
// --- get a local container,
// load an engine, check that the CORBA object is not null
- string containerName = "myContainer";
+ std::string containerName = "myContainer";
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
// --- check equality of instance names
- string name1 = m1->instanceName();
- string name2 = m2->instanceName();
+ std::string name1 = m1->instanceName();
+ std::string name2 = m2->instanceName();
CPPUNIT_ASSERT_EQUAL(name1, name2);
}
// --- get a local container,
// load an engine, check that the CORBA object is not null
- string containerName = "myContainer";
+ std::string containerName = "myContainer";
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(containerName.c_str(),"SALOME_TestComponentPy");
// --- get a local container (with a name based on local hostname),
// load an engine, check that the CORBA object is not null
- string containerName = "myContainer";
+ std::string containerName = "myContainer";
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(containerName.c_str(),"SALOME_TestComponentPy");
// --- check equality of instance names
- string name1 = m1->instanceName();
- string name2 = m2->instanceName();
+ std::string name1 = m1->instanceName();
+ std::string name2 = m2->instanceName();
CPPUNIT_ASSERT_EQUAL(name1, name2);
}
// --- get a local container (with a name based on local hostname),
// load an engine, check that the CORBA object is not null
- string containerName = "myContainer";
+ std::string containerName = "myContainer";
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(containerName.c_str(),"MyNewComponent");
// --- get a local container (with a name based on local hostname),
// load an engine, check that the CORBA object is not null
- string containerName = Kernel_Utils::GetHostname();
+ std::string containerName = Kernel_Utils::GetHostname();
containerName += "/theContainer";
DEVTRACE("containerName = " << containerName);
Engines::Component_var mycompo =
// --- get a local container (with a name based on local hostname),
// load an engine, check that the CORBA object is not null
- string containerName = "aContainer";
+ std::string containerName = "aContainer";
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
// --- check equality of instance names
- string name1 = m1->instanceName();
- string name2 = m2->instanceName();
+ std::string name1 = m1->instanceName();
+ std::string name2 = m2->instanceName();
CPPUNIT_ASSERT_EQUAL(name1, name2);
// --- check containers are the same servant (same container name+hostname)
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
Engines::Container_var c2 = m2->GetContainerRef();
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
- string cname1 = c1->name();
- string cname2 = c2->name();
+ std::string cname1 = c1->name();
+ std::string cname2 = c2->name();
CPPUNIT_ASSERT_EQUAL(cname1, cname2);
- string hostname1 = c1->getHostName();
- string hostname2 = c2->getHostName();
+ std::string hostname1 = c1->getHostName();
+ std::string hostname2 = c2->getHostName();
CPPUNIT_ASSERT_EQUAL(hostname1, hostname2);
CORBA::Long pidc1 = c1->getPID();
CORBA::Long pidc2 = c2->getPID();
// --- try to get a distant container on an unknown machine (not existing)
// check that the CORBA object is null
- string containerName = "aFarAwayComputer";
+ std::string containerName = "aFarAwayComputer";
containerName += "/theContainer";
// CPPUNIT_ASSERT_THROW(Engines::Component_var mycompo =
// _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");,SALOME::SALOME_Exception);
catch(const SALOME::SALOME_Exception &ex)
{
CPPUNIT_ASSERT(true);
-// string expectedMessage = "BAD PARAM";
+// std::string expectedMessage = "BAD PARAM";
// std::ostream os;
// os << ex;
-// string actualMessage = os.str();
+// std::string actualMessage = os.str();
// DEVTRACE("actual Exception Message = " << actualMessage);
-// CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != string::npos);
+// CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != std::string::npos);
}
}
Engines::MachineParameters params;
_LCC.preSet(params);
- string hostname=Kernel_Utils::GetHostname();
+ std::string hostname=Kernel_Utils::GetHostname();
params.hostname=hostname.c_str();
Engines::Component_var mycompo =
_LCC.FindOrLoad_Component(params,"SalomeTestComponent");
CPPUNIT_ASSERT(!CORBA::is_nil(m1));
Engines::Container_var c1 = m1->GetContainerRef();
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
- string hostname1 = c1->getHostName();
+ std::string hostname1 = c1->getHostName();
CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname());
}
Engines::MachineParameters params;
_LCC.preSet(params);
- string containerName = "myContainer";
+ std::string containerName = "myContainer";
params.container_name = containerName.c_str();
Engines::Component_var mycompo =
_LCC.FindOrLoad_Component(params,"SalomeTestComponent");
CPPUNIT_ASSERT(!CORBA::is_nil(m1));
Engines::Container_var c1 = m1->GetContainerRef();
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
- string hostname1 = c1->getHostName();
+ std::string hostname1 = c1->getHostName();
CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname());
- string cname1 = c1->name();
- CPPUNIT_ASSERT(cname1.find(containerName) != string::npos);
+ std::string cname1 = c1->name();
+ CPPUNIT_ASSERT(cname1.find(containerName) != std::string::npos);
}
// ============================================================================
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string remoteHost = GetRemoteHost();
+ std::string remoteHost = GetRemoteHost();
- string containerName = remoteHost;
+ std::string containerName = remoteHost;
containerName += "/aContainer";
DEVTRACE("containerName = " << containerName);
Engines::Component_var mycompo1 =
CPPUNIT_ASSERT(!CORBA::is_nil(m1));
Engines::Container_var c1 = m1->GetContainerRef();
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
- string hostname1 = c1->getHostName();
+ std::string hostname1 = c1->getHostName();
CPPUNIT_ASSERT_EQUAL(hostname1, remoteHost);
}
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string remoteHost = GetRemoteHost();
+ std::string remoteHost = GetRemoteHost();
Engines::MachineParameters params;
_LCC.preSet(params);
CPPUNIT_ASSERT(!CORBA::is_nil(m1));
Engines::Container_var c1 = m1->GetContainerRef();
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
- string hostname1 = c1->getHostName();
+ std::string hostname1 = c1->getHostName();
CPPUNIT_ASSERT_EQUAL(hostname1, remoteHost);
}
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string remoteHost = GetRemoteHost();
+ std::string remoteHost = GetRemoteHost();
Engines::MachineParameters params;
_LCC.preSet(params);
CPPUNIT_ASSERT(!CORBA::is_nil(m1));
Engines::Container_var c1 = m1->GetContainerRef();
CPPUNIT_ASSERT(!CORBA::is_nil(c1));
- string hostname1 = c1->getHostName();
+ std::string hostname1 = c1->getHostName();
CPPUNIT_ASSERT_EQUAL(hostname1, remoteHost);
}
void LifeCycleCORBATest::testgetLocalFile_localComputer()
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string origFileName = getenv("KERNEL_ROOT_DIR");
+ std::string origFileName = getenv("KERNEL_ROOT_DIR");
origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0";
SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(),
origFileName);
- string local = transfer.getLocalFile();
+ std::string local = transfer.getLocalFile();
CPPUNIT_ASSERT(!local.empty());
CPPUNIT_ASSERT_EQUAL(local, origFileName);
}
void LifeCycleCORBATest::testgetLocalFile_remoteComputer()
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string origFileName = getenv("KERNEL_ROOT_DIR");
+ std::string origFileName = getenv("KERNEL_ROOT_DIR");
origFileName += "/lib/salome/libSalomeContainer.so.0.0.0";
SALOME_FileTransferCORBA transfer( GetRemoteHost(),
origFileName);
- string local = transfer.getLocalFile();
+ std::string local = transfer.getLocalFile();
CPPUNIT_ASSERT(!local.empty());
- string local2 = transfer.getLocalFile();
+ std::string local2 = transfer.getLocalFile();
CPPUNIT_ASSERT(!local2.empty());
CPPUNIT_ASSERT_EQUAL(local, local2);
}
*/
// ============================================================================
-string LifeCycleCORBATest::GetRemoteHost()
+std::string LifeCycleCORBATest::GetRemoteHost()
{
SALOME_LifeCycleCORBA _LCC(&_NS);
Engines::ResourceList_var hostList = resourcesManager->GetFittingResources(params.resource_params);
CPPUNIT_ASSERT(hostList->length() > 1);
- string localHost = Kernel_Utils::GetHostname();
- string remoteHost;
+ std::string localHost = Kernel_Utils::GetHostname();
+ std::string remoteHost;
for (unsigned int i=0; i < hostList->length(); i++)
{
const char* aMachine = hostList[i];
Engines::ResourceDefinition_var resource_definition = resourcesManager->GetResourceDefinition(aMachine);
- string machine(resource_definition->hostname.in());
+ std::string machine(resource_definition->hostname.in());
if (machine != localHost)
{
remoteHost = machine;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _LIFECYCLECORBATEST_HXX_
#define _LIFECYCLECORBATEST_HXX_
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
####################################### library
# SALOMELocalTrace : log on local machine
# File : Makefile.am
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all Unit Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import setenv
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TestContainer : test of container creation and its life cycle
// File : TestContainer.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
// File : TestLifeCycleCORBA.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
#include "utilities.h"
#include <Basics_Utils.hxx>
-using namespace std;
-
int main (int argc, char * argv[])
{
// --- get a local container,
// load an engine, and invoque methods on that engine
- string containerName = "myServer";
+ std::string containerName = "myServer";
MESSAGE("FindOrLoadComponent " + containerName + "/" + "SalomeTestComponent" );
Engines::Component_var mycompo =
// --- get another container,
// load an engine, and invoque methods on that engine
- string containerName2 = "otherServer";
+ std::string containerName2 = "otherServer";
Engines::Component_var mycompo2 =
_LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy");
m2 = Engines::TestComponent::_narrow(mycompo2);
ASSERT(!CORBA::is_nil(m2));
SCRUTE(m2->instanceName());
- cout << m2->instanceName() << endl;
+ std::cout << m2->instanceName() << std::endl;
MESSAGE("Coucou " << m2->Coucou(1L));
// --- get a third container,
ASSERT(!CORBA::is_nil(mycompo3));
Engines::TestComponent_var m3 = Engines::TestComponent::_narrow(mycompo3);
ASSERT(!CORBA::is_nil(m3));
- cout << m3->instanceName() << endl;
+ std::cout << m3->instanceName() << std::endl;
// --- yet another container, with hostname,
// load an engine, and invoque methods on that engine
- string containerName4 = Kernel_Utils::GetHostname();
+ std::string containerName4 = Kernel_Utils::GetHostname();
containerName4 += "/titiPy";
Engines::Component_var mycompo4 =
_LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy");
ASSERT(!CORBA::is_nil(mycompo4));
Engines::TestComponent_var m4 = Engines::TestComponent::_narrow(mycompo4);
ASSERT(!CORBA::is_nil(m4));
- cout << m4->instanceName() << endl;
+ std::cout << m4->instanceName() << std::endl;
// --- try a local file transfer
- string origFileName = "/home/prascle/petitfichier";
+ std::string origFileName = "/home/prascle/petitfichier";
SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(),
origFileName);
- string local = transfer.getLocalFile();
+ std::string local = transfer.getLocalFile();
SCRUTE(local);
// --- try a file transfer from another computer
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
# File : LifeCycleCORBA.py
# Author : Paul RASCLE, EDF
mem_mb, cpu_clock, nb_proc_per_node, nb_node, isMPI, workingdir,
mode, policy, parallelLib, nb_component_nodes)
+class ResourceParameters (Engines.ResourceParameters):
+ def __init__(self, name="", hostname="", OS="", componentList=[],
+ nb_proc=0, mem_mb=0, cpu_clock=0, nb_node=0, nb_proc_per_node=0,
+ policy="", resList=[]):
+ Engines.ResourceParameters.__init__(self, name, hostname, OS, componentList,
+ nb_proc, mem_mb, cpu_clock, nb_node, nb_proc_per_node,
+ policy, resList)
+
+class JobParameters (Engines.JobParameters):
+ def __init__(self, job_type="", job_file="", env_file="", in_files=[], out_files=[],
+ work_directory="", local_directory="", result_directory="", maximum_duration="",
+ resource_required=None, queue="", specific_parameters=[]):
+ Engines.JobParameters.__init__(self, job_type, job_file, env_file, in_files, out_files,
+ work_directory, local_directory, result_directory, maximum_duration,
+ resource_required, queue, specific_parameters)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : LifeCycleCORBA_SWIGTest.py
# Author : Paul RASCLE, EDF
# Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#######################################
# File : Makefile.am
# Author : Paul RASCLE (EDF)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : TestLifeCycleCORBA_SWIG.py
# Author : Paul RASCLE, EDF
# Module : SALOME
# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import unittest
import salome
# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import unittest
import salome
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#from TestLifeCycleCORBA import *
#
import os
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ----------------------------------------------------------------------------
//
%module libSALOME_LifeCycleCORBA
#define PY_SSIZE_T_MIN INT_MIN
#endif
-using namespace std;
-
//--- from omniORBpy.h (not present on Debian Sarge packages)
struct omniORBpyAPI {
// ----------------------------------------------------------------------------
-using namespace std;
-
%typemap(out) Engines::Container_ptr, Engines::Component_ptr, Engines::fileRef_ptr,
Engines::ContainerManager_ptr, Engines::ResourcesManager_ptr
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Logger : CORBA server managing trace output
# File : Makefile.am
# Author : Guillaume BOULANT, CSSI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Logger : CORBA server managing trace output
// File : SALOME_Logger_Server.cxx
// Author : Vasily Rusyaev
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Logger : CORBA server managing trace output
// File : SALOME_Logger_Server.hxx
// Author : Vasily Rusyaev
# define LOGGER_EXPORT
#endif
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#endif
class LOGGER_EXPORT Logger :
public POA_SALOME_Logger::Logger
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Logger : CORBA server managing trace output
// File : SALOME_Logger_Server.cxx
// Author : Vasily Rusyaev
orb->run() ;
orb->destroy() ;
}
- catch(CORBA::COMM_FAILURE& ex)
+ catch(CORBA::COMM_FAILURE&)
{
std::cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
<< "object." << std::endl;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Logger : CORBA server managing trace output
// File : SALOME_Logger.cxx
// Author : Vasily Rusyaev
//#include <stdio.h>
#include <stdlib.h>
#include <iostream>
-using namespace std;
#ifdef WIN32
#include <omnithread/pthread_nt.h>
}
if (CORBA::is_nil(inc)) {
- cout<<"SALOME_Trace can not find NameService"<<endl;
+ std::cout<<"SALOME_Trace can not find NameService"<<std::endl;
return 0;
}
}
}
if (CORBA::is_nil(m_pInterfaceLogger)) {
- cout<<"SALOME_Trace can not find Logger"<<endl;
+ std::cout<<"SALOME_Trace can not find Logger"<<std::endl;
return 0;
}
}
return 1;
}
-void SALOME_Trace::putMessage(ostream& msg)
+void SALOME_Trace::putMessage(std::ostream& msg)
{
- //if (!isInitialized) cout<<"!!! SALOME_Trace is used without initialising !!!"<<endl;
+ //if (!isInitialized) std::cout<<"!!! SALOME_Trace is used without initialising !!!"<<std::endl;
//write resulting string into Logger CORBA server
//concatenate string from passing parameters for transfering into Logger CORBA server
- //cerr << "-+- " << msg << " ";
+ //std::cerr << "-+- " << msg << " ";
// CORBA::String_var LogMsg = CORBA::string_dup( str() );
//Allow automatic deletion of ostrstream content
seekp(0);
if (CORBA::is_nil(m_pInterfaceLogger))
- cout << LogMsg;
+ std::cout << LogMsg;
else
m_pInterfaceLogger-> putMessage (LogMsg) ;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Logger : CORBA server managing trace output
// File : SALOME_Trace.cxx
// Author : Vasily Rusyaev
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Logger : CORBA server managing trace output
# File : SALOME_Trace.py
# Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Logger: CORBA Logger Server
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
def killNamingService():
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME MPIContainer : implemenation of container based on MPI libraries
// File : MPIContainer_i.cxx
// Module : SALOME
#include <pthread.h> // must be before Python.h !
#include <Python.h>
#include "Container_init_python.hxx"
-using namespace std;
// L'appel au registry SALOME ne se fait que pour le process 0
Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc,
_NS = new SALOME_NamingService();
_NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ;
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
_containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str());
SCRUTE(_containerName);
_NS->Register(pCont, _containerName.c_str());
}
// Load a component library
-bool Engines_MPIContainer_i::load_component_Library(const char* componentName)
+bool Engines_MPIContainer_i::load_component_Library(const char* componentName, CORBA::String_out reason)
{
+ reason=CORBA::string_dup("");
+
pthread_t *th;
if(_numproc == 0){
th = new pthread_t[_nbproc];
bool Engines_MPIContainer_i::Lload_component_Library(const char* componentName)
{
- string aCompName = componentName;
+ std::string aCompName = componentName;
// --- try dlopen C++ component
- string impl_name = string ("lib") + aCompName + string("Engine.so");
+ std::string impl_name = std::string ("lib") + aCompName + std::string("Engine.so");
_numInstanceMutex.lock(); // lock to be alone
// (see decInstanceCnt, finalize_removal))
// Create an instance of component
Engines::Component_ptr
-Engines_MPIContainer_i::create_component_instance( const char* componentName,
- CORBA::Long studyId)
+Engines_MPIContainer_i::create_component_instance_env( const char* componentName,
+ CORBA::Long studyId,
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason)
{
+ reason=CORBA::string_dup("");
+
pthread_t *th;
if(_numproc == 0){
th = new pthread_t[_nbproc];
Engines::Component_var iobject = Engines::Component::_nil() ;
Engines::MPIObject_var pobj;
- string aCompName = genericRegisterName;
+ std::string aCompName = genericRegisterName;
if (_library_map[aCompName]) { // Python component
if (_isSupervContainer) {
INFOS("Supervision Container does not support Python Component Engines");
char aNumI[12];
sprintf( aNumI , "%d" , numInstance ) ;
- string instanceName = aCompName + "_inst_" + aNumI ;
- string component_registerName =
+ std::string instanceName = aCompName + "_inst_" + aNumI ;
+ std::string component_registerName =
_containerName + "/" + instanceName;
Py_ACQUIRE_NEW_THREAD;
aCompName.c_str(),
instanceName.c_str(),
studyId);
- string iors = PyString_AsString(result);
+ const char *ior;
+ const char *error;
+ PyArg_ParseTuple(result,"ss", &ior, &error);
+ std::string iors = ior;
SCRUTE(iors);
Py_RELEASE_NEW_THREAD;
//--- try C++
- string impl_name = string ("lib") + genericRegisterName +string("Engine.so");
+ std::string impl_name = std::string ("lib") + genericRegisterName +std::string("Engine.so");
if (_library_map.count(impl_name) != 0) // C++ component
{
void* handle = _library_map[impl_name];
}
Engines::Component_ptr
-Engines_MPIContainer_i::createMPIInstance(string genericRegisterName,
+Engines_MPIContainer_i::createMPIInstance(std::string genericRegisterName,
void *handle,
int studyId)
{
Engines::MPIObject_var pobj;
// --- find the factory
- string aGenRegisterName = genericRegisterName;
- string factory_name = aGenRegisterName + string("Engine_factory");
+ std::string aGenRegisterName = genericRegisterName;
+ std::string factory_name = aGenRegisterName + std::string("Engine_factory");
typedef PortableServer::ObjectId * (*MPIFACTORY_FUNCTION)
(int,int,
char aNumI[12];
sprintf( aNumI , "%d" , numInstance ) ;
- string instanceName = aGenRegisterName + "_inst_" + aNumI ;
- string component_registerName =
+ std::string instanceName = aGenRegisterName + "_inst_" + aNumI ;
+ std::string component_registerName =
_containerName + "/" + instanceName;
// --- Instanciate required CORBA object
BCastIOR(_orb,pobj,false);
}
- catch(const POException &ex){
- INFOS( ex.msg << " on process number " << ex.numproc ) ;
- return Engines::Component::_nil();
- }
- catch (...){
- INFOS( "Container_i::createInstance exception catched" ) ;
+ catch(const std::exception &ex){
+ INFOS( ex.what() ) ;
return Engines::Component::_nil();
}
return iobject._retn();
char _aNumI[12];
sprintf(_aNumI,"%d",_numInstance) ;
- string _impl_name = componentName;
- string _nameToRegister = nameToRegister;
- string instanceName = _nameToRegister + "_inst_" + _aNumI + cproc;
+ std::string _impl_name = componentName;
+ std::string _nameToRegister = nameToRegister;
+ std::string instanceName = _nameToRegister + "_inst_" + _aNumI + cproc;
MESSAGE("[" << _numproc << "] instanceName=" << instanceName);
- string absolute_impl_name(_impl_name);
+ std::string absolute_impl_name(_impl_name);
MESSAGE("[" << _numproc << "] absolute_impl_name=" << absolute_impl_name);
void * handle = dlopen(absolute_impl_name.c_str(), RTLD_LAZY);
if(!handle){
return Engines::Component::_nil() ;
}
- string factory_name = _nameToRegister + string("Engine_factory");
+ std::string factory_name = _nameToRegister + std::string("Engine_factory");
MESSAGE("[" << _numproc << "] factory_name=" << factory_name) ;
dlerror();
if( _numproc == 0 ){
// utiliser + tard le registry ici :
// register the engine under the name containerName.dir/nameToRegister.object
- string component_registerName = _containerName + "/" + _nameToRegister;
+ std::string component_registerName = _containerName + "/" + _nameToRegister;
_NS->Register(iobject, component_registerName.c_str()) ;
}
}
ASSERT(! CORBA::is_nil(component_i));
- string instanceName = component_i->instanceName() ;
+ std::string instanceName = component_i->instanceName() ;
MESSAGE("[" << _numproc << "] unload component " << instanceName);
_numInstanceMutex.lock() ; // lock on the remove on handle_map
_listInstances_map.erase(instanceName);
_numInstanceMutex.lock(); // lock to be alone
// (see decInstanceCnt, load_component_Library)
- map<string, void *>::iterator ith;
+ std::map<std::string, void *>::iterator ith;
for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++)
{
void *handle = (*ith).second;
- string impl_name= (*ith).first;
+ std::string impl_name= (*ith).first;
if (handle)
{
SCRUTE(handle);
void *th_loadcomponentlibrary(void *s)
{
thread_st *st = (thread_st*)s;
- (Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->load_component_Library(st->compoName.c_str());
+ char* reason;
+ (Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->load_component_Library(st->compoName.c_str(),reason);
+ CORBA::string_free(reason);
return NULL;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME MPIContainer : implemenation of container based on MPI libraries
// File : MPIContainer_i.hxx
// Module : SALOME
// Load a component library
// synchronous version for process 0
- bool load_component_Library(const char* componentName);
+ bool load_component_Library(const char* componentName, CORBA::String_out reason);
// Create an instance of component
// synchronous version for process 0
- Engines::Component_ptr
- create_component_instance( const char* componentName,
- CORBA::Long studyId); // 0 for multiStudy
+ virtual Engines::Component_ptr
+ create_component_instance_env( const char* componentName,
+ CORBA::Long studyId, // 0 for multiStudy
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason);
// Load a component in current MPI container
// synchronous version for process 0
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME MPIContainer : implemenation of container based on MPI libraries
// File : MPIObject_i.cxx
// Module : SALOME
//
#include "MPIObject_i.hxx"
#include "utilities.h"
-using namespace std;
+#include "Utils_SALOME_Exception.hxx"
+
#define TIMEOUT 5
MPIObject_i::MPIObject_i()
int err, ip, n;
char *ior;
MPI_Status status; /* status de reception de message MPI */
+ std::ostringstream msg;
- if( _numproc == 0 ){
-
- //Allocation du tableau des IOR
- Engines::IORTab_var iort = new Engines::IORTab;
- iort->length(_nbproc);
-
- iort[0] = pobj;
-
- // Process 0 recupere les ior de l'object sur les autres process
- for(ip=1;ip<_nbproc;ip++){
- err = MPI_Recv(&n,1,MPI_INT,ip,ip,MPI_COMM_WORLD,&status);
- if(err){
- MESSAGE("[" << _numproc << "] MPI_RECV error");
- exit(1);
- }
- // Allocation de la chaine de longueur n
- ior = new char[n];
- err = MPI_Recv(ior,n,MPI_CHAR,ip,2*ip,MPI_COMM_WORLD,&status);
- if(err){
- MESSAGE("[" << _numproc << "] MPI_RECV error");
- exit(1);
- }
- iort[ip] = orb->string_to_object(ior);
- delete [] ior;
- if(CORBA::is_nil(iort[ip]))
- throw POException(ip,"MPI Component not loaded");
- }
- // On donne le tableau des ior a l'objet Corba du process 0
- if( amiCont )
- tior(*(iort._retn()));
- else
- pobj->tior(*(iort._retn()));
- }
- else{
- // Conversion IOR vers string
- ior = orb->object_to_string(pobj);
- n = strlen(ior) + 1;
- // On envoie l'IOR au process 0
- err = MPI_Send(&n,1,MPI_INT,0,_numproc,MPI_COMM_WORLD);
- if(err){
- MESSAGE("[" << _numproc << "] MPI_SEND error");
- exit(1);
+ if( _numproc == 0 )
+ {
+
+ //Allocation du tableau des IOR
+ Engines::IORTab_var iort = new Engines::IORTab;
+ iort->length(_nbproc);
+
+ iort[0] = pobj;
+
+ // Process 0 recupere les ior de l'object sur les autres process
+ for(ip=1;ip<_nbproc;ip++)
+ {
+ err = MPI_Recv(&n,1,MPI_INT,ip,ip,MPI_COMM_WORLD,&status);
+ if(err)
+ {
+ msg << "[" << _numproc << "] MPI_RECV error";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+ // Allocation de la chaine de longueur n
+ ior = new char[n];
+ err = MPI_Recv(ior,n,MPI_CHAR,ip,2*ip,MPI_COMM_WORLD,&status);
+ if(err)
+ {
+ msg << "[" << _numproc << "] MPI_RECV error";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+ iort[ip] = orb->string_to_object(ior);
+ delete [] ior;
+ if(CORBA::is_nil(iort[ip]))
+ {
+ msg << "[" << ip << "] MPI Component not loaded";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+ }
+ // On donne le tableau des ior a l'objet Corba du process 0
+ if( amiCont )
+ tior(*(iort._retn()));
+ else
+ pobj->tior(*(iort._retn()));
}
- err = MPI_Send(ior,n,MPI_CHAR,0,2*_numproc,MPI_COMM_WORLD);
- if(err){
- MESSAGE("[" << _numproc << "] MPI_SEND error");
- exit(1);
+ else
+ {
+ // Conversion IOR vers string
+ ior = orb->object_to_string(pobj);
+ n = strlen(ior) + 1;
+ // On envoie l'IOR au process 0
+ err = MPI_Send(&n,1,MPI_INT,0,_numproc,MPI_COMM_WORLD);
+ if(err)
+ {
+ msg << "[" << _numproc << "] MPI_SEND error";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+ err = MPI_Send(ior,n,MPI_CHAR,0,2*_numproc,MPI_COMM_WORLD);
+ if(err)
+ {
+ msg << "[" << _numproc << "] MPI_SEND error";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+ CORBA::string_free(ior);
}
- CORBA::string_free(ior);
- }
-
+
}
#ifdef HAVE_MPI2
-void MPIObject_i::remoteMPI2Connect(string service)
+void MPIObject_i::remoteMPI2Connect(std::string service)
{
int i;
char port_name[MPI_MAX_PORT_NAME];
char port_name_clt[MPI_MAX_PORT_NAME];
+ std::ostringstream msg;
- if( service.size() == 0 ){
- MESSAGE("[" << _numproc << "] You have to give a service name !");
- throw POException(_numproc,"You have to give a service name !");
- }
+ if( service.size() == 0 )
+ {
+ msg << "[" << _numproc << "] You have to give a service name !";
+ throw SALOME_Exception(msg.str().c_str());
+ }
- if( _srv.find(service) != _srv.end() ){
- MESSAGE("[" << _numproc << "] service " << service << " already exist !");
- throw POException(_numproc,"service " + service + " already exist !");
- }
+ if( _srv.find(service) != _srv.end() )
+ {
+ msg << "[" << _numproc << "] service " << service << " already exist !";
+ throw SALOME_Exception(msg.str().c_str());
+ }
_srv[service] = false;
MPI_Barrier(MPI_COMM_WORLD);
MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
- if( _numproc == 0 ){
- /* rank 0 try to be a server. If service is already published, try to be a cient */
- MPI_Open_port(MPI_INFO_NULL, port_name);
- if ( MPI_Publish_name((char*)service.c_str(), MPI_INFO_NULL, port_name) == MPI_SUCCESS ) {
- _srv[service] = true;
- _port_name[service] = port_name;
- MESSAGE("[" << _numproc << "] service " << service << " available at " << port_name << endl);
- }
- else if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ){
- MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl);
- MPI_Close_port( port_name );
- }
- else{
- /* Throw exception */
- MESSAGE("[" << _numproc << "] Error on connection with " << service << " at " << port_name_clt << endl);
- throw POException(_numproc,"Error on connection with " + service + " at " + port_name_clt);
+ if( _numproc == 0 )
+ {
+ /* rank 0 try to be a server. If service is already published, try to be a cient */
+ MPI_Open_port(MPI_INFO_NULL, port_name);
+ if ( MPI_Publish_name((char*)service.c_str(), MPI_INFO_NULL, port_name) == MPI_SUCCESS )
+ {
+ _srv[service] = true;
+ _port_name[service] = port_name;
+ MESSAGE("[" << _numproc << "] service " << service << " available at " << port_name << std::endl);
+ }
+ else if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS )
+ {
+ MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << std::endl);
+ MPI_Close_port( port_name );
+ }
+ else
+ {
+ msg << "[" << _numproc << "] Error on connection with " << service << " at " << port_name_clt;
+ throw SALOME_Exception(msg.str().c_str());
+ }
}
- }
- else{
- i=0;
- /* Waiting rank 0 publish name and try to be a client */
- while ( i != TIMEOUT ) {
- sleep(1);
- if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ){
- MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl);
- break;
- }
- i++;
- }
- if(i==TIMEOUT){
- /* Throw exception */
- MESSAGE("[" << _numproc << "] Error on connection with " << service << " at " << port_name_clt << endl);
- throw POException(_numproc,"Error on connection with " + service + " at " + port_name_clt);
+ else
+ {
+ i=0;
+ /* Waiting rank 0 publish name and try to be a client */
+ while ( i != TIMEOUT )
+ {
+ sleep(1);
+ if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS )
+ {
+ MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << std::endl);
+ break;
+ }
+ i++;
+ }
+ if(i==TIMEOUT)
+ {
+ msg << "[" << _numproc << "] Error on connection with " << service << " at " << port_name_clt;
+ throw SALOME_Exception(msg.str().c_str());
+ }
}
- }
MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
/* If rank 0 is server, all processes call MPI_Comm_accept */
void MPIObject_i::remoteMPI2Disconnect(std::string service)
{
+ std::ostringstream msg;
- if( service.size() == 0 ){
- MESSAGE("[" << _numproc << "] You have to give a service name !");
- throw POException(_numproc,"You have to give a service name !");
- }
-
- if( _srv.find(service) == _srv.end() ){
- MESSAGE("[" << _numproc << "] service " << service << " don't exist !");
- throw POException(_numproc,"service " + service + " don't exist !");
- }
+ if( service.size() == 0 )
+ {
+ msg << "[" << _numproc << "] You have to give a service name !";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+ if( _srv.find(service) == _srv.end() )
+ {
+ msg << "[" << _numproc << "] service " << service << " don't exist !";
+ throw SALOME_Exception(msg.str().c_str());
+ }
+
MPI_Comm_disconnect( &(_gcom[service]) );
- if ( _srv[service] ) {
-
- char port_name[MPI_MAX_PORT_NAME];
- strcpy(port_name,_port_name[service].c_str());
+ if ( _srv[service] )
+ {
- MPI_Unpublish_name((char*)service.c_str(), MPI_INFO_NULL, port_name);
- MESSAGE("[" << _numproc << "] " << service << ": close port " << _port_name[service] << endl);
- MPI_Close_port( port_name );
- _port_name.erase(service);
- }
+ char port_name[MPI_MAX_PORT_NAME];
+ strcpy(port_name,_port_name[service].c_str());
+ MPI_Unpublish_name((char*)service.c_str(), MPI_INFO_NULL, port_name);
+ MESSAGE("[" << _numproc << "] " << service << ": close port " << _port_name[service] << std::endl);
+ MPI_Close_port( port_name );
+ _port_name.erase(service);
+ }
+
_gcom.erase(service);
_icom.erase(service);
_srv.erase(service);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME MPIContainer : implemenation of container based on MPI libraries
// File : MPIObject_i.hxx
// Module : SALOME
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_MPIObject)
-class POException
-{
-public:
- const std::string msg;
- const int numproc;
- POException(const int ip,const std::string m) : numproc(ip),msg(m) {}
-};
-
-class MPIObject_i: public POA_Engines::MPIObject
+class MPIObject_i: public virtual POA_Engines::MPIObject
{
public:
MPIObject_i();
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME MPIContainer : implemenation of container based on MPI libraries
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
#
bin_PROGRAMS = SALOME_MPIContainer
SALOME_MPIContainer_SOURCES = SALOME_MPIContainer.cxx
-SALOME_MPIContainer_LDADD = libSalomeMPIContainer.la @PYTHON_LIBS@ @MPI_LIBS@
+SALOME_MPIContainer_LDADD = libSalomeMPIContainer.la $(COMMON_LIBS) @PYTHON_LIBS@ @MPI_LIBS@
SALOME_MPIContainer_CPPFLAGS = $(COMMON_CPPFLAGS)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <mpi.h>
#include <iostream>
#include "MPIContainer_i.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "utilities.h"
-using namespace std;
int main(int argc, char* argv[])
{
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : PathPrefix.hxx
// Author : Estelle Deville
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_ModuleCatalog.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Acomponent_impl.cxx
// Author : Estelle Deville
#include "utilities.h"
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
if (!_find)
{
// The interface was not found, the exception should be thrown
- string message = "The interface";
+ std::string message = "The interface";
message += interfacename;
message += " of the component ";
message += _Component.name;
if (!_find)
{
// The interface was not found, the exception should be thrown
- string message = "The interface";
+ std::string message = "The interface";
message += interfacename;
message += " of the component ";
message += _Component.name;
if (!_find)
{
// The interface was not found, the exception should be thrown
- string message = "The service";
+ std::string message = "The service";
message += servicename;
message += " of the interface ";
message += interfacename;
if (!_find)
{
// The service was not found, the exception should be thrown
- string message = "The default service of the interface ";
+ std::string message = "The default service of the interface ";
message += interfacename;
message += " of the component ";
message += _Component.name;
if (!_find)
{
// The computer was not found, the exception should be thrown
- string message = "The computer ";
+ std::string message = "The computer ";
message += machinename;
message += " was not found in the catalog associated to the component ";
message += _Component.name;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Acomponent_impl.hxx
// Author : Estelle Deville
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
class MODULECATALOG_EXPORT SALOME_ModuleCatalog_AcomponentImpl: public POA_SALOME_ModuleCatalog::Acomponent
{
public:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Client.cxx
// Module : SALOME
#include "SALOME_ModuleCatalog.hh"
#include <string>
#include "utilities.h"
-using namespace std;
void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName,
- const string & ServiceName);
+ const std::string & InterfaceName,
+ const std::string & ServiceName);
void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName);
+ const std::string & InterfaceName);
void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C);
}
catch(SALOME_ModuleCatalog::NotFound &ex){
INFOS("SALOME_ModuleCatalog::NotFound")
- cerr << ex.what << endl;
+ std::cerr << ex.what << std::endl;
}
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.")
INFOS("CosNaming::NamingContext::NotEmpty")
}
- catch(CORBA::Exception &sysEx) {
+ catch(CORBA::Exception &) {
INFOS("Caught CORBA::Exception.")
}
void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName)
+ const std::string & InterfaceName)
{
unsigned int i, n;
}
void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName,
- const string & ServiceName)
+ const std::string & InterfaceName,
+ const std::string & ServiceName)
{
int i, n;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Handler.cxx
// Author : Estelle Deville
#include "utilities.h"
#include <sstream>
-using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 0;
// Tag test_component_multistudy
if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
- _aModule.multistudy = atoi( aContent.c_str() );
+ _aModule.multistudy = atoi( aContent.c_str() ) != 0;
// Tag test_component_impltype
if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
// Tag test_defaultservice
if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) )
- _aService.byDefault = (const char*)aCompServiceData;
+ _aService.byDefault = atoi((const char*)aCompServiceData) !=0 ;
// Tag test_typeofnode
if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) )
- _aService.typeOfNode = (const char*)aCompServiceData;
+ _aService.typeOfNode = atoi((const char*)aCompServiceData) !=0 ;
xmlFree(aCompServiceData);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Handler.hxx
// Author : Estelle Deville
#include <libxml/parser.h>
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
class MODULECATALOG_EXPORT SALOME_ModuleCatalog_Handler
{
public:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Parser.hxx
// Author : Estelle Deville
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Parser_IO.cxx
// Author : Estelle Deville
#include <iostream>
#include "utilities.h"
-using namespace std;
-
std::ostream & operator<< (std::ostream & f, const ParserParameter & P)
{
f << " name : " << P.name << std::endl;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Parser_IO.hxx
// Author : Marc Tajchman
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Server.cxx
// Module : SALOME
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
-using namespace std;
int main(int argc,char **argv)
{
//
long TIMESleep = 500000000;
int NumberOfTries = 40;
+#ifndef WIN32
int a;
+#endif
timespec ts_req;
ts_req.tv_nsec=TIMESleep;
ts_req.tv_sec=0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_impl.cxx
// Author : Estelle Deville
# include <process.h>
#endif
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static const char* OLD_SEPARATOR = ":";
-list<string> splitStringToList(const string& theString, const string& theSeparator)
+std::list<std::string> splitStringToList(const std::string& theString, const std::string& theSeparator)
{
- list<string> aList;
+ std::list<std::string> aList;
int sepLen = theSeparator.length();
int startPos = 0, sepPos = theString.find(theSeparator, startPos);
while (1)
{
- string anItem ;
- if(sepPos != string::npos)
+ std::string anItem ;
+ if(sepPos != std::string::npos)
anItem = theString.substr(startPos, sepPos - startPos);
else
anItem = theString.substr(startPos);
if (anItem.length() > 0)
aList.push_back(anItem);
- if(sepPos == string::npos)
+ if(sepPos == std::string::npos)
break;
startPos = sepPos + sepLen;
sepPos = theString.find(theSeparator, startPos);
// Affect the _general_module_list and _general_path_list members
// with the common catalog
- list<string> dirList;
+ std::list<std::string> dirList;
#ifdef WIN32
dirList = splitStringToList(_general_path, SEPARATOR);
#else
//check for new format
- bool isNew = (std::string( _general_path ).find(SEPARATOR) != string::npos);
+ bool isNew = (std::string( _general_path ).find(SEPARATOR) != std::string::npos);
if ( isNew ) {
//using new format
dirList = splitStringToList(_general_path, SEPARATOR);
}
#endif
- for (list<string>::iterator iter = dirList.begin(); iter != dirList.end(); iter++)
+ for (std::list<std::string>::iterator iter = dirList.begin(); iter != dirList.end(); iter++)
{
- string aPath = (*iter);
+ std::string aPath = (*iter);
//remove inverted commas from filename
- while (aPath.find('\"') != string::npos)
+ while (aPath.find('\"') != std::string::npos)
aPath.erase(aPath.find('\"'), 1);
_parse_xml_file(aPath.c_str(),
SALOME_ModuleCatalog::ListOfTypeDefinition_var type_list = new SALOME_ModuleCatalog::ListOfTypeDefinition();
type_list->length(_typeList.size());
- for (int ind = 0 ; ind < _typeList.size() ; ind++)
+ for (unsigned int ind = 0 ; ind < _typeList.size() ; ind++)
{
//no real need to call string_dup, omniorb calls it on operator= (const char *) but it is safer
type_list[ind].name=CORBA::string_dup(_typeList[ind].name.c_str());
}
ParserComponent *
-SALOME_ModuleCatalogImpl::findComponent(const string & name)
+SALOME_ModuleCatalogImpl::findComponent(const std::string & name)
{
ParserComponent * C_parser = NULL;
SALOME_ModuleCatalogImpl::_verify_path_prefix(ParserPathPrefixes & pathList)
{
bool _return_value = true;
- vector<string> _machine_list;
+ std::vector<std::string> _machine_list;
// Fill a list of all computers indicated in the path list
for (unsigned int ind = 0; ind < pathList.size(); ind++)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_impl.hxx
// Author : Estelle Deville
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
class MODULECATALOG_EXPORT SALOME_ModuleCatalogImpl: public POA_SALOME_ModuleCatalog::ModuleCatalog
{
public:
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import batchmode_salome
import SALOME_ModuleCatalog
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : IDLparser.py
# Module : SALOME
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : AddComponent.idl
// Author : Jean Rahuel
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SubComponent.idl
// Author : Jean Rahuel
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : AddComponent.idl
// Author :
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : AddComponent.idl
// Author :
// Module : SALOME
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test1.sh
# Module : SALOME
#
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test1b.sh
# Module : SALOME
#
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test2.sh
# Module : SALOME
#
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test3.sh
# Module : SALOME
#
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test4.sh
# Module : SALOME
#
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test5.sh
# Module : SALOME
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME NOTIFICATION_SWIG : wrapping of Notification sevices in order to be available in Python
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NOTIFICATION_SWIG : wrapping of Notification sevices in order to be available in Python
// File : NOTIFICATION.i
// Author : Francis KLOSS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NOTIFICATION_SWIG : wrapping of Notification sevices in order to be available in Python
// File : NOTIFICATION_Swig.cxx
// Author : Francis KLOSS
// Module : SALOME
//
#include "NOTIFICATION_Swig.hxx"
-using namespace std;
// Swig notification supplier
// --------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NOTIFICATION_SWIG : wrapping of Notification sevices in order to be available in Python
// File : NOTIFICATION_Swig.hxx
// Author : Francis KLOSS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_NOTIFICATION_SWIG.hxx
// Author : Oleg UVAROV
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME NamingService : wrapping NamingService services
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : NamingService_WaitForServerReadiness.cxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
#include <iostream>
#include <ctime>
-using namespace std;
-
// ============================================================================
/*!
* Wait until a server is registered in naming service.
void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
- string serverName)
+ std::string serverName)
{
long TIMESleep = 500000000; // 500 ms.
int NumberOfTries = 40; // total wait = 20 s.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : NamingService_WaitForServerReadiness.hxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NamingService : wrapping NamingService services
// File : SALOME_NamingService.cxx
// Author : Estelle Deville
#include <string>
#include <cstdio>
-using namespace std;
+#ifdef WNT
+#define strdup _strdup
+#endif
/*! \class SALOME_NamingService
\brief A class to manage the SALOME naming service
// to place the current_context to the correct node
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
int dimension_resultat = _createContextNameDir(Path,
context_name,
splitPath,
// to place the current_context to the correct node
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
_createContextNameDir(Path,
context_name,
splitPath,
Utils_Locker lock (&_myMutex);
// SCRUTE(Path);
- string thePath = Path;
- string basePath = "";
- string name = thePath;
+ std::string thePath = Path;
+ std::string basePath = "";
+ std::string name = thePath;
- string::size_type idx = thePath.rfind('/');
+ std::string::size_type idx = thePath.rfind('/');
- if (idx != string::npos) // at least one '/' found
+ if (idx != std::string::npos) // at least one '/' found
{
basePath = thePath.substr(0, idx);
name = thePath.substr(idx + 1);
if (isOk)
{
- vector<string> listElem = list_directory();
- vector<string>::iterator its = listElem.begin();
+ std::vector<std::string> listElem = list_directory();
+ std::vector<std::string>::iterator its = listElem.begin();
while (its != listElem.end())
{
Utils_Locker lock (&_myMutex);
- string name = "/Containers/";
+ std::string name = "/Containers/";
name += hostname;
else
{
SCRUTE(name);
- string basename = name;
+ std::string basename = name;
if (Change_Directory(basename.c_str()))
{
- vector<string> contList = list_subdirs();
+ std::vector<std::string> contList = list_subdirs();
for (unsigned int ind = 0; ind < contList.size(); ind++)
{
*/
// ============================================================================
-string SALOME_NamingService::ContainerName(const char *containerName)
+std::string SALOME_NamingService::ContainerName(const char *containerName)
{
- string ret;
+ std::string ret;
if (strlen(containerName) == 0)
ret = "FactoryServer";
*/
// ============================================================================
-string
+std::string
SALOME_NamingService::ContainerName(const Engines::MachineParameters& params)
{
int nbproc;
else
nbproc = params.nb_node * params.nb_proc_per_node;
- string ret = ContainerName(params.container_name);
+ std::string ret = ContainerName(params.container_name);
if ( nbproc >= 1 )
{
return ret;
}
-string
+std::string
SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params)
{
int nbproc;
else
nbproc = params.resource_params.nb_node * params.resource_params.nb_proc_per_node;
- string ret = ContainerName(params.container_name);
+ std::string ret = ContainerName(params.container_name);
if ( nbproc >= 1 )
{
*/
// ============================================================================
-string SALOME_NamingService::BuildContainerNameForNS(const char *containerName,
+std::string SALOME_NamingService::BuildContainerNameForNS(const char *containerName,
const char *hostname)
{
- string ret = "/Containers/";
+ std::string ret = "/Containers/";
ret += hostname;
ret += "/";
ret += ContainerName(containerName);
*/
// ============================================================================
-string
+std::string
SALOME_NamingService::
BuildContainerNameForNS(const Engines::MachineParameters& params,
const char *hostname)
{
- string ret = "/Containers/";
+ std::string ret = "/Containers/";
ret += hostname;
ret += "/";
ret += ContainerName(params);
return ret;
}
-string
+std::string
SALOME_NamingService::
BuildContainerNameForNS(const Engines::ContainerParameters& params,
const char *hostname)
{
- string ret = "/Containers/";
+ std::string ret = "/Containers/";
ret += hostname;
ret += "/";
ret += ContainerName(params);
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to create, no context change
// MESSAGE("BEGIN OF Change_Directory " << Path);
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to do
if (path[path.length()-1] != '/') path += '/';
// SCRUTE(path);
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
_createContextNameDir(path.c_str(),
context_name,
splitPath,
CosNaming::NamingContext_var ref_context = _current_context;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
splitPath.resize(0);
int lengthPath = 0;
bool notFound = true ;
throw ServiceUnreachable();
}
- string path;
+ std::string path;
lengthPath = splitPath.size();
for (int k = 0 ; k < lengthPath ;k++)
{
*/
// ============================================================================
-vector<string> SALOME_NamingService::list_directory()
+std::vector<std::string> SALOME_NamingService::list_directory()
throw(ServiceUnreachable)
{
// MESSAGE("list_directory");
- vector<string> dirList ;
+ std::vector<std::string> dirList ;
dirList.resize(0);
CosNaming::BindingList_var binding_list;
{
// remove memory leak
// dirList.push_back(CORBA::string_dup(bindingName[0].id));
- dirList.push_back(string(bindingName[0].id));
+ dirList.push_back(std::string(bindingName[0].id));
}
}
*/
// ============================================================================
-vector<string> SALOME_NamingService::list_subdirs()
+std::vector<std::string> SALOME_NamingService::list_subdirs()
throw(ServiceUnreachable)
{
MESSAGE("list_subdirs");
- vector<string> dirList ;
+ std::vector<std::string> dirList ;
dirList.resize(0);
CosNaming::BindingList_var binding_list;
*/
// ============================================================================
-vector<string> SALOME_NamingService::list_directory_recurs()
+std::vector<std::string> SALOME_NamingService::list_directory_recurs()
throw(ServiceUnreachable)
{
MESSAGE("list_directory_recurs");
Utils_Locker lock (&_myMutex);
- vector<string> dirList ;
+ std::vector<std::string> dirList ;
char* currentDir = Current_Directory();
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to do
// --- context of the directory containing the object
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
int dimension_resultat = _createContextNameDir(path.c_str(),
context_name,
splitPath,
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to do
// --- context of the directory
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
int dimension_resultat = _createContextNameDir(path.c_str(),
context_name,
splitPath,
MESSAGE("begin of Destroy_FullDirectory " << Path);
if( Change_Directory(Path) )
{
- vector<string> contList = list_directory();
+ std::vector<std::string> contList = list_directory();
for (unsigned int ind = 0; ind < contList.size(); ind++)
Destroy_Name(contList[ind].c_str());
// ============================================================================
int
-SALOME_NamingService::_createContextNameDir(string path,
+SALOME_NamingService::_createContextNameDir(std::string path,
CosNaming::Name& context_name,
- vector<string>& splitPath,
+ std::vector<std::string>& splitPath,
bool onlyDir)
{
if (path.empty())
return 0;
- string::size_type begIdx, endIdx;
- const string delims("/");
+ std::string::size_type begIdx, endIdx;
+ const std::string delims("/");
splitPath.resize(0);
bool endWithDelim = false;
begIdx = path.find_first_not_of(delims);
- while (begIdx != string::npos)
+ while (begIdx != std::string::npos)
{
endIdx = path.find_first_of(delims, begIdx);
if (endIdx == path.length()-1)
endWithDelim = true;
- if (endIdx == string::npos)
+ if (endIdx == std::string::npos)
endIdx = path.length();
int lsub = endIdx - begIdx;
if (lsub >= 1)
void
SALOME_NamingService::
-_current_directory(vector<string>& splitPath,
+_current_directory(std::vector<std::string>& splitPath,
int& lengthResult,
CosNaming::NamingContext_var contextToFind,
bool& notFound)
*/
// ============================================================================
-void SALOME_NamingService::_list_directory_recurs(vector<string>& myList,
- string relativeSubDir,
- string absCurDirectory)
+void SALOME_NamingService::_list_directory_recurs(std::vector<std::string>& myList,
+ std::string relativeSubDir,
+ std::string absCurDirectory)
{
CosNaming::BindingList_var binding_list;
CosNaming::BindingIterator_var binding_iterator;
unsigned long nb = 0 ; // --- only for thethe use of BindingIterator
// to access the bindings
- string absDir;
+ std::string absDir;
CosNaming::NamingContext_var ref_context = _current_context;
if (binding->binding_type == CosNaming::ncontext)
{
- string relativeSdir(bindingName[0].id);
+ std::string relativeSdir(bindingName[0].id);
_list_directory_recurs(myList, relativeSdir, absDir);
}
else if (binding->binding_type == CosNaming::nobject)
{
- string objName(bindingName[0].id);
- string elt = absDir + "/" + objName;
+ std::string objName(bindingName[0].id);
+ std::string elt = absDir + "/" + objName;
SCRUTE(elt);
myList.push_back(elt);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NamingService : wrapping NamingService services
// File : SALOME_NamingService.hxx
// Author : Estelle Deville
#include "SALOME_NamingService_defs.hxx"
+#ifdef WNT
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
class NAMINGSERVICE_EXPORT SALOME_NamingService
{
public:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NamingService : wrapping NamingService services
// File : SALOME_NamingService.i
// Author : Paul RASCLE, EDF
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME NamingService : wrapping NamingService services
# File : SALOME_NamingServicePy.py
# Author : Estelle Deville, CEA
# Module : SALOME
# $Header$
-#
## @package SALOME_NamingServicePy
# \brief Module to manage SALOME naming service from python
-#
-#
-
+#
import sys
import time
from omniORB import CORBA
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NamingService : wrapping NamingService services
// File : SALOME_NamingService_defs.hxx
// Author : Alexander A. BORODIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NamingService : wrapping NamingService services
// File : ServiceUnreachable.cxx
// Module : SALOME
//
#include "ServiceUnreachable.hxx"
-using namespace std;
ServiceUnreachable::ServiceUnreachable( void ): SALOME_Exception( "ServiceUnreachable" )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME NamingService : wrapping NamingService services
// File : ServiceUnreachable.hxx
// Author : Paul RASCLE, EDF
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOMELocalTrace : log on local machine
# File : Makefile.am
# Author : Guillaume BOULANT (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "NamingServiceTest.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include <cstdlib>
#include <cstdio>
-using namespace std;
// --- uncomment to have some traces on standard error
// (useful only when adding new tests...)
// --- trace on file
const char *theFileName = TRACEFILE;
- string s = "file:";
+ std::string s = "file:";
s += theFileName;
//s="local";
//s="with_logger";
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
- ofstream traceFile;
+ std::ofstream traceFile;
// traceFile.open(theFileName, ios::out | ios::trunc);
- traceFile.open(theFileName, ios::out | ios::app);
+ traceFile.open(theFileName, std::ios::out | std::ios::app);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
{
NSTEST::echo_var anEchoRef = myFactory->createInstance();
ref[i] = anEchoRef->getId();
- string name = "/nstestfirst/echo_";
+ std::string name = "/nstestfirst/echo_";
char anum[10];
sprintf(anum,"%d",ref[i]);
name += anum;
for (int i=0; i<NB_OBJS; i++)
{
- string name = "/nstestfirst/echo_";
+ std::string name = "/nstestfirst/echo_";
char anum[10];
sprintf(anum,"%d",ref[i]);
name += anum;
CPPUNIT_ASSERT(anEchoRef->getId() == ref[i]);
}
- string name = "/nstestfirst/echo";
+ std::string name = "/nstestfirst/echo";
obj = _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
NSTEST::echo_var anEchoRef = NSTEST::echo::_narrow(obj);
{
NSTEST::echo_var anEchoRef = myFactory->createInstance();
ref[i] = anEchoRef->getId();
- string name = "/nstestfirstrel/echo_";
+ std::string name = "/nstestfirstrel/echo_";
char anum[10];
sprintf(anum,"%d",ref[i]);
name += anum;
for (int i=0; i<NB_OBJS; i++)
{
_NS.Change_Directory("/nstestfirstrel");
- string name = "echo_";
+ std::string name = "echo_";
char anum[10];
sprintf(anum,"%d",ref[i]);
name += anum;
}
_NS.Change_Directory("/nstestfirstrel");
- string name = "echo";
+ std::string name = "echo";
obj = _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
}
void
NamingServiceTest::testResolveFirstUnknown()
{
- string name = "/notYeyRegistered";
+ std::string name = "/notYeyRegistered";
CORBA::Object_var obj= _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(CORBA::is_nil(obj));
_NS.Create_Directory("/myContext");
_NS.Change_Directory("/myContext");
- string name = "RelnotYeyRegistered";
+ std::string name = "RelnotYeyRegistered";
CORBA::Object_var obj = _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(CORBA::is_nil(obj));
void
NamingServiceTest::testContainerName()
{
- string ref0 = "FactoryServer";
- string ret = _NS.ContainerName("");
+ std::string ref0 = "FactoryServer";
+ std::string ret = _NS.ContainerName("");
CPPUNIT_ASSERT(ret == ref0);
ref0 = "MyContainerName";
params.nb_node = 0;
params.isMPI = false;
- string ref0 = "FactoryServer";
- string ret = _NS.ContainerName(params);
+ std::string ref0 = "FactoryServer";
+ std::string ret = _NS.ContainerName(params);
CPPUNIT_ASSERT(ret == ref0);
ref0 = "MyContainerName";
void
NamingServiceTest::testBuildContainerNameForNS()
{
- string ref0 = "/Containers/theHostName/theContainerName";
- string ret = _NS.BuildContainerNameForNS("theContainerName","theHostName");
+ std::string ref0 = "/Containers/theHostName/theContainerName";
+ std::string ret = _NS.BuildContainerNameForNS("theContainerName","theHostName");
CPPUNIT_ASSERT(ret == ref0);
ref0 = "/Containers/theHostName/FactoryServer";
params.isMPI = false;
params.container_name = "theContainerName";
- string ref0 = "/Containers/theHostName/theContainerName";
- string ret = _NS.BuildContainerNameForNS(params,"theHostName");
+ std::string ref0 = "/Containers/theHostName/theContainerName";
+ std::string ret = _NS.BuildContainerNameForNS(params,"theHostName");
CPPUNIT_ASSERT(ret == ref0);
params.container_name = "";
_NS.Change_Directory("/aaa/bbb/ccc/ddd/eee");
NSTEST::echo_var anEchoRef = myFactory->createInstance();
int val = anEchoRef->getId();
- string name = "echo_";
+ std::string name = "echo_";
char anum[10];
sprintf(anum,"%d",val);
name += anum;
_NS.Register(anEchoRef,name.c_str());
- string dirname = "/aaa/bbb/ccc/ddd/eee/";
+ std::string dirname = "/aaa/bbb/ccc/ddd/eee/";
dirname += name;
obj = _NS.Resolve(dirname.c_str());
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
void
NamingServiceTest::testCurrentDirectory()
{
- string path = "/aaa/bbb/ccc/ddd/eee";
+ std::string path = "/aaa/bbb/ccc/ddd/eee";
bool ret = _NS.Create_Directory(path.c_str());
CPPUNIT_ASSERT(ret);
_NS.Change_Directory(path.c_str());
char* acurdir = _NS.Current_Directory();
- string curdir = acurdir;
+ std::string curdir = acurdir;
free(acurdir);
CPPUNIT_ASSERT(curdir == path);
}
NSTEST::aFactory_var myFactory = NSTEST::aFactory::_narrow(obj);
CPPUNIT_ASSERT(!CORBA::is_nil(myFactory));
- string path = "/Containers/theHostName/theContainerName/theComponentName";
+ std::string path = "/Containers/theHostName/theContainerName/theComponentName";
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef, path.c_str());
NSTEST::aFactory_var myFactory = NSTEST::aFactory::_narrow(obj);
CPPUNIT_ASSERT(!CORBA::is_nil(myFactory));
- string path = "/Containers/theHostName/theContainerName/theComponentName";
+ std::string path = "/Containers/theHostName/theContainerName/theComponentName";
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef, path.c_str());
*/
// ============================================================================
-void NamingServiceTest::_destroyDirectoryRecurs(string path)
+void NamingServiceTest::_destroyDirectoryRecurs(std::string path)
{
- string current = path;
+ std::string current = path;
SCRUTE(path);
if (_NS.Change_Directory(path.c_str()))
{
- vector<string> subdirs = _NS.list_subdirs();
+ std::vector<std::string> subdirs = _NS.list_subdirs();
for (int i=0; i<subdirs.size(); i++)
{
- string subpath=path + "/" +subdirs[i];
+ std::string subpath=path + "/" +subdirs[i];
_destroyDirectoryRecurs(subpath);
}
if (_NS.Change_Directory(path.c_str()))
{
_NS.Destroy_FullDirectory("/Containers");
CPPUNIT_ASSERT(_NS.Change_Directory("/Containers"));
- vector<string> subdirs = _NS.list_subdirs();
+ std::vector<std::string> subdirs = _NS.list_subdirs();
CPPUNIT_ASSERT(subdirs.size() >0);
_NS.list_directory_recurs();
- string path = "/Containers";
+ std::string path = "/Containers";
_destroyDirectoryRecurs(path);
CPPUNIT_ASSERT( ! _NS.Change_Directory("/Containers"));
_NS.Change_Directory("/");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _NAMINGSERVICETEST_HXX_
#define _NAMINGSERVICETEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all Unit Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import setenv
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : CosNotifyShorthands.h
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Notification : wrapping of Notification service services
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : NOTIFICATION.cxx
// Author : Laurent DADA / Francis KLOSS
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
-using namespace std;
CosNA_EventChannel_ptr NOTIFICATION_channel() {
ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance(); ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
MESSAGE("NOTIFICATION Error : failed to obtain context for NameService");
return(channel);
};
- } catch(CORBA::ORB::InvalidName& ex) {
+ } catch(CORBA::ORB::InvalidName& ) {
MESSAGE("NOTIFICATION Error : service required is invalid [does not exist]");
return(channel);
- } catch (CORBA::SystemException& ex) {
+ } catch (CORBA::SystemException& ) {
MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE");
return(channel);
} catch (...) {
if (CORBA::is_nil(channel)) {
MESSAGE("NOTIFICATION Error : failed to narrow object found in naming service");
};
- } catch(CORBA::ORB::InvalidName& ex) {
+ } catch(CORBA::ORB::InvalidName& ) {
MESSAGE("NOTIFICATION Error : invalid name");
- } catch (CORBA::SystemException& ex) {
+ } catch (CORBA::SystemException& ) {
MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE while resolving event channel name");
} catch (...) {
MESSAGE("NOTIFICATION Error : caught exception while resolving event channel name");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : NOTIFICATION.hxx
// Author : Laurent DADA / Francis KLOSS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : NOTIFICATION_Consumer.cxx
// Author : Laurent DADA / Francis KLOSS
// Module : SALOME
//
#include "NOTIFICATION.hxx"
-using namespace std;
NOTIFICATION_Consumer::NOTIFICATION_Consumer():
proxy_supplier(0),
proxy_supplier->connect_structured_pull_consumer(_this());
_ok = true;
MESSAGE("NOTIFICATION Info : successfully connection for pull consumer notification");
- } catch (CORBA::BAD_PARAM& ex) {
+ } catch (CORBA::BAD_PARAM&) {
MESSAGE("NOTIFICATION Error : pull consumer BAD_PARAM exception while connecting");
- } catch (CosEventChannelAdmin::AlreadyConnected& ex) {
+ } catch (CosEventChannelAdmin::AlreadyConnected&) {
MESSAGE("NOTIFICATION Error : pull consumer already connected");
} catch (...) {
MESSAGE("NOTIFICATION Error : pull consumer failed to connect");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : NOTIFICATION_Consumer.hxx
// Author : Laurent DADA / Francis KLOSS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : NOTIFICATION_Supplier.cxx
// Author : Laurent DADA / Francis KLOSS
// Module : SALOME
//
#include "NOTIFICATION.hxx"
-using namespace std;
long NOTIFICATION_Supplier::_stamp = 0;
proxy_consumer->connect_structured_push_supplier(_this());
_ok = true;
MESSAGE("NOTIFICATION Info : successfully connection for push supplier notification");
- } catch (CORBA::BAD_PARAM& ex) {
+ } catch (CORBA::BAD_PARAM&) {
MESSAGE("NOTIFICATION Error : push supplier BAD_PARAM Exception while connecting");
- } catch (CosEventChannelAdmin::AlreadyConnected& ex) {
+ } catch (CosEventChannelAdmin::AlreadyConnected&) {
MESSAGE("NOTIFICATION Error : push supplier already connected");
} catch (...) {
MESSAGE("NOTIFICATION Error : push supplier failed to connect");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Notification : wrapping of Notification service services
// File : NOTIFICATION_Supplier.hxx
// Author : Laurent DADA / Francis KLOSS
#include "SALOME_NOTIFICATION.hxx"
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#endif
+
class NOTIFICATION_EXPORT NOTIFICATION_Supplier: public POA_CosNotifyComm::StructuredPushSupplier {
public:
NOTIFICATION_Supplier(const char* instanceName, bool notif);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_NOTIFICATION.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : André RIBES (EDF)
# Module : KERNEL
libSalomeParallelContainer_la_SOURCES = SALOME_ParallelComponent_i.cxx \
SALOME_ParallelContainer_i.cxx \
SALOME_ParallelContainerProxy_i.cxx \
- $(top_srcdir)/src/Container/Salome_file_i.cxx \
Parallel_Salome_file_i.cxx \
SALOME_ParallelGlobalProcessVar_i.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Parallel_Salome_file_i.cxx
// Author : André RIBES, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Parallel_Salome_file_i.hxx
// Author : André RIBES, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelComponent : implementation of container and engine for Parallel Kernel
// File : SALOME_ParallelComponent_i.cxx
// Author : André RIBES, EDF
#include <paco_dummy.h>
#include <paco_omni.h>
-using namespace std;
extern bool _Sleeping ;
static Engines_Parallel_Component_i * theEngines_Component ;
{
Engines::FieldsDict_var copie = new Engines::FieldsDict;
copie->length(_fieldsDict.size());
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
CORBA::ULong i = 0;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++)
{
{
_ThreadCpuUsed = CpuUsed() ;
cpu = _ThreadCpuUsed ;
- // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
- // << _serviceName << " " << cpu << endl ;
+ // std::cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
+ // << _serviceName << " " << cpu << std::endl ;
}
}
else
{
cpu = _ThreadCpuUsed ;
- // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
- // << _serviceName << " " << cpu<< endl ;
+ // std::cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
+ // << _serviceName << " " << cpu<< std::endl ;
}
}
else
{
- // cout<< pthread_self()<<"Engines_Parallel_Component_i::CpuUsed_impl _ThreadId "
- // <<_ThreadId <<" "<<_serviceName<<" _StartUsed "<<_StartUsed<<endl;
+ // std::cout<< pthread_self()<<"Engines_Parallel_Component_i::CpuUsed_impl _ThreadId "
+ // <<_ThreadId <<" "<<_serviceName<<" _StartUsed "<<_StartUsed<<std::endl;
}
return cpu ;
}
// --- for supervisor : all strings given with setProperties
// are set in environment
bool overwrite = true;
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
{
std::string cle((*it).first);
return 0 ;
}
cpu = usage.ru_utime.tv_sec - _StartUsed ;
- // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed " << " "
+ // std::cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed " << " "
// << _serviceName << usage.ru_utime.tv_sec << " - " << _StartUsed
- // << " = " << cpu << endl ;
+ // << " = " << cpu << std::endl ;
}
else
{
- // cout << pthread_self() << "Engines_Parallel_Component_i::CpuUsed _ThreadId "
+ // std::cout << pthread_self() << "Engines_Parallel_Component_i::CpuUsed _ThreadId "
// << _ThreadId << " " << _serviceName<< " _StartUsed "
- // << _StartUsed << endl ;
+ // << _StartUsed << std::endl ;
}
#else
// NOT implementet yet
*/
//=============================================================================
-string Engines_Parallel_Component_i::GetDynLibraryName(const char *componentName)
+std::string Engines_Parallel_Component_i::GetDynLibraryName(const char *componentName)
{
- string ret="lib";
+ std::string ret="lib";
ret+=componentName;
ret+="Engine.so";
return ret;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelComponent : implementation of container and engine for Parallel Kernel
// File : SALOME_ParallelComponent_i.hxx
// Author : André RIBES, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ParallelContainerNodeDummy : launcher of a PaCO++ object
// File : SALOME_ParallelContainerNodeDummy.cxx
// Author : André Ribes, EDF
#include "Container_init_python.hxx"
-using namespace std;
-
#ifdef _DEBUG_
#include <signal.h>
void handler(int t) {
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "SIGSEGV in :" << getpid() << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "SIGSEGV in :" << getpid() << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
while (1) {}
}
#endif
SALOME_NamingService * ns = new SALOME_NamingService(orb);
// Get the proxy
- string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(),
+ std::string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(),
proxy_hostname.c_str());
obj = ns->Resolve(proxyNameInNS.c_str());
char * proxy_ior = orb->object_to_string(obj);
// Creating a node
- string node_name = containerName + "Node";
+ std::string node_name = containerName + "Node";
Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb),
proxy_ior,
myid,
node_name = node_name + buffer;
string _containerName = ns->BuildContainerNameForNS((char*) node_name.c_str(),
hostname.c_str());
- cerr << "---------" << _containerName << "----------" << endl;
+ std::cerr << "---------" << _containerName << "----------" << std::endl;
ns->Register(obj, _containerName.c_str());
pman->activate();
orb->run();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ParallelContainerNodeMpi : Launch mpi PaCO++ object nodes
// File : SALOME_ParallelContainerNodeMpi.cxx
// Author : André Ribes, EDF
#include "Container_init_python.hxx"
-using namespace std;
#ifdef _DEBUG_
#include <signal.h>
void handler(int t) {
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "SIGSEGV in :" << getpid() << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "SIGSEGV in :" << getpid() << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
while (1) {}
}
#endif
}
#endif
- cerr << "Level MPI_THREAD_SINGLE : " << MPI_THREAD_SINGLE << endl;
- cerr << "Level MPI_THREAD_SERIALIZED : " << MPI_THREAD_SERIALIZED << endl;
- cerr << "Level MPI_THREAD_FUNNELED : " << MPI_THREAD_FUNNELED << endl;
- cerr << "Level MPI_THREAD_MULTIPLE : " << MPI_THREAD_MULTIPLE << endl;
- cerr << "Level provided : " << provided << endl;
+ std::cerr << "Level MPI_THREAD_SINGLE : " << MPI_THREAD_SINGLE << std::endl;
+ std::cerr << "Level MPI_THREAD_SERIALIZED : " << MPI_THREAD_SERIALIZED << std::endl;
+ std::cerr << "Level MPI_THREAD_FUNNELED : " << MPI_THREAD_FUNNELED << std::endl;
+ std::cerr << "Level MPI_THREAD_MULTIPLE : " << MPI_THREAD_MULTIPLE << std::endl;
+ std::cerr << "Level provided : " << provided << std::endl;
// Initialise the ORB.
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
KERNEL_PYTHON::init_python(argc,argv);
// Code pour choisir le reseau infiniband .....
- /* string hostname_temp = GetHostname();
+ /* std::string hostname_temp = GetHostname();
hostent * t = gethostbyname(hostname_temp.c_str());
- cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << endl;
- cerr << t->h_addr << endl;
+ std::cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << std::endl;
+ std::cerr << t->h_addr << std::endl;
in_addr * address=(in_addr * ) t->h_addr;
- cerr << inet_ntoa(* address) << endl;
- string ip = inet_ntoa(* address);
- cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << endl;
- string com = "giop:tcp:" + ip + ":";
+ std::cerr << inet_ntoa(* address) << std::endl;
+ std::string ip = inet_ntoa(* address);
+ std::cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << std::endl;
+ std::string com = "giop:tcp:" + ip + ":";
const char* options[][2] = { { "endPoint", com.c_str() }, { 0, 0 } };
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4", options);
*/
SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb));
// On récupère le proxy
- string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(),
+ std::string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(),
proxy_hostname.c_str());
obj = ns->Resolve(proxyNameInNS.c_str());
char * proxy_ior = orb->object_to_string(obj);
// Node creation
- string node_name = containerName + "Node";
+ std::string node_name = containerName + "Node";
Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb),
proxy_ior,
myid,
obj = servant->_this();
// In the NamingService
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
int myid;
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
// We register nodes in two different parts
// In the real machine name and in the proxy machine
- string _containerName = ns->BuildContainerNameForNS(node_name.c_str(),
+ std::string _containerName = ns->BuildContainerNameForNS(node_name.c_str(),
hostname.c_str());
- string _proxymachine_containerName = ns->BuildContainerNameForNS(node_name.c_str(),
+ std::string _proxymachine_containerName = ns->BuildContainerNameForNS(node_name.c_str(),
proxy_hostname.c_str());
- cerr << "Register container node : " << _containerName << endl;
- cerr << "Register container node : " << _proxymachine_containerName << endl;
+ std::cerr << "Register container node : " << _containerName << std::endl;
+ std::cerr << "Register container node : " << _proxymachine_containerName << std::endl;
ns->Register(obj, _containerName.c_str());
ns->Register(obj, _proxymachine_containerName.c_str());
pman->activate();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ParallelContainerProxyDummy : Proxy of a PaCO++ object using Dummy
// File : SALOME_ParallelContainerProxyDummy.cxx
// Author : André Ribes, EDF
#ifdef DEBUG_PARALLEL
#include <signal.h>
-using namespace std;
void handler(int t) {
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "SIGSEGV in :" << getpid() << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "SIGSEGV in :" << getpid() << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
while (1) {}
}
#endif
obj = proxy->_this();
// In the NamingService
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
Engines::Container_var pCont = Engines::Container::_narrow(obj);
string _containerName = ns->BuildContainerNameForNS(containerName.c_str(),
hostname.c_str());
- cerr << "---------" << _containerName << "----------" << endl;
+ std::cerr << "---------" << _containerName << "----------" << std::endl;
ns->Register(pCont, _containerName.c_str());
pman->activate();
orb->run();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ParallelContainerProxyMpi : Launching the proxy of a MPI PaCO++ object
// File : SALOME_ParallelContainerProxyMpi.cxx
// Author : André Ribes, EDF
#ifdef _DEBUG_
#include <signal.h>
-using namespace std;
+
typedef void (*sighandler_t)(int);
sighandler_t setsig(int sig, sighandler_t handler)
}
void handler(int t) {
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "SIGSEGV in :" << getpid() << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
- cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "SIGSEGV in :" << getpid() << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
while (1) {}
}
#endif
obj = proxy->_this();
// in the NamingService
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
Engines::Container_var pCont = Engines::Container::_narrow(obj);
- string _containerName = ns->BuildContainerNameForNS(containerName.c_str(),
+ std::string _containerName = ns->BuildContainerNameForNS(containerName.c_str(),
hostname.c_str());
- cerr << "---------" << _containerName << "----------" << endl;
+ std::cerr << "---------" << _containerName << "----------" << std::endl;
ns->Register(pCont, _containerName.c_str());
pman->activate();
orb->run();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelContainerProxy : implementation of container and engine for Parallel Kernel
// File : SALOME_ParallelContainerProxy_i.cxx
// Author : André RIBES, EDF
-
+//
#include "SALOME_ParallelContainerProxy_i.hxx"
Container_proxy_impl_final::Container_proxy_impl_final(CORBA::ORB_ptr orb,
// déterminer si on doit créer une instance sequentielle
// ou parallèle d'un composant dans la méthode create_component_instance
CORBA::Boolean
-Container_proxy_impl_final::load_component_Library(const char* componentName)
+Container_proxy_impl_final::load_component_Library(const char* componentName, CORBA::String_out reason)
{
- MESSAGE("Begin of load_component_Library on proxy : " << componentName)
+ MESSAGE("Begin of load_component_Library on proxy : " << componentName);
+ reason=CORBA::string_dup("");
+
std::string aCompName = componentName;
CORBA::Boolean ret = true;
Engines::Container_var node = Engines::Container::_narrow(object);
if (!CORBA::is_nil(node))
{
+ char* reason;
try
{
- node->load_component_Library(componentName);
+ node->load_component_Library(componentName,reason);
MESSAGE("Call load_component_Library done node : " << i);
+ CORBA::string_free(reason);
}
catch (...)
{
INFOS("Exception catch during load_component_Library of node : " << i);
+ CORBA::string_free(reason);
ret = false;
}
}
return ret;
}
+Engines::Component_ptr
+Container_proxy_impl_final::create_component_instance(const char* componentName, ::CORBA::Long studyId)
+{
+ Engines::FieldsDict_var env = new Engines::FieldsDict;
+ char* reason;
+ Engines::Component_ptr compo = create_component_instance_env(componentName, studyId, env, reason);
+ CORBA::string_free(reason);
+ return compo;
+}
+
// Il y a deux cas :
// Composant sequentiel -> on le créer sur le noeud 0 (on pourrait faire une répartition de charge)
// Composant parallèle -> création du proxy ici puis appel de la création de chaque objet participant
// au composant parallèle
Engines::Component_ptr
-Container_proxy_impl_final::create_component_instance(const char* componentName, ::CORBA::Long studyId)
+Container_proxy_impl_final::create_component_instance_env(const char* componentName, ::CORBA::Long studyId,
+ const Engines::FieldsDict& env, CORBA::String_out reason)
{
+ reason=CORBA::string_dup("");
+
std::string aCompName = componentName;
if (_libtype_map.count(aCompName) == 0)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelContainerProxy : implementation of container and engine for Parallel Kernel
// File : SALOME_ParallelContainerProxy_i.hxx
// Author : André RIBES, EDF
-
+//
#ifndef _SALOME_PARALLEL_CONTAINER_PROXY_I_HXX_
#define _SALOME_PARALLEL_CONTAINER_PROXY_I_HXX_
virtual void Shutdown();
- virtual ::CORBA::Boolean load_component_Library(const char* componentName);
+ virtual ::CORBA::Boolean load_component_Library(const char* componentName,CORBA::String_out reason);
virtual Engines::Component_ptr create_component_instance(const char* componentName, ::CORBA::Long studyId);
+ virtual Engines::Component_ptr create_component_instance_env( const char* componentName,
+ CORBA::Long studyId, // 0 for multiStudy
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason);
private:
std::map<std::string, std::string> _libtype_map; // libname -> libtype (seq ou par)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelContainer : implementation of container and engine for ParallelKernel
// File : SALOME_ParallelContainer_i.cxx
// Author : André RIBES, EDF
-
+//
#include "SALOME_ParallelContainer_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_FileRef_i.hxx"
#include <Python.h>
#include "Container_init_python.hxx"
-using namespace std;
bool _Sleeping = false ;
//=============================================================================
bool
-Engines_Parallel_Container_i::load_component_Library(const char* componentName)
+Engines_Parallel_Container_i::load_component_Library(const char* componentName, CORBA::String_out reason)
{
+ reason=CORBA::string_dup("");
+
MESSAGE("Begin of load_component_Library : " << componentName)
bool ret = false;
std::string aCompName = componentName;
#ifndef WIN32
- string impl_name = string ("lib") + aCompName + string("Engine.so");
+ std::string impl_name = string ("lib") + aCompName + string("Engine.so");
#else
- string impl_name = aCompName + string("Engine.dll");
+ std::string impl_name = aCompName + string("Engine.dll");
#endif
_numInstanceMutex.lock(); // lock to be alone
* \return a loaded component
*/
//=============================================================================
-
Engines::Component_ptr
Engines_Parallel_Container_i::create_component_instance(const char*genericRegisterName,
CORBA::Long studyId)
+{
+ Engines::FieldsDict_var env = new Engines::FieldsDict;
+ char* reason;
+ Engines::Component_ptr compo = create_component_instance_env(genericRegisterName,studyId,env, reason);
+ CORBA::string_free(reason);
+ return compo;
+}
+
+//=============================================================================
+//! Create a new component instance
+/*!
+ * CORBA method: Creates a new servant instance of a component.
+ * The servant registers itself to naming service and Registry.
+ * \param genericRegisterName Name of the component instance to register
+ * in Registry & Name Service (without _inst_n suffix)
+ * \param studyId 0 for multiStudy instance,
+ * study Id (>0) otherwise
+ * \param env dict of environment variables
+ * \return a loaded component
+ */
+//=============================================================================
+
+Engines::Component_ptr
+Engines_Parallel_Container_i::create_component_instance_env(const char*genericRegisterName,
+ CORBA::Long studyId,
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason)
{
MESSAGE("Begin of create_component_instance in node : " << getMyRank());
+ reason=CORBA::string_dup("");
if (studyId < 0)
{
std::string aCompName = genericRegisterName;
#ifndef WIN32
- string impl_name = string ("lib") + aCompName +string("Engine.so");
+ std::string impl_name = string ("lib") + aCompName +string("Engine.so");
#else
- string impl_name = aCompName +string("Engine.dll");
+ std::string impl_name = aCompName +string("Engine.dll");
#endif
_numInstanceMutex.lock();
CORBA::Long studyId)
{
Engines::Component_var anEngine = Engines::Component::_nil();
- map<string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
+ std::map<std::string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
while (itm != _listInstances_map.end())
{
- string instance = (*itm).first;
+ std::string instance = (*itm).first;
SCRUTE(instance);
if (instance.find(registeredName) == 0)
{
const char* componentName )
{
Engines::Component_var iobject = Engines::Component::_nil();
- if (load_component_Library(genericRegisterName))
+ char* reason;
+ if (load_component_Library(genericRegisterName,reason))
iobject = find_or_create_instance(genericRegisterName);
+ CORBA::string_free(reason);
return iobject._retn();
}
void Engines_Parallel_Container_i::remove_impl(Engines::Component_ptr component_i)
{
ASSERT(!CORBA::is_nil(component_i));
- string instanceName = component_i->instanceName();
+ std::string instanceName = component_i->instanceName();
_numInstanceMutex.lock() ; // lock to be alone (stl container write)
// Test if the component is in this container
std::map<std::string, Engines::Component_var>::iterator itm;
MESSAGE("WARNING FINALIZE DOES CURRENTLY NOTHING !!!");
// (see decInstanceCnt, load_component_Library)
- //map<string, void *>::iterator ith;
+ //std::map<std::string, void *>::iterator ith;
//for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++)
//{
// void *handle = (*ith).second;
- // string impl_name= (*ith).first;
+ // std::string impl_name= (*ith).first;
// if (handle)
// {
// SCRUTE(handle);
Engines::fileRef_ptr
Engines_Parallel_Container_i::createFileRef(const char* origFileName)
{
- string origName(origFileName);
+ std::string origName(origFileName);
Engines::fileRef_var theFileRef = Engines::fileRef::_nil();
if (origName[0] != '/')
//=============================================================================
Engines::Component_ptr
-Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName)
+Engines_Parallel_Container_i::find_or_create_instance(std::string genericRegisterName)
{
Engines::Component_var iobject = Engines::Component::_nil();
try
{
- string aGenRegisterName = genericRegisterName;
+ std::string aGenRegisterName = genericRegisterName;
// --- find a registered instance in naming service, or create
- string component_registerBase = _containerName + "/" + aGenRegisterName;
+ std::string component_registerBase = _containerName + "/" + aGenRegisterName;
CORBA::Object_var obj = _NS->ResolveFirst(component_registerBase.c_str());
if (CORBA::is_nil( obj ))
{
*/
//=============================================================================
Engines::Component_ptr
-Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, int studyId)
+Engines_Parallel_Container_i::createPythonInstance(std::string genericRegisterName, int studyId)
{
Engines::Component_var iobject = Engines::Component::_nil();
int numInstance = _numInstance;
char aNumI[12];
sprintf( aNumI , "%d" , numInstance ) ;
- string instanceName = genericRegisterName + "_inst_" + aNumI ;
- string component_registerName = _containerName + "/" + instanceName;
+ std::string instanceName = genericRegisterName + "_inst_" + aNumI ;
+ std::string component_registerName = _containerName + "/" + instanceName;
Py_ACQUIRE_NEW_THREAD;
PyObject *mainmod = PyImport_AddModule("__main__");
genericRegisterName.c_str(),
instanceName.c_str(),
studyId);
- std::string iors = PyString_AsString(result);
+ const char *ior;
+ const char *error;
+ PyArg_ParseTuple(result,"ss", &ior, &error);
+ string iors = ior;
Py_DECREF(result);
Py_RELEASE_NEW_THREAD;
*/
//=============================================================================
Engines::Component_ptr
-Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
+Engines_Parallel_Container_i::createCPPInstance(std::string genericRegisterName,
void *handle,
int studyId)
{
// --- find the factory
- string aGenRegisterName = genericRegisterName;
- string factory_name = aGenRegisterName + string("Engine_factory");
+ std::string aGenRegisterName = genericRegisterName;
+ std::string factory_name = aGenRegisterName + string("Engine_factory");
typedef PortableServer::ObjectId * (*FACTORY_FUNCTION_2)
(CORBA::ORB_ptr,
int numInstance = _numInstance;
char aNumI[12];
sprintf( aNumI , "%d" , numInstance );
- string instanceName = aGenRegisterName + "_inst_" + aNumI;
- string component_registerName =
+ std::string instanceName = aGenRegisterName + "_inst_" + aNumI;
+ std::string component_registerName =
_containerName + "/" + instanceName;
// --- Instanciate required CORBA object
{
char aNumI2[12];
sprintf(aNumI2 , "%d" , getMyRank()) ;
- string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2;
- string component_registerName = _containerName + "/" + instanceName;
+ std::string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2;
+ std::string component_registerName = _containerName + "/" + instanceName;
// --- Instanciate work node
PortableServer::ObjectId *id ; //not owner, do not delete (nore use var)
*/
//=============================================================================
-void Engines_Parallel_Container_i::decInstanceCnt(string genericRegisterName)
+void Engines_Parallel_Container_i::decInstanceCnt(std::string genericRegisterName)
{
if(_cntInstances_map.count(genericRegisterName) !=0 )
{
- string aGenRegisterName =genericRegisterName;
+ std::string aGenRegisterName =genericRegisterName;
MESSAGE("Engines_Parallel_Container_i::decInstanceCnt " << aGenRegisterName);
ASSERT(_cntInstances_map[aGenRegisterName] > 0);
_numInstanceMutex.lock(); // lock to be alone
SCRUTE(_cntInstances_map[aGenRegisterName]);
if (_cntInstances_map[aGenRegisterName] == 0)
{
- string impl_name =
+ std::string impl_name =
Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str());
SCRUTE(impl_name);
void* handle = _library_map[impl_name];
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelContainer : implementation of container and engine for Parallel Kernel
// File : SALOME_ParallelContainer_i.hxx
// Author : André RIBES, EDF
// --- CORBA methods
- virtual bool load_component_Library(const char* componentName);
+ virtual bool load_component_Library(const char* componentName, CORBA::String_out reason);
virtual Engines::Component_ptr
create_component_instance( const char* componentName,
CORBA::Long studyId); // 0 for multiStudy
+ virtual Engines::Component_ptr
+ create_component_instance_env( const char* componentName,
+ CORBA::Long studyId, // 0 for multiStudy
+ const Engines::FieldsDict& env,
+ CORBA::String_out reason);
+
Engines::Component_ptr
find_component_instance( const char* registeredName,
CORBA::Long studyId); // 0 for multiStudy
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelContainer : implementation of container and engine for ParallelKernel
// File : SALOME_ParallelContainer_i.cxx
// Author : André RIBES, EDF
-
+//
#include "SALOME_ParallelGlobalProcessVar_i.hxx"
// Ces variables globales de classes permettent de ne charger
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME_ParallelContainer : implementation of container and engine for Parallel Kernel
// File : SALOME_ParallelContainer_i.hxx
// Author : André RIBES, EDF
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Registry : Registry server implementation
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Registry : Registry server implementation
// File : RegistryConnexion.cxx
// Author : Pascale NOYRET - Antoine YESSAYAN, EDF
{
# include <stdio.h>
}
-using namespace std;
-
Registry::Components_var Connexion( int argc , char **argv , const char *ptrSessionName ) throw( CommException )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Registry : Registry server implementation
// File : RegistryConnexion.hxx
// Author : Pascale NOYRET - Antoine YESSAYAN, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Registry : Registry server implementation
// File : RegistryService.cxx
// Author : Pascale NOYRET - Antoine YESSAYAN, EDF
#include <unistd.h>
#else
#include <process.h>
+#define getpid _getpid
#endif
-using namespace std;
/* ------------------------------*/
/* Constructors and Destructors */
RegistryService::~RegistryService()
{
BEGIN_OF("RegistryService::~RegistryService()") ;
- map<int,client_infos *>::iterator im;
+ std::map<int,client_infos *>::iterator im;
for (im=_reg.begin();im!=_reg.end(); im++)
{
MESSAGE("Delete _reg item " << im->second->_name) ;
return RegistryService::makeseq(_fin) ;
}
-Registry::AllInfos* RegistryService::makeseq(map<int,client_infos *> &mymap )
+Registry::AllInfos* RegistryService::makeseq(std::map<int,client_infos *> &mymap )
{
int i=0 ;
const int RegLength = mymap.size();
all->length(RegLength);
- map<int,client_infos *>::iterator im;
+ std::map<int,client_infos *>::iterator im;
for (im=mymap.begin();im!=mymap.end(); im++)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Registry : Registry server implementation
// File : RegistryService.hxx
// Author : Pascale NOYRET - Antoine YESSAYAN, EDF
# include <map>
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
class REGISTRY_EXPORT RegistryService : public POA_Registry::Components //, public PortableServer::RefCountServantBase
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Registry.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Registry : Registry server implementation
// File : SALOME_Registry_Server.cxx
// Author : Pascale NOYRET - Antoine YESSAYAN, EDF
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
-using namespace std;
int main( int argc , char **argv )
{
const char *registryName = "Registry" ;
long TIMESleep = 250000000;
int NumberOfTries = 40;
+#ifndef WIN32
int a;
+#endif
timespec ts_req;
ts_req.tv_nsec=TIMESleep;
ts_req.tv_sec=0;
MESSAGE("RegistryService servant already existing" ) ;
exit( EXIT_FAILURE ) ;
}
- catch( const ServiceUnreachable &ex )
+ catch( const ServiceUnreachable & )
{
}
- catch( const CORBA::Exception &exx )
+ catch( const CORBA::Exception & )
{
}
- string absoluteName = string("/") + registryName;
+ std::string absoluteName = std::string("/") + registryName;
naming.Register( varComponents , absoluteName.c_str() ) ;
MESSAGE("Wait client requests") ;
try
#endif
orb->run() ;
}
- catch( const CORBA::Exception &ex )
+ catch( const CORBA::Exception & )
{
MESSAGE("System error") ;
return EXIT_FAILURE ;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME ResourcesManager
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "ResourcesManager.hxx"
#include <Basics_Utils.hxx>
#include <fstream>
#define MAX_SIZE_FOR_HOSTNAME 256;
-using namespace std;
-
static LoadRateManagerFirst first;
static LoadRateManagerCycl cycl;
static LoadRateManagerAltCycl altcycl;
{
_path_resources.push_back(xmlFilePath);
#if defined(_DEBUG_) || defined(_DEBUG)
- cerr << "ResourcesManager_cpp constructor" << endl;
+ std::cerr << "ResourcesManager_cpp constructor" << std::endl;
#endif
_resourceManagerMap["first"]=&first;
_resourceManagerMap["cycl"]=&cycl;
li.sort();
vec.clear();
- for (list<ResourceDataToSort>::iterator iter2 = li.begin(); iter2 != li.end(); iter2++)
+ for (std::list<ResourceDataToSort>::iterator iter2 = li.begin(); iter2 != li.end(); iter2++)
vec.push_back((*iter2)._Name);
}
// Send an exception if return list is empty...
if (vec.size() == 0)
{
- std::string error("[GetFittingResources] ResourcesManager doesn't find any resource that feets to your parameters");
+ std::string error("[GetFittingResources] ResourcesManager doesn't find any resource that fits to your parameters");
throw ResourcesException(error);
}
return _resourcesList;
}
-string ResourcesManager_cpp::Find(const std::string& policy, const std::vector<std::string>& listOfResources)
+std::string ResourcesManager_cpp::Find(const std::string& policy, const std::vector<std::string>& listOfResources)
{
if(_resourceManagerMap.count(policy)==0)
return _resourceManagerMap[""]->Find(listOfResources, _resourcesList);
// a computer list is given : take only resources with OS on those computers
std::vector<std::string> vec_tmp = resources;
resources.clear();
- vector<string>::iterator iter = vec_tmp.begin();
+ std::vector<std::string>::iterator iter = vec_tmp.begin();
for (; iter != vec_tmp.end(); iter++)
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
//=============================================================================
void
ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector<std::string>& resources,
- const vector<string>& componentList)
+ const std::vector<std::string>& componentList)
{
std::vector<std::string>::iterator iter = resources.begin();
for (; iter != resources.end(); iter++)
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
- const vector<string>& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList;
+ const std::vector<std::string>& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList;
bool erasedHost = false;
if( mapOfComponentsOfCurrentHost.size() > 0 )
for(unsigned int i=0; i<componentList.size(); i++)
{
const char* compoi = componentList[i].c_str();
- vector<string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
+ std::vector<std::string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
mapOfComponentsOfCurrentHost.end(),
compoi);
if (itt == mapOfComponentsOfCurrentHost.end())
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __RESOURCESMANAGER_HXX__
#define __RESOURCESMANAGER_HXX__
#include <unistd.h>
#endif
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
// --- WARNING ---
// The call of BuildTempFileToLaunchRemoteContainer and RmTmpFile must be done
// in a critical section to be sure to be clean.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __RESOURCESMANAGER_DEFS_HXX__
#define __RESOURCESMANAGER_DEFS_HXX__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_LoadRateManager.hxx"
#include <iostream>
#include <map>
-using namespace std;
-
-string LoadRateManagerFirst::Find(const vector<string>& hosts,
+std::string LoadRateManagerFirst::Find(const std::vector<std::string>& hosts,
MapOfParserResourcesType& resList)
{
if (hosts.size() == 0)
- return string("");
+ return std::string("");
- return string(hosts[0]);
+ return std::string(hosts[0]);
}
-string LoadRateManagerCycl::Find(const vector<string>& hosts,
+std::string LoadRateManagerCycl::Find(const std::vector<std::string>& hosts,
MapOfParserResourcesType& resList)
{
static int imachine = 0;
// if empty list return empty string
if (hosts.size() == 0)
- return string("");
+ return std::string("");
else{
- ParserResourcesType resource = resList[string(hosts[imachine])];
+ ParserResourcesType resource = resList[std::string(hosts[imachine])];
int nbproc = resource.DataForSort._nbOfProcPerNode * resource.DataForSort._nbOfNodes;
if( nbproc <= 0) nbproc = 1;
if( iproc < nbproc ){
iproc++;
- return string(hosts[imachine]);
+ return std::string(hosts[imachine]);
}
else{
iproc = 1;
imachine++;
- if(imachine >= hosts.size())
+ if(imachine >= (int)hosts.size())
imachine = 0;
- return string(hosts[imachine]);
+ return std::string(hosts[imachine]);
}
}
}
-string LoadRateManagerAltCycl::Find(const vector<string>& hosts,
+std::string LoadRateManagerAltCycl::Find(const std::vector<std::string>& hosts,
MapOfParserResourcesType& resList)
{
if (hosts.size() == 0)
- return string("");
+ return std::string("");
std::string selected=hosts[0];
int uses=0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOME_LOADRATEMANAGER_HXX__
#define __SALOME_LOADRATEMANAGER_HXX__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
// File : SALOME_ResourcesCatalog_Handler.cxx
// Author : Estelle Deville
#include <sstream>
#include <map>
-using namespace std;
-
//=============================================================================
/*!
* Constructor
// Empty private elements
_resources_list.clear();
+ //default resources
+ _resource.Clear();
+ _resource.HostName = Kernel_Utils::GetHostname();
+ _resource.Name = Kernel_Utils::GetHostname();
+ _resource.DataForSort._Name = Kernel_Utils::GetHostname();
+ _resources_list[Kernel_Utils::GetHostname()] = _resource;
+
// Get the document root node
xmlNodePtr aCurNode = xmlDocGetRootElement(theDoc);
_resource.DataForSort._Name = Kernel_Utils::GetHostname();
}
}
- map<string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
+ std::map<std::string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
if (iter != _resources_list.end())
RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !");
_resources_list[_resource.Name] = _resource;
_resource.Clear();
if(ProcessCluster(aCurNode, _resource))
{
- map<string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
+ std::map<std::string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
if (iter != _resources_list.end())
RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !");
_resources_list[_resource.Name] = _resource;
}
#ifdef _DEBUG_
- for (map<string, ParserResourcesType>::const_iterator iter = _resources_list.begin();
+ for (std::map<std::string, ParserResourcesType>::const_iterator iter = _resources_list.begin();
iter != _resources_list.end();
iter++)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
// File : SALOME_ResourcesCatalog_Handler.hxx
// Author : Estelle Deville
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_ResourcesCatalog_Parser.hxx"
#include <iostream>
#include <sstream>
#define NULL_VALUE 0
-using namespace std;
-
unsigned int ResourceDataToSort::_nbOfProcWanted = NULL_VALUE;
unsigned int ResourceDataToSort::_nbOfNodesWanted = NULL_VALUE;
unsigned int ResourceDataToSort::_nbOfProcPerNodeWanted = NULL_VALUE;
ResourceDataToSort::ResourceDataToSort()
{}
-ResourceDataToSort::ResourceDataToSort(const string& name,
+ResourceDataToSort::ResourceDataToSort(const std::string& name,
unsigned int nbOfNodes,
unsigned int nbOfProcPerNode,
unsigned int CPUFreqMHz,
//! Method used for debug
void ResourceDataToSort::Print() const
{
- cout << _nbOfNodes << endl;
- cout << _nbOfProcPerNode << endl;
- cout << _CPUFreqMHz << endl;
- cout << _memInMB << endl;
+ std::cout << _nbOfNodes << std::endl;
+ std::cout << _nbOfProcPerNode << std::endl;
+ std::cout << _CPUFreqMHz << std::endl;
+ std::cout << _memInMB << std::endl;
}
void ParserResourcesType::Print()
{
- ostringstream oss;
- oss << endl <<
- "Name : " << Name << endl <<
- "HostName : " << HostName << endl <<
- "NbOfNodes : " << DataForSort._nbOfNodes << endl <<
- "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << endl <<
- "CPUFreqMHz : " << DataForSort._CPUFreqMHz << endl <<
- "MemInMB : " << DataForSort._memInMB << endl <<
- "Protocol : " << Protocol << endl <<
- "ClusterInternalProtocol : " << ClusterInternalProtocol << endl <<
- "Mode : " << Mode << endl <<
- "Batch : " << Batch << endl <<
- "mpi : " << mpi << endl <<
- "UserName : " << UserName << endl <<
- "AppliPath : " << AppliPath << endl <<
- "OS : " << OS << endl <<
- "batchQueue : " << batchQueue << endl <<
- "userCommands : " << userCommands << endl <<
- "use : " << use << endl <<
- "NbOfProc : " << nbOfProc << endl <<
- "Modules : " << endl <<
- "Components : " << endl;
-
- for(int i=0;i<ComponentsList.size();i++)
- oss << "Component " << i+1 << " called : " << ComponentsList[i] << endl;
+ std::ostringstream oss;
+ oss << std::endl <<
+ "Name : " << Name << std::endl <<
+ "HostName : " << HostName << std::endl <<
+ "NbOfNodes : " << DataForSort._nbOfNodes << std::endl <<
+ "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << std::endl <<
+ "CPUFreqMHz : " << DataForSort._CPUFreqMHz << std::endl <<
+ "MemInMB : " << DataForSort._memInMB << std::endl <<
+ "Protocol : " << Protocol << std::endl <<
+ "ClusterInternalProtocol : " << ClusterInternalProtocol << std::endl <<
+ "Mode : " << Mode << std::endl <<
+ "Batch : " << Batch << std::endl <<
+ "mpi : " << mpi << std::endl <<
+ "UserName : " << UserName << std::endl <<
+ "AppliPath : " << AppliPath << std::endl <<
+ "OS : " << OS << std::endl <<
+ "batchQueue : " << batchQueue << std::endl <<
+ "userCommands : " << userCommands << std::endl <<
+ "use : " << use << std::endl <<
+ "NbOfProc : " << nbOfProc << std::endl <<
+ "Modules : " << std::endl <<
+ "Components : " << std::endl;
+
+ for(unsigned int i=0;i<ComponentsList.size();i++)
+ oss << "Component " << i+1 << " called : " << ComponentsList[i] << std::endl;
std::list<ParserResourcesClusterMembersType>::iterator it;
it != ClusterMembersList.end();
it++)
{
- oss << "Cluster member called : " << (*it).HostName << endl;
+ oss << "Cluster member called : " << (*it).HostName << std::endl;
}
- cout << oss.str() << endl;
+ std::cout << oss.str() << std::endl;
}
std::string
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
// File : SALOME_ResourcesCatalog_Parser.hxx
// Author : Estelle Deville
#include <map>
#include <iostream>
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
enum AccessProtocolType {rsh, ssh};
enum AccessModeType {interactive, batch};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_ResourcesManager.hxx"
#include "Utils_ExceptHandlers.hxx"
#include "Utils_CorbaException.hxx"
#define MAX_SIZE_FOR_HOSTNAME 256;
-using namespace std;
-
const char *SALOME_ResourcesManager::_ResourcesManagerNameInNS = "/ResourcesManager";
//=============================================================================
p.cpu_clock = params.cpu_clock;
p.mem_mb = params.mem_mb;
for(unsigned int i=0; i<params.componentList.length(); i++)
- p.componentList.push_back(string(params.componentList[i]));
+ p.componentList.push_back(std::string(params.componentList[i]));
for(unsigned int i=0; i<params.resList.length(); i++)
- p.resourceList.push_back(string(params.resList[i]));
+ p.resourceList.push_back(std::string(params.resList[i]));
try
{
// Call C++ ResourceManager
- vector <std::string> vec = _rm.GetFittingResources(p);
+ std::vector <std::string> vec = _rm.GetFittingResources(p);
// C++ -> CORBA
ret->length(vec.size());
SALOME_ResourcesManager::FindFirst(const Engines::ResourceList& listOfResources)
{
// CORBA -> C++
- vector<string> rl;
+ std::vector<std::string> rl;
for(unsigned int i=0; i<listOfResources.length(); i++)
- rl.push_back(string(listOfResources[i]));
+ rl.push_back(std::string(listOfResources[i]));
return CORBA::string_dup(_rm.Find("first", rl).c_str());
}
SALOME_ResourcesManager::Find(const char* policy, const Engines::ResourceList& listOfResources)
{
// CORBA -> C++
- vector<string> rl;
+ std::vector<std::string> rl;
for(unsigned int i=0; i<listOfResources.length(); i++)
- rl.push_back(string(listOfResources[i]));
+ rl.push_back(std::string(listOfResources[i]));
return CORBA::string_dup(_rm.Find(policy, rl).c_str());
}
// Creating machine file
machine_file_name = tmpnam(NULL);
- std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
+ std::ofstream machine_file(machine_file_name.c_str(), std::ios_base::out);
CORBA::Long machine_number = 0;
std::list<std::string>::iterator it = list_of_machines.begin();
while (machine_number != nb_procs)
{
// Adding a new node to the machine file
- machine_file << *it << endl;
+ machine_file << *it << std::endl;
// counting...
it++;
{
// Creating machine file
machine_file_name = tmpnam(NULL);
- std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
+ std::ofstream machine_file(machine_file_name.c_str(), std::ios_base::out);
// We add all cluster machines to the file
std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
{
unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
(*cluster_it).DataForSort._nbOfProcPerNode;
- machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl;
+ machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << std::endl;
cluster_it++;
}
}
{
// Creating machine file
machine_file_name = tmpnam(NULL);
- std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
+ std::ofstream machine_file(machine_file_name.c_str(), std::ios_base::out);
// We add all cluster machines to the file
std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
{
unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
(*cluster_it).DataForSort._nbOfProcPerNode;
- machine_file << (*cluster_it).HostName << " slots=" << number_of_proc << endl;
+ machine_file << (*cluster_it).HostName << " slots=" << number_of_proc << std::endl;
cluster_it++;
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOME_RESOURCESMANAGER_HXX__
#define __SALOME_RESOURCESMANAGER_HXX__
# define SALOMERESOURCESMANAGER_EXPORT
#endif
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#endif
+
// --- WARNING ---
// The call of BuildTempFileToLaunchRemoteContainer and RmTmpFile must be done
// in a critical section to be sure to be clean.
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS.cxx
// Author : Sergey ANIKIN
#include CORBA_SERVER_HEADER(SALOMEDS)
#include <SALOME_NamingService.hxx>
-using namespace SALOMEDS;
-
// PAL8065: san -- Global recursive mutex for SALOMEDS methods
-Utils_Mutex Locker::MutexDS;
+Utils_Mutex SALOMEDS::Locker::MutexDS;
// PAL8065: san -- Global SALOMEDS locker
-Locker::Locker()
+SALOMEDS::Locker::Locker()
: Utils_Locker( &MutexDS )
{}
-Locker::~Locker()
+SALOMEDS::Locker::~Locker()
{}
void SALOMEDS::lock()
void SALOMEDS::unlock()
{
- Locker::MutexDS.unlock();
+ SALOMEDS::Locker::MutexDS.unlock();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS.hxx
// Author : Sergey ANIKIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttLong_i.cxx
// Author : Estelle Deville
#include "utilities.h"
#include <stdio.h>
#include <SALOMEDSImpl_AttributeInteger.hxx>
-using namespace std;
+
//============================================================================
/*! Function : Set
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttLong_i.hxx
// Author : Estelle Deville
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttReal_i.cxx
// Author : Estelle Deville
#include <stdio.h>
#include <cstring>
#include <SALOMEDSImpl_AttributeReal.hxx>
-using namespace std;
+
//============================================================================
/*! Function : Set
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttReal_i.hxx
// Author : Estelle Deville
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeComment.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeComment.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeComment_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeComment_i::Value()
{
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- string aValue((char*)Str.in());
+ std::string aValue((char*)Str.in());
dynamic_cast<SALOMEDSImpl_AttributeComment*>(_impl)->SetValue(aValue);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeComment_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeDrawable.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeDrawable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeDrawable_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeDrawable_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeDrawable_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExpandable.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExpandable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExpandable_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeExpandable_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExpandable_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExternalFileDef.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExternalFileDef.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExternalFileDef_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeExternalFileDef_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_impl)->SetValue(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_impl)->SetValue(std::string(Str));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeExternalFileDef_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFileType.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFileType.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFileType_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeFileType_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeFileType_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- string aValue((char*)Str.in());
+ std::string aValue((char*)Str.in());
dynamic_cast<SALOMEDSImpl_AttributeFileType*>(_impl)->SetValue(aValue);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFileType_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFlags.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFlags.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFlags_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeFlags_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
/*
Class : SALOMEDS_AttributeFlags_i
Description : This class is intended for storing different object attributes that
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFlags_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeGraphic.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeGraphic.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeGraphic_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeGraphic_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
/*
Class : SALOMEDS_AttributeGraphic_i
Description : This class is intended for storing information about
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeFlags_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeIOR.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeIOR_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeIOR_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeIOR_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- string anExtStr((char *)Str.in());
+ std::string anExtStr((char *)Str.in());
dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_impl)->SetValue(anExtStr);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeIOR_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeInteger.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeInteger_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeInteger_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Long SALOMEDS_AttributeInteger_i::Value()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeInteger_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeLocalID.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeLocalID.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeLocalID_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeLocalID_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Long SALOMEDS_AttributeLocalID_i::Value()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeLocalID_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeName.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeName.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeName_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeName_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeName_i::Value()
{
SALOMEDS::Locker lock;
{
SALOMEDS::Locker lock;
CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeName*>(_impl)->SetValue(string(value));
+ dynamic_cast<SALOMEDSImpl_AttributeName*>(_impl)->SetValue(std::string(value));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeName_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeOpened.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeOpened.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeOpened_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeOpened_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeOpened_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeParameter.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <string>
-using namespace std;
-
//=======================================================================
/*!
* Function : Constructor
* Purpose : Associates a integer value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetInt(const string& theID, const int theValue)
+void SALOMEDS_AttributeParameter::SetInt(const std::string& theID, const int theValue)
{
CheckLocked();
* Purpose : Returns a int value associated with the given ID
*/
//=======================================================================
-int SALOMEDS_AttributeParameter::GetInt(const string& theID)
+int SALOMEDS_AttributeParameter::GetInt(const std::string& theID)
{
int aValue;
if(_isLocal) {
* Purpose : Associates a double value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetReal(const string& theID, const double& theValue)
+void SALOMEDS_AttributeParameter::SetReal(const std::string& theID, const double& theValue)
{
CheckLocked();
* Purpose : Returns a double value associated with the given ID
*/
//=======================================================================
-double SALOMEDS_AttributeParameter::GetReal(const string& theID)
+double SALOMEDS_AttributeParameter::GetReal(const std::string& theID)
{
double aValue;
if(_isLocal) {
* Purpose : Associates a string with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetString(const string& theID, const string& theValue)
+void SALOMEDS_AttributeParameter::SetString(const std::string& theID, const std::string& theValue)
{
CheckLocked();
* Purpose : Returns a string associated with the given ID
*/
//=======================================================================
-string SALOMEDS_AttributeParameter::GetString(const string& theID)
+std::string SALOMEDS_AttributeParameter::GetString(const std::string& theID)
{
- string aValue;
+ std::string aValue;
if(_isLocal) {
SALOMEDS::Locker lock;
aValue = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetString(theID);
* Purpose : Associates a bool value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetBool(const string& theID, const bool& theValue)
+void SALOMEDS_AttributeParameter::SetBool(const std::string& theID, const bool& theValue)
{
CheckLocked();
* Purpose : Returns a bool value associated with the ID
*/
//=======================================================================
-bool SALOMEDS_AttributeParameter::GetBool(const string& theID)
+bool SALOMEDS_AttributeParameter::GetBool(const std::string& theID)
{
if(_isLocal) {
SALOMEDS::Locker lock;
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
+void SALOMEDS_AttributeParameter::SetRealArray(const std::string& theID, const std::vector<double>& theArray)
{
CheckLocked();
* Purpose : Returns an array of double values associated with the ID
*/
//=======================================================================
-vector<double> SALOMEDS_AttributeParameter::GetRealArray(const string& theID)
+std::vector<double> SALOMEDS_AttributeParameter::GetRealArray(const std::string& theID)
{
- vector<double> v;
+ std::vector<double> v;
if(_isLocal) {
SALOMEDS::Locker lock;
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetRealArray(theID);
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
+void SALOMEDS_AttributeParameter::SetIntArray(const std::string& theID, const std::vector<int>& theArray)
{
CheckLocked();
* Purpose : Returns an array of int values associated with the ID
*/
//=======================================================================
-vector<int> SALOMEDS_AttributeParameter::GetIntArray(const string& theID)
+std::vector<int> SALOMEDS_AttributeParameter::GetIntArray(const std::string& theID)
{
- vector<int> v;
+ std::vector<int> v;
if(_isLocal) {
SALOMEDS::Locker lock;
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetIntArray(theID);
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
+void SALOMEDS_AttributeParameter::SetStrArray(const std::string& theID, const std::vector<std::string>& theArray)
{
CheckLocked();
* Purpose : Returns an array of string values associated with the ID
*/
//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetStrArray(const string& theID)
+std::vector<std::string> SALOMEDS_AttributeParameter::GetStrArray(const std::string& theID)
{
- vector<string> v;
+ std::vector<std::string> v;
if(_isLocal) {
SALOMEDS::Locker lock;
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetStrArray(theID);
int length = aSeq->length();
if(length) {
v.resize(length);
- for(int i = 0; i < length; i++) v[i] = string(aSeq[i].in());
+ for(int i = 0; i < length; i++) v[i] = std::string(aSeq[i].in());
}
}
return v;
* a value in the attribute
*/
//=======================================================================
-bool SALOMEDS_AttributeParameter::IsSet(const string& theID, const int theType)
+bool SALOMEDS_AttributeParameter::IsSet(const std::string& theID, const int theType)
{
if(_isLocal) {
SALOMEDS::Locker lock;
* Purpose : Removes a parameter with given ID
*/
//=======================================================================
-bool SALOMEDS_AttributeParameter::RemoveID(const string& theID, const int theType)
+bool SALOMEDS_AttributeParameter::RemoveID(const std::string& theID, const int theType)
{
CheckLocked();
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetIDs(const int theType)
+std::vector<std::string> SALOMEDS_AttributeParameter::GetIDs(const int theType)
{
- vector<string> v;
+ std::vector<std::string> v;
if(_isLocal) {
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeParameter* AP_impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl);
int length = CorbaSeq->length();
if(length) {
v.resize(length);
- for(int i = 0; i <length; i++) v[i] = string(CorbaSeq[i].in());
+ for(int i = 0; i <length; i++) v[i] = std::string(CorbaSeq[i].in());
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeParameter.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeParameter_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
-using namespace std;
+#include "Utils_ExceptHandlers.hxx"
+UNEXPECT_CATCH(AP_InvalidIdentifier, SALOMEDS::AttributeParameter::InvalidIdentifier);
//=======================================================================
/*!
*/
//=======================================================================
CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetInt(theID);
}
*/
//=======================================================================
CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetReal(theID);
}
*/
//=======================================================================
char* SALOMEDS_AttributeParameter_i::GetString(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDSImpl_AttributeParameter* impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl);
CORBA::String_var c_s = CORBA::string_dup(impl->GetString(theID).c_str());
return c_s._retn();
*/
//=======================================================================
CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetBool(theID);
}
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> v;
+ std::vector<double> v;
int length = theArray.length();
if(length) {
v.resize(length);
*/
//=======================================================================
SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq;
- vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
+ std::vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
int length = v.size();
if(length) {
aSeq->length(length);
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<int> v;
+ std::vector<int> v;
int length = theArray.length();
if(length) {
v.resize(length);
*/
//=======================================================================
SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq;
- vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
+ std::vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
int length = v.size();
if(length) {
aSeq->length(length);
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<string> v;
+ std::vector<std::string> v;
int length = theArray.length();
if(length) {
v.resize(length);
- for(int i = 0; i<length; i++) v[i] = string(theArray[i].in());
+ for(int i = 0; i<length; i++) v[i] = std::string(theArray[i].in());
}
dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetStrArray(theID, v);
}
*/
//=======================================================================
SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
{
SALOMEDS::Locker lock;
+ Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq;
- vector<string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
+ std::vector<std::string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
int length = v.size();
if(length) {
aSeq->length(length);
{
SALOMEDS::Locker lock;
SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
+ std::vector<std::string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
if(A.size()) {
int length = A.size();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeParameter_i.hxx
// Author : Sergey RUIN
// Module : SALOME
virtual void SetInt(const char* theID, CORBA::Long theValue);
- virtual CORBA::Long GetInt(const char* theID);
+ virtual CORBA::Long GetInt(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
virtual void SetReal(const char* theID, CORBA::Double theValue);
- virtual CORBA::Double GetReal(const char* theID);
+ virtual CORBA::Double GetReal(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
virtual void SetString(const char* theID, const char* theValue);
- virtual char* GetString(const char* theID);
+ virtual char* GetString(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
virtual void SetBool(const char* theID, CORBA::Boolean theValue);
- virtual CORBA::Boolean GetBool(const char* theID);
+ virtual CORBA::Boolean GetBool(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
virtual void SetRealArray(const char* theID, const SALOMEDS::DoubleSeq& theArray);
- virtual SALOMEDS::DoubleSeq* GetRealArray(const char* theID);
-
+ virtual SALOMEDS::DoubleSeq* GetRealArray(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
+
virtual void SetIntArray(const char* theID, const SALOMEDS::LongSeq& theArray);
- virtual SALOMEDS::LongSeq* GetIntArray(const char* theID);
+ virtual SALOMEDS::LongSeq* GetIntArray(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
virtual void SetStrArray(const char* theID, const SALOMEDS::StringSeq& theArray);
- virtual SALOMEDS::StringSeq* GetStrArray(const char* theID);
+ virtual SALOMEDS::StringSeq* GetStrArray(const char* theID)
+ throw (SALOMEDS::AttributeParameter::InvalidIdentifier);
virtual CORBA::Boolean IsSet(const char* theID, CORBA::Long theType);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePersistentRef.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePersistentRef.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePersistentRef_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributePersistentRef_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributePersistentRef_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_impl)->SetValue(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_impl)->SetValue(std::string(Str));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePersistentRef_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePixMap.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePixMap.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePixMap_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributePixMap_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->SetPixMap(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->SetPixMap(std::string(Str));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePixMap_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePythonObject.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePythonObject.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePythonObject_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributePythonObject_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript)
{
SALOMEDS::Locker lock;
char* SALOMEDS_AttributePythonObject_i::GetObject()
{
SALOMEDS::Locker lock;
- string aSeq(dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->GetObject());
+ std::string aSeq(dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->GetObject());
CORBA::String_var aStr = CORBA::string_dup(aSeq.c_str());
return aStr._retn();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributePythonObject_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeReal.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeReal.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeReal_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS.hxx"
#include <sstream>
-using namespace std;
-
CORBA::Double SALOMEDS_AttributeReal_i::Value()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeReal_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSelectable.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSelectable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSelectable_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeSelectable_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable()
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSelectable_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfInteger.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfInteger_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
-using namespace std;
-
-
void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other)
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<int> aSeq;
+ std::vector<int> aSeq;
for(int i = 0, len = other.length(); i<len; i++) aSeq.push_back(other[i]);
dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Assign(aSeq);
}
{
SALOMEDS::Locker lock;
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- const vector<int>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Array();
+ const std::vector<int>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Array();
int len = CasCadeSeq.size();
CorbaSeq->length(len);
for (int i = 0; i < len; i++) {
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfInteger_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfReal.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfReal.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfReal_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS.hxx"
#include <vector>
-using namespace std;
-
void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other)
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> CasCadeSeq;
+ std::vector<double> CasCadeSeq;
for (int i = 0; i < other.length(); i++) {
CasCadeSeq.push_back(other[i]);
}
{
SALOMEDS::Locker lock;
SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- const vector<double>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Array();
+ const std::vector<double>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Array();
int len = CasCadeSeq.size();
CorbaSeq->length(len);
for (int i = 0; i < len; i++) {
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeSequenceOfSequenceOfReal_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeString.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeString.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeString_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeString_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeString*>(_impl)->SetValue(string(value));
+ dynamic_cast<SALOMEDSImpl_AttributeString*>(_impl)->SetValue(std::string(value));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeString_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeStudyProperties.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeStudyProperties.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_AttributeStudyProperties::SALOMEDS_AttributeStudyProperties
(SALOMEDSImpl_AttributeStudyProperties* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
int aTmp;
if (anImpl->GetCreationDate(aTmp, aTmp, aTmp, aTmp, aTmp)) return;
- string S;
+ std::string S;
anImpl->SetModification(S, theMinute, theHour, theDay, theMonth, theYear);
} else {
((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetCreationDate(theMinute,
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
anImpl->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
aLength = aNames.size();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeStudyProperties.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeStudyProperties_i.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDS_AttributeStudyProperties_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
#define CREATION_MODE_NOTDEFINED 0
#define CREATION_MODE_SCRATCH 1
char* SALOMEDS_AttributeStudyProperties_i::GetUserName()
{
SALOMEDS::Locker lock;
- string S = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreatorName();
+ std::string S = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreatorName();
CORBA::String_var c_s = CORBA::string_dup(S.c_str());
return c_s._retn();
}
SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
int aTmp;
if (aProp->GetCreationDate(aTmp, aTmp, aTmp, aTmp, aTmp)) return;
- string S;
+ std::string S;
aProp->SetModification(S, theMinute, theHour, theDay, theMonth, theYear);
}
CORBA::Boolean theWithCreator)
{
SALOMEDS::Locker lock;
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
int aLength = aNames.size();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeStudyProperties_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfInteger.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeTableOfInteger.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
(SALOMEDSImpl_AttributeTableOfInteger* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
}
+std::string SALOMEDS_AttributeTableOfInteger::GetRowTitle(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowTitle(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowTitle(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vector<std::string>& theTitles)
{
int aLength = theTitles.size(), i;
if (_isLocal) {
CheckLocked();
SALOMEDS::Locker lock;
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
for (i = 0; i < aLength; i++) aSeq.push_back(theTitles[i]);
dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowTitles(aSeq);
}
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
}
+std::string SALOMEDS_AttributeTableOfInteger::GetColumnTitle(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetColumnTitle(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumnTitle(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vector<std::string>& theTitles)
{
int aLength = theTitles.size(), i;
if (_isLocal) {
CheckLocked();
SALOMEDS::Locker lock;
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
for (i = 0; i < aLength; i++) aSeq.push_back(theTitles[i]);
dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetColumnTitles(aSeq);
}
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
}
+std::string SALOMEDS_AttributeTableOfInteger::GetRowUnit(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowUnit(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowUnit(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vector<std::string>& theUnits)
{
int aLength = theUnits.size(), i;
aTable->SetRowData(aTable->GetNbRows() + 1, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetRowData(theRow, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetColumnData(theColumn, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->PutValue(theValue, theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
else {
aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetValue(theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
else {
return aValue;
}
+void SALOMEDS_AttributeTableOfInteger::RemoveValue(int theRow, int theColumn)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->RemoveValue(theRow, theColumn);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->RemoveValue(theRow, theColumn);
+ }
+}
+
std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRowSetIndices(int theRow)
{
std::vector<int> aVector;
}
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
}
+
+std::vector<int> SALOMEDS_AttributeTableOfInteger::SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortRow(theRow,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortRow(theRow,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfInteger::SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortColumn(theColumn,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortColumn(theColumn,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfInteger::SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortByRow(theRow,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortByRow(theRow,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfInteger::SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortByColumn(theColumn,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortByColumn(theColumn,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+void SALOMEDS_AttributeTableOfInteger::SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+}
+
+void SALOMEDS_AttributeTableOfInteger::SwapRows(int theRow1, int theRow2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SwapRows(theRow1, theRow2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SwapRows(theRow1, theRow2);
+ }
+}
+
+void SALOMEDS_AttributeTableOfInteger::SwapColumns(int theColumn1, int theColumn2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SwapColumns(theColumn1, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SwapColumns(theColumn1, theColumn2);
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
virtual void SetTitle(const std::string& theTitle);
virtual std::string GetTitle();
virtual void SetRowTitle(int theIndex, const std::string& theTitle);
+ virtual std::string GetRowTitle(int theIndex);
virtual void SetRowTitles(const std::vector<std::string>& theTitles);
virtual std::vector<std::string> GetRowTitles();
virtual void SetColumnTitle(int theIndex, const std::string& theTitle);
+ virtual std::string GetColumnTitle(int theIndex);
virtual void SetColumnTitles(const std::vector<std::string>& theTitles);
virtual std::vector<std::string> GetColumnTitles();
virtual void SetRowUnit(int theIndex, const std::string& theUnit);
+ virtual std::string GetRowUnit(int theIndex);
virtual void SetRowUnits(const std::vector<std::string>& theUnits);
virtual std::vector<std::string> GetRowUnits();
virtual void PutValue(int theValue, int theRow, int theColumn);
virtual bool HasValue(int theRow, int theColumn);
virtual int GetValue(int theRow, int theColumn);
+ virtual void RemoveValue(int theRow, int theColumn);
virtual std::vector<int> GetRowSetIndices(int theRow);
virtual void SetNbColumns(int theNbColumns);
+ virtual std::vector<int> SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy);
+ virtual void SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2);
+ virtual void SwapRows(int theRow1, int theRow2);
+ virtual void SwapColumns(int theColumn1, int theColumn2);
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfInteger_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <string>
#include <vector>
-using namespace std;
-
-UNEXPECT_CATCH(ATI_IncorrectIndex, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
-UNEXPECT_CATCH(ATI_IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
+UNEXPECT_CATCH(ATI_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex);
+UNEXPECT_CATCH(ATI_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength);
void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle)
{
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var aStr = CORBA::string_dup(theTitle);
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->SetTitle(string(aStr));
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->SetTitle(std::string(aStr));
}
char* SALOMEDS_AttributeTableOfInteger_i::GetTitle()
}
void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theIndex < 1 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ aTable->SetRowTitle(theIndex, std::string(theTitle));
+}
+
+char* SALOMEDS_AttributeTableOfInteger_i::GetRowTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATI_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- aTable->SetRowTitle(theIndex, string(theTitle));
+ if (theIndex < 1 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetRowTitle(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theTitles.length(); i++) {
SetRowTitle(i + 1, theTitles[i]);
}
}
void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATI_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ if (theIndex < 1 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetColumnTitle(theIndex, string(aStr));
+ aTable->SetColumnTitle(theIndex, std::string(aStr));
+}
+
+char* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theIndex < 1 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetColumnTitle(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theTitles.length(); i++) {
aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
}
//Units support
void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATI_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- aTable->SetRowUnit(theIndex, string(theUnit));
+ if (theIndex < 1 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ aTable->SetRowUnit(theIndex, std::string(theUnit));
+}
+
+char* SALOMEDS_AttributeTableOfInteger_i::GetRowUnit(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theIndex < 1 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetRowUnit(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theUnits.length(); i++) {
aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
}
}
void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- vector<int> aRow;
+ std::vector<int> aRow;
for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
try {
aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- vector<int> aRow;
+ std::vector<int> aRow;
for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
try {
aTable->SetRowData(theRow, aRow);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aRow = aTable->GetRowData(theRow);
+ std::vector<int> aRow = aTable->GetRowData(theRow);
CorbaSeq->length(aRow.size());
for (int i = 0; i < aRow.size(); i++) {
CorbaSeq[i] = aRow[i];
}
void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- vector<int> aColumn;
+ std::vector<int> aColumn;
for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
try {
aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- vector<int> aColumn;
+ std::vector<int> aColumn;
for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
try {
aTable->SetColumnData(theColumn, aColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aColumn = aTable->GetColumnData(theColumn);
+ std::vector<int> aColumn = aTable->GetColumnData(theColumn);
CorbaSeq->length(aColumn.size());
for (int i = 0; i < aColumn.size(); i++) {
CorbaSeq[i] = aColumn[i];
}
void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectIndex);
aTable->PutValue(theValue, theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
}
CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATI_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
CORBA::Long aValue;
try {
aValue = aTable->GetValue(theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
return aValue;
}
+void SALOMEDS_AttributeTableOfInteger_i::RemoveValue(CORBA::Long theRow, CORBA::Long theColumn)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->RemoveValue(theRow, theColumn);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::Long theRow)
{
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
+ if(theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aSeq = aTable->GetSetRowIndices(theRow);
+ std::vector<int> aSeq = aTable->GetSetRowIndices(theRow);
CorbaSeq->length(aSeq.size());
for (int i = 0; i < aSeq.size(); i++) {
CorbaSeq[i] = aSeq[i];
return CorbaSeq._retn();
}
-
void SALOMEDS_AttributeTableOfInteger_i::SetNbColumns(CORBA::Long theNbColumns)
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- string aStream((char*)&theStream[0], theStream.length());
+ std::string aStream((char*)&theStream[0], theStream.length());
aTable->Load(aStream);
return true;
}
-SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile()
+SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile()
{
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- string aString = aTable->Save();
+ std::string aString = aTable->Save();
char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
int aBufferSize = strlen((char*)aBuffer);
return aStreamFile._retn();
}
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortRow(CORBA::Long theRow,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortRow(theRow, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortColumn(CORBA::Long theColumn,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortColumn(theColumn, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByRow(CORBA::Long theRow,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortByRow(theRow, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByColumn(CORBA::Long theColumn,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortByColumn(theColumn, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+void SALOMEDS_AttributeTableOfInteger_i::SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1,
+ CORBA::Long theRow2, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theRow1 < 1 || theRow1 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn1 < 1 || theColumn1 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theRow2 < 1 || theRow2 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn2 < 1 || theColumn2 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
+void SALOMEDS_AttributeTableOfInteger_i::SwapRows(CORBA::Long theRow1, CORBA::Long theRow2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theRow1 < 1 || theRow1 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theRow2 < 1 || theRow2 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapRows(theRow1, theRow2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
+void SALOMEDS_AttributeTableOfInteger_i::SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATI_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+ if (theColumn1 < 1 || theColumn1 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn2 < 1 || theColumn2 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ try {
+ aTable->SwapColumns(theColumn1, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfInteger_i.hxx
// Author : Sergey RUIN
// Module : SALOME
class SALOMEDS_AttributeTableOfInteger_i: public virtual POA_SALOMEDS::AttributeTableOfInteger,
public virtual SALOMEDS_GenericAttribute_i
{
-
public:
-
SALOMEDS_AttributeTableOfInteger_i(SALOMEDSImpl_AttributeTableOfInteger* theAttr, CORBA::ORB_ptr orb)
:SALOMEDS_GenericAttribute_i(theAttr, orb) {};
virtual void SetTitle(const char* theTitle);
virtual char* GetTitle();
virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetRowTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetRowTitles();
virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetColumnTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetColumnTitles();
virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetRowUnit(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetRowUnits();
virtual CORBA::Long GetNbRows();
virtual CORBA::Long GetNbColumns();
virtual void AddRow(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual void SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::LongSeq* GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void AddColumn(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::LongSeq* GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn);
virtual CORBA::Long GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow);
virtual void SetNbColumns(CORBA::Long theNbColumns);
+ virtual SALOMEDS::LongSeq* SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+
+ virtual void SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1,
+ CORBA::Long theRow2, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+
virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream);
virtual SALOMEDS::TMPFile* SaveToFile();
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfReal.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeTableOfReal.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal
(SALOMEDSImpl_AttributeTableOfReal* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
}
+std::string SALOMEDS_AttributeTableOfReal::GetRowTitle(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowTitle(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowTitle(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector<std::string>& theTitles)
{
CheckLocked();
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
}
+std::string SALOMEDS_AttributeTableOfReal::GetColumnTitle(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetColumnTitle(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumnTitle(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vector<std::string>& theTitles)
{
int aLength = theTitles.size(), i;
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
}
+std::string SALOMEDS_AttributeTableOfReal::GetRowUnit(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowUnit(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnit(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector<std::string>& theUnits)
{
int aLength = theUnits.size(), i;
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnits();
aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back(string(aSeq[i].in()));
+ for (i = 0; i < aLength; i++) aVector.push_back(std::string(aSeq[i].in()));
}
return aVector;
}
aTable->SetRowData(aTable->GetNbRows() + 1, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetRowData(theRow, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetColumnData(theColumn, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->PutValue(theValue, theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
else {
aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetValue(theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
else {
return aValue;
}
+void SALOMEDS_AttributeTableOfReal::RemoveValue(int theRow, int theColumn)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->RemoveValue(theRow, theColumn);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->RemoveValue(theRow, theColumn);
+ }
+}
+
std::vector<int> SALOMEDS_AttributeTableOfReal::GetRowSetIndices(int theRow)
{
std::vector<int> aVector;
}
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
}
+
+std::vector<int> SALOMEDS_AttributeTableOfReal::SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortRow(theRow,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortRow(theRow,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfReal::SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortColumn(theColumn,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortColumn(theColumn,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfReal::SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortByRow(theRow,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortByRow(theRow,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfReal::SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortByColumn(theColumn,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortByColumn(theColumn,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+void SALOMEDS_AttributeTableOfReal::SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+}
+
+void SALOMEDS_AttributeTableOfReal::SwapRows(int theRow1, int theRow2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SwapRows(theRow1, theRow2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SwapRows(theRow1, theRow2);
+ }
+}
+
+void SALOMEDS_AttributeTableOfReal::SwapColumns(int theColumn1, int theColumn2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SwapColumns(theColumn1, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SwapColumns(theColumn1, theColumn2);
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfReal.hxx
// Author : Sergey RUIN
// Module : SALOME
virtual void SetTitle(const std::string& theTitle);
virtual std::string GetTitle();
virtual void SetRowTitle(int theIndex, const std::string& theTitle);
+ virtual std::string GetRowTitle(int theIndex);
virtual void SetRowTitles(const std::vector<std::string>& theTitles);
virtual std::vector<std::string> GetRowTitles();
virtual void SetColumnTitle(int theIndex, const std::string& theTitle);
+ virtual std::string GetColumnTitle(int theIndex);
virtual void SetColumnTitles(const std::vector<std::string>& theTitles);
virtual std::vector<std::string> GetColumnTitles();
virtual void SetRowUnit(int theIndex, const std::string& theUnit);
+ virtual std::string GetRowUnit(int theIndex);
virtual void SetRowUnits(const std::vector<std::string>& theUnits);
virtual std::vector<std::string> GetRowUnits();
virtual void PutValue(double theValue, int theRow, int theColumn);
virtual bool HasValue(int theRow, int theColumn);
virtual double GetValue(int theRow, int theColumn);
+ virtual void RemoveValue(int theRow, int theColumn);
virtual std::vector<int> GetRowSetIndices(int theRow);
virtual void SetNbColumns(int theNbColumns);
+ virtual std::vector<int> SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy);
+ virtual void SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2);
+ virtual void SwapRows(int theRow1, int theRow2);
+ virtual void SwapColumns(int theColumn1, int theColumn2);
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfReal_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <string>
#include <vector>
-using namespace std;
-
#include "Utils_ExceptHandlers.hxx"
-UNEXPECT_CATCH(ATR_IncorrectIndex, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
-UNEXPECT_CATCH(ATR_IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
+UNEXPECT_CATCH(ATR_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex);
+UNEXPECT_CATCH(ATR_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength);
void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle)
{
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetTitle(string(aStr));
+ aTable->SetTitle(std::string(aStr));
}
char* SALOMEDS_AttributeTableOfReal_i::GetTitle()
}
void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATR_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- aTable->SetRowTitle(theIndex, string(theTitle));
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ aTable->SetRowTitle(theIndex, std::string(theTitle));
+}
+
+char* SALOMEDS_AttributeTableOfReal_i::GetRowTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetRowTitle(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theTitles.length(); i++) {
aTable->SetRowTitle(i + 1, (char*)theTitles[i].in());
}
}
void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATR_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetColumnTitle(theIndex, string(aStr));
+ aTable->SetColumnTitle(theIndex, std::string(aStr));
+}
+
+char* SALOMEDS_AttributeTableOfReal_i::GetColumnTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetColumnTitle(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theTitles.length(); i++) {
aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
}
//Units support
void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATR_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- aTable->SetRowUnit(theIndex, string(theUnit));
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ aTable->SetRowUnit(theIndex, std::string(theUnit));
+}
+
+char* SALOMEDS_AttributeTableOfReal_i::GetRowUnit(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetRowUnit(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch (ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
+ if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theUnits.length(); i++) {
aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
}
}
void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- vector<double> aRow;
+ std::vector<double> aRow;
for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
}
void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- vector<double> aRow;
+ std::vector<double> aRow;
for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
aTable->SetRowData(theRow, aRow);
}
SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- vector<double> aRow = aTable->GetRowData(theRow);
+ std::vector<double> aRow = aTable->GetRowData(theRow);
CorbaSeq->length(aRow.size());
for (int i = 0; i < aRow.size(); i++) {
CorbaSeq[i] = aRow[i];
}
void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- vector<double> aColumn;
+ std::vector<double> aColumn;
for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
}
void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- vector<double> aColumn;
+ std::vector<double> aColumn;
for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
aTable->SetColumnData(theColumn, aColumn);
}
SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- vector<double> aColumn = aTable->GetColumnData(theColumn);
+ std::vector<double> aColumn = aTable->GetColumnData(theColumn);
CorbaSeq->length(aColumn.size());
for (int i = 0; i < aColumn.size(); i++) {
CorbaSeq[i] = aColumn[i];
}
void SALOMEDS_AttributeTableOfReal_i::PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectIndex);
}
CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATR_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
CORBA::Double aValue;
aValue = aTable->GetValue(theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
return aValue;
}
+void SALOMEDS_AttributeTableOfReal_i::RemoveValue(CORBA::Long theRow, CORBA::Long theColumn)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->RemoveValue(theRow, theColumn);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::GetRowSetIndices(CORBA::Long theRow)
{
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
+ if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aSeq = aTable->GetSetRowIndices(theRow);
+ std::vector<int> aSeq = aTable->GetSetRowIndices(theRow);
int len = aSeq.size();
CorbaSeq->length(len);
for (int i = 0; i < len; i++) {
return CorbaSeq._retn();
}
-
void SALOMEDS_AttributeTableOfReal_i::SetNbColumns(CORBA::Long theNbColumns)
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- string aStream((char*)&theStream[0], theStream.length());
+ std::string aStream((char*)&theStream[0], theStream.length());
aTable->Load(aStream);
return true;
}
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- string aString = aTable->Save();
+ std::string aString = aTable->Save();
char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
int aBufferSize = strlen((char*)aBuffer);
return aStreamFile._retn();
}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortRow(CORBA::Long theRow,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortRow(theRow, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortColumn(CORBA::Long theColumn,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortColumn(theColumn, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByRow(CORBA::Long theRow,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortByRow(theRow, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByColumn(CORBA::Long theColumn,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortByColumn(theColumn, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+void SALOMEDS_AttributeTableOfReal_i::SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1,
+ CORBA::Long theRow2, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theRow1 < 1 || theRow1 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn1 < 1 || theColumn1 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theRow2 < 1 || theRow2 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn2 < 1 || theColumn2 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
+void SALOMEDS_AttributeTableOfReal_i::SwapRows(CORBA::Long theRow1, CORBA::Long theRow2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theRow1 < 1 || theRow1 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theRow2 < 1 || theRow2 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapRows(theRow1, theRow2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
+void SALOMEDS_AttributeTableOfReal_i::SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATR_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
+ if (theColumn1 < 1 || theColumn1 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn2 < 1 || theColumn2 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapColumns(theColumn1, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfReal_i.hxx
// Author : Michael Ponikarov
// Module : SALOME
#include "SALOMEDS_GenericAttribute_i.hxx"
#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-class SALOMEDS_AttributeTableOfReal_i: public virtual POA_SALOMEDS::AttributeTableOfReal,
- public virtual SALOMEDS_GenericAttribute_i {
-
+class SALOMEDS_AttributeTableOfReal_i : public virtual POA_SALOMEDS::AttributeTableOfReal,
+ public virtual SALOMEDS_GenericAttribute_i
+{
public:
-
SALOMEDS_AttributeTableOfReal_i(SALOMEDSImpl_AttributeTableOfReal* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
+ : SALOMEDS_GenericAttribute_i(theAttr, orb) {};
+
~SALOMEDS_AttributeTableOfReal_i() {};
-
- virtual void SetTitle(const char* theTitle);
+
+ virtual void SetTitle(const char* theTitle);
virtual char* GetTitle();
virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetRowTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetRowTitles();
virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetColumnTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetColumnTitles();
virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetRowUnit(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetRowUnits();
virtual CORBA::Long GetNbRows();
virtual CORBA::Long GetNbColumns();
virtual void AddRow(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual void SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::DoubleSeq* GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void AddColumn(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::DoubleSeq* GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn);
virtual CORBA::Double GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow);
virtual void SetNbColumns(CORBA::Long theNbColumns);
+ virtual SALOMEDS::LongSeq* SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+
+ virtual void SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1,
+ CORBA::Long theRow2, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+
virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream);
virtual SALOMEDS::TMPFile* SaveToFile();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfString.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <string>
-using namespace std;
-
SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString
(SALOMEDSImpl_AttributeTableOfString* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
}
+std::string SALOMEDS_AttributeTableOfString::GetRowTitle(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetRowTitle(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowTitle(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vector<std::string>& theTitles)
{
int aLength = theTitles.size(), i;
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
}
+std::string SALOMEDS_AttributeTableOfString::GetColumnTitle(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetColumnTitle(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumnTitle(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vector<std::string>& theTitles)
{
int aLength = theTitles.size(), i;
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
}
+std::string SALOMEDS_AttributeTableOfString::GetRowUnit(int theIndex)
+{
+ std::string aTitle;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetRowUnit(theIndex);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ aTitle = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowUnit(theIndex);
+ }
+ return aTitle;
+}
+
void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector<std::string>& theUnits)
{
int aLength = theUnits.size(), i;
aTable->SetRowData(aTable->GetNbRows() + 1, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetRowData(theRow, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
aTable->SetColumnData(theColumn, theData);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
}
}
else {
dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->PutValue(theValue, theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
else {
aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetValue(theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
}
else {
return aValue;
}
+void SALOMEDS_AttributeTableOfString::RemoveValue(int theRow, int theColumn)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->RemoveValue(theRow, theColumn);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->RemoveValue(theRow, theColumn);
+ }
+}
+
std::vector<int> SALOMEDS_AttributeTableOfString::GetRowSetIndices(int theRow)
{
std::vector<int> aVector;
}
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
}
+
+std::vector<int> SALOMEDS_AttributeTableOfString::SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SortRow(theRow,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SortRow(theRow,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfString::SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SortColumn(theColumn,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SortColumn(theColumn,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfString::SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SortByRow(theRow,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SortByRow(theRow,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+std::vector<int> SALOMEDS_AttributeTableOfString::SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
+{
+ std::vector<int> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SortByColumn(theColumn,
+ (SALOMEDSImpl_AttributeTable::SortOrder)theOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SortByColumn(theColumn,
+ (SALOMEDS::AttributeTable::SortOrder)theOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
+ aLength = aSet->length();
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ }
+ return aVector;
+}
+
+void SALOMEDS_AttributeTableOfString::SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+}
+
+void SALOMEDS_AttributeTableOfString::SwapRows(int theRow1, int theRow2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SwapRows(theRow1, theRow2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SwapRows(theRow1, theRow2);
+ }
+}
+
+void SALOMEDS_AttributeTableOfString::SwapColumns(int theColumn1, int theColumn2)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ try {
+ dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SwapColumns(theColumn1, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ }
+ else {
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SwapColumns(theColumn1, theColumn2);
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfString.hxx
// Author : Sergey RUIN
// Module : SALOME
virtual void SetTitle(const std::string& theTitle);
virtual std::string GetTitle();
virtual void SetRowTitle(int theIndex, const std::string& theTitle);
+ virtual std::string GetRowTitle(int theIndex);
virtual void SetRowTitles(const std::vector<std::string>& theTitles);
virtual std::vector<std::string> GetRowTitles();
virtual void SetColumnTitle(int theIndex, const std::string& theTitle);
+ virtual std::string GetColumnTitle(int theIndex);
virtual void SetColumnTitles(const std::vector<std::string>& theTitles);
virtual std::vector<std::string> GetColumnTitles();
virtual void SetRowUnit(int theIndex, const std::string& theUnit);
+ virtual std::string GetRowUnit(int theIndex);
virtual void SetRowUnits(const std::vector<std::string>& theUnits);
virtual std::vector<std::string> GetRowUnits();
virtual void PutValue(const std::string& theValue, int theRow, int theColumn);
virtual bool HasValue(int theRow, int theColumn);
virtual std::string GetValue(int theRow, int theColumn);
+ virtual void RemoveValue(int theRow, int theColumn);
virtual std::vector<int> GetRowSetIndices(int theRow);
virtual void SetNbColumns(int theNbColumns);
+ virtual std::vector<int> SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy);
+ virtual std::vector<int> SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy);
+ virtual void SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2);
+ virtual void SwapRows(int theRow1, int theRow2);
+ virtual void SwapColumns(int theColumn1, int theColumn2);
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfString_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "Utils_ExceptHandlers.hxx"
-using namespace std;
-
-UNEXPECT_CATCH(ATS_IncorrectIndex, SALOMEDS::AttributeTableOfString::IncorrectIndex);
-UNEXPECT_CATCH(ATS_IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
+UNEXPECT_CATCH(ATS_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex);
+UNEXPECT_CATCH(ATS_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength);
void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle)
{
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetTitle(string(aStr));
+ aTable->SetTitle(std::string(aStr));
}
char* SALOMEDS_AttributeTableOfString_i::GetTitle()
}
void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
- aTable->SetRowTitle(theIndex, string(theTitle));
+ aTable->SetRowTitle(theIndex, std::string(theTitle));
+}
+
+char* SALOMEDS_AttributeTableOfString_i::GetRowTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetRowTitle(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetRowTitle(i + 1, string((char*)theTitles[i].in()));
+ aTable->SetRowTitle(i + 1, std::string((char*)theTitles[i].in()));
}
}
}
void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- aTable->SetColumnTitle(theIndex, string((char*)theTitle));
+ if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ aTable->SetColumnTitle(theIndex, std::string((char*)theTitle));
+}
+
+char* SALOMEDS_AttributeTableOfString_i::GetColumnTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetColumnTitle(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetColumnTitle(i + 1, string((char*)theTitles[i].in()));
+ aTable->SetColumnTitle(i + 1, std::string((char*)theTitles[i].in()));
}
}
//Units support
void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- aTable->SetRowUnit(theIndex, string((char*)theUnit));
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ aTable->SetRowUnit(theIndex, std::string((char*)theUnit));
+}
+
+char* SALOMEDS_AttributeTableOfString_i::GetRowUnit(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch (ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ CORBA::String_var c_s = CORBA::string_dup(aTable->GetRowUnit(theIndex).c_str());
+ return c_s._retn();
}
void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
+ if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
for (int i = 0; i < theUnits.length(); i++) {
- aTable->SetRowUnit(i + 1, string((char*)theUnits[i].in()));
+ aTable->SetRowUnit(i + 1, std::string((char*)theUnits[i].in()));
}
}
}
void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- vector<string> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(string(CORBA::string_dup(theData[i])));
+ std::vector<std::string> aRow;
+ for (int i = 0; i < theData.length(); i++) aRow.push_back(std::string(CORBA::string_dup(theData[i])));
aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
}
void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- vector<string> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(string(CORBA::string_dup(theData[i].in())));
+ std::vector<std::string> aRow;
+ for (int i = 0; i < theData.length(); i++) aRow.push_back(std::string(CORBA::string_dup(theData[i].in())));
aTable->SetRowData(theRow, aRow);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> aRow = aTable->GetRowData(theRow);
+ std::vector<std::string> aRow = aTable->GetRowData(theRow);
CorbaSeq->length(aRow.size());
for (int i = 0; i < aRow.size(); i++) {
CorbaSeq[i] = CORBA::string_dup(aRow[i].c_str());
}
void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- vector<string> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(string(CORBA::string_dup(theData[i])));
+ std::vector<std::string> aColumn;
+ for (int i = 0; i < theData.length(); i++) aColumn.push_back(std::string(CORBA::string_dup(theData[i])));
aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
}
void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- vector<string> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(string(CORBA::string_dup(theData[i])));
+ std::vector<std::string> aColumn;
+ for (int i = 0; i < theData.length(); i++) aColumn.push_back(std::string(CORBA::string_dup(theData[i])));
aTable->SetColumnData(theColumn, aColumn);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> aColumn = aTable->GetColumnData(theColumn);
+ std::vector<std::string> aColumn = aTable->GetColumnData(theColumn);
CorbaSeq->length(aColumn.size());
for (int i = 0; i < aColumn.size(); i++) {
CorbaSeq[i] = CORBA::string_dup(aColumn[i].c_str());
}
void SALOMEDS_AttributeTableOfString_i::PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
}
char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
{
SALOMEDS::Locker lock;
Unexpect aCatch(ATS_IncorrectIndex);
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
- string aValue;
+ std::string aValue;
try {
aValue = aTable->GetValue(theRow, theColumn);
}
catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
}
return CORBA::string_dup(aValue.c_str());
}
+void SALOMEDS_AttributeTableOfString_i::RemoveValue(CORBA::Long theRow, CORBA::Long theColumn)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->RemoveValue(theRow, theColumn);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::GetRowSetIndices(CORBA::Long theRow)
{
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
+ if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aSeq = aTable->GetSetRowIndices(theRow);
+ std::vector<int> aSeq = aTable->GetSetRowIndices(theRow);
CorbaSeq->length(aSeq.size());
for (int i = 0; i < aSeq.size(); i++) {
CorbaSeq[i] = aSeq[i];
return CorbaSeq._retn();
}
-
void SALOMEDS_AttributeTableOfString_i::SetNbColumns(CORBA::Long theNbColumns)
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- string aStream((char*)&theStream[0], theStream.length());
+ std::string aStream((char*)&theStream[0], theStream.length());
aTable->Load(aStream);
return true;
}
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- string aString = aTable->Save();
+ std::string aString = aTable->Save();
char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
int aBufferSize = strlen((char*)aBuffer);
return aStreamFile._retn();
}
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortRow(CORBA::Long theRow,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortRow(theRow, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortColumn(CORBA::Long theColumn,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortColumn(theColumn, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByRow(CORBA::Long theRow,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theRow < 1 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortByRow(theRow, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByColumn(CORBA::Long theColumn,
+ SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theColumn < 1 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ std::vector<int> aSeq;
+ SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
+ try {
+ aSeq = aTable->SortByColumn(theColumn, (SALOMEDSImpl_AttributeTable::SortOrder)sortOrder,
+ (SALOMEDSImpl_AttributeTable::SortPolicy)sortPolicy);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+ CorbaSeq->length(aSeq.size());
+ for (int i = 0; i < aSeq.size(); i++) {
+ CorbaSeq[i] = aSeq[i];
+ }
+ return CorbaSeq._retn();
+}
+
+void SALOMEDS_AttributeTableOfString_i::SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1,
+ CORBA::Long theRow2, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theRow1 < 1 || theRow1 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn1 < 1 || theColumn1 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theRow2 < 1 || theRow2 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn2 < 1 || theColumn2 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
+void SALOMEDS_AttributeTableOfString_i::SwapRows(CORBA::Long theRow1, CORBA::Long theRow2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theRow1 < 1 || theRow1 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theRow2 < 1 || theRow2 > aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapRows(theRow1, theRow2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
+
+void SALOMEDS_AttributeTableOfString_i::SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex)
+{
+ SALOMEDS::Locker lock;
+ Unexpect aCatch(ATS_IncorrectIndex);
+ CheckLocked();
+ SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
+ if (theColumn1 < 1 || theColumn1 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+ if (theColumn2 < 1 || theColumn2 > aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectIndex();
+
+ try {
+ aTable->SwapColumns(theColumn1, theColumn2);
+ }
+ catch(...) {
+ throw SALOMEDS::AttributeTable::IncorrectIndex();
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTableOfString_i.hxx
// Author : Sergey RUIN
// Module : SALOME
virtual void SetTitle(const char* theTitle);
virtual char* GetTitle();
virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetRowTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetRowTitles();
virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetColumnTitle(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetColumnTitles();
virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual char* GetRowUnit(CORBA::Long theIndex)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual SALOMEDS::StringSeq* GetRowUnits();
virtual CORBA::Long GetNbRows();
virtual CORBA::Long GetNbColumns();
virtual void AddRow(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual void SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::StringSeq* GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void AddColumn(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength);
virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::StringSeq* GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual void PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn);
virtual char* GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow);
virtual void SetNbColumns(CORBA::Long theNbColumns);
+ virtual SALOMEDS::LongSeq* SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual SALOMEDS::LongSeq* SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder,
+ SALOMEDS::AttributeTable::SortPolicy sortPolicy)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+
+ virtual void SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1,
+ CORBA::Long theRow2, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+ virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2)
+ throw (SALOMEDS::AttributeTable::IncorrectIndex);
+
virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream);
virtual SALOMEDS::TMPFile* SaveToFile();
-
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTarget.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDS_SObject.hxx"
-using namespace std;
-
SALOMEDS_AttributeTarget::SALOMEDS_AttributeTarget(SALOMEDSImpl_AttributeTarget* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Get();
+ std::vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Get();
aLength = aSeq.size();
for (i = 0; i < aLength; i++) {
aSO = new SALOMEDS_SObject(aSeq[i]);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTarget.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTarget_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
-using namespace std;
-
void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject)
{
SALOMEDS::Locker lock;
SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get()
{
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Get();
+ std::vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Get();
SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject;
int aLength = aSeq.size(), i;
if (aLength == 0) return aSList._retn();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTarget_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextColor.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
-using namespace std;
-
SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor(SALOMEDSImpl_AttributeTextColor* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
STextColor aColor;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->TextColor();
+ std::vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->TextColor();
aColor.R = aSeq[0];
aColor.G = aSeq[1];
aColor.B = aSeq[2];
if (_isLocal) {
CheckLocked();
SALOMEDS::Locker lock;
- vector<double> aSeq;
+ std::vector<double> aSeq;
aSeq.push_back( value.R );
aSeq.push_back( value.G );
aSeq.push_back( value.B );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextColor.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextColor_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS.hxx"
#include <vector>
-using namespace std;
-
SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor()
{
SALOMEDS::Locker lock;
SALOMEDS::Color TextColor;
- vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_impl)->TextColor();
+ std::vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_impl)->TextColor();
if (anArray.size()!=3) {
TextColor.R = 0;
TextColor.G = 0;
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> anArray;
+ std::vector<double> anArray;
anArray.push_back(value.R);
anArray.push_back(value.G);
anArray.push_back(value.B);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextColor_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextHighlightColor.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
-using namespace std;
-
SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor
(SALOMEDSImpl_AttributeTextHighlightColor* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
STextColor aColor;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->TextHighlightColor();
+ std::vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->TextHighlightColor();
aColor.R = aSeq[0];
aColor.G = aSeq[1];
aColor.B = aSeq[2];
if (_isLocal) {
CheckLocked();
SALOMEDS::Locker lock;
- vector<double> aSeq;
+ std::vector<double> aSeq;
aSeq.push_back(value.R);
aSeq.push_back(value.G);
aSeq.push_back(value.B);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextHighlightColor.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextHighlightColor_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS.hxx"
#include <vector>
-using namespace std;
-
SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor()
{
SALOMEDS::Locker lock;
SALOMEDS::Color TextHighlightColor;
- vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_impl)->TextHighlightColor();
+ std::vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_impl)->TextHighlightColor();
if (anArray.size()!=3) {
TextHighlightColor.R = 0;
TextHighlightColor.G = 0;
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> anArray;
+ std::vector<double> anArray;
anArray.push_back(value.R);
anArray.push_back(value.G);
anArray.push_back(value.B);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTextHighlightColor_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTreeNode.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeTreeNode.hxx"
#include "SALOMEDS_AttributeTreeNode.hxx"
-using namespace std;
-
SALOMEDS_AttributeTreeNode::SALOMEDS_AttributeTreeNode(SALOMEDSImpl_AttributeTreeNode* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
std::string SALOMEDS_AttributeTreeNode::GetTreeID()
{
- string aGUID;
+ std::string aGUID;
if (_isLocal) {
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
std::string SALOMEDS_AttributeTreeNode::Label()
{
- string aLabel;
+ std::string aLabel;
if (_isLocal) {
SALOMEDS::Locker lock;
aLabel = _local_impl->Label().Entry();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTreeNode.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTreeNode_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "utilities.h"
#include "SALOMEDS.hxx"
-using namespace std;
-
static SALOMEDSImpl_AttributeTreeNode* GetNode(SALOMEDS::AttributeTreeNode_ptr value,
SALOMEDSImpl_AttributeTreeNode* aNode)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeTreeNode_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeUserID.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeUserID.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeName_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_AttributeUserID_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeUserID_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_impl)->SetValue(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_impl)->SetValue(std::string(Str));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_AttributeUserID_i.hxx
// Author : Sergey RUIN
// Module : SALOME
char* Value();
void SetValue(const char* value);
- static const std::string& DefaultID() {
+ static std::string DefaultID() {
return SALOMEDSImpl_AttributeUserID::DefaultID();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Attributes.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttributeFactory.cxx
// Author : Estelle Deville, CEA
//
#include "SALOMEDS_BasicAttributeFactory.hxx"
#include "utilities.h"
-using namespace std;
+
//============================================================================
/*! Function : Create
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttributeFactory.hxx
// Author : Estelle Deville, CEA
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttribute_i.cxx
// Author : Estelle Deville, CEA
// $Header$
//
#include "SALOMEDS_BasicAttribute_i.hxx"
-using namespace std;
//============================================================================
/*! Function : SetLabel
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttribute_i.hxx
// Author : Estelle Deville, CEA
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_Study_i.hxx
// Author : Yves FRICAUD
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_ChildIterator.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS_SObject.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const SALOMEDSImpl_ChildIterator& theIterator)
{
SALOMEDS::Locker lock;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_ChildIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_ChildIterator_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_Study.hxx"
#include "utilities.h"
-using namespace std;
-
//============================================================================
/*! Function : constructor
* Purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_ChildIterator_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_Client.cxx
// Author : Yves FRICAUD
#include "utilities.h"
#include "HDFOI.hxx"
-using namespace std;
-
//============================================================================
/*! Function :
* Purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Attributes.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Defines.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEDS_Driver_i.hxx"
#include "SALOMEDS_TMPFile_i.hxx"
#include "utilities.h"
#include "SALOMEDS.hxx"
#include <stdlib.h>
-using namespace std;
-
SALOMEDS_Driver_i::~SALOMEDS_Driver_i()
{
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
+ const std::string& theURL,
long& theStreamLength,
bool isMultiFile)
{
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
+ const std::string& theURL,
long& theStreamLength,
bool isMultiFile)
{
bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent,
const unsigned char* theStream,
const long theStreamLength,
- const string& theURL,
+ const std::string& theURL,
bool isMultiFile)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
bool SALOMEDS_Driver_i::LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
const unsigned char* theStream,
const long theStreamLength,
- const string& theURL,
+ const std::string& theURL,
bool isMultiFile)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
-string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
- const string& IORString,
+std::string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
+ const std::string& IORString,
bool isMultiFile,
bool isASCII)
{
CORBA::String_var pers_string =_driver->IORToLocalPersistentID(so.in(), ior.in(), isMultiFile, isASCII);
SALOMEDS::lock();
- return string(pers_string);
+ return std::string(pers_string);
}
-string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject,
- const string& aLocalPersistentID,
+std::string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject,
+ const std::string& aLocalPersistentID,
bool isMultiFile,
bool isASCII)
{
SALOMEDS::unlock();
CORBA::String_var IOR = _driver->LocalPersistentIDToIOR(so.in(), pers_string.in(), isMultiFile, isASCII);
SALOMEDS::lock();
- return string(IOR);
+ return std::string(IOR);
}
bool SALOMEDS_Driver_i::CanCopy(const SALOMEDSImpl_SObject& theObject)
return aTMPFile;
}
-bool SALOMEDS_Driver_i::CanPaste(const string& theComponentName, int theObjectID)
+bool SALOMEDS_Driver_i::CanPaste(const std::string& theComponentName, int theObjectID)
{
SALOMEDS::unlock();
bool canPaste = _driver->CanPaste(theComponentName.c_str(), theObjectID);
return canPaste;
}
-string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream,
+std::string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream,
const long theStreamLength,
int theObjectID,
const SALOMEDSImpl_SObject& theObject)
SALOMEDS::SObject_var ret_so = _driver->PasteInto(aStream.in(), theObjectID, so.in());
SALOMEDS::lock();
- return string(ret_so->GetID());
+ return std::string(ret_so->GetID());
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy,
// SALOMEDS_DriverFactory
//###############################################################################################################
-SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const string& theComponentType)
+SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const std::string& theComponentType)
{
CORBA::Object_var obj;
- string aFactoryType;
+ std::string aFactoryType;
if (theComponentType == "SUPERV") aFactoryType = "SuperVisionContainer";
else aFactoryType = "FactoryServer";
return NULL;
}
-SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByIOR(const string& theIOR)
+SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByIOR(const std::string& theIOR)
{
CORBA::Object_var obj;
obj = _orb->string_to_object(theIOR.c_str());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOMEDS_DRIVER_I_H__
#define __SALOMEDS_DRIVER_I_H__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_GenericAttribute.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDSImpl_GenericAttribute* theGA)
{
_isLocal = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_GenericAttribute.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_GenericAttribute_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection);
SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb)
{
SALOMEDS::Locker lock;
if (_impl) {
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl);
+ std::string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl);
return CORBA::string_dup(type.c_str());
}
{
SALOMEDS::Locker lock;
if (_impl) {
- string class_type = SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl);
+ std::string class_type = SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl);
return CORBA::string_dup(class_type.c_str());
}
{
SALOMEDS::Locker lock;
- string aClassType = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr)->GetClassType();
+ std::string aClassType = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr)->GetClassType();
char* aTypeOfAttribute = (char*)aClassType.c_str();
SALOMEDS::GenericAttribute_var anAttribute;
SALOMEDS_GenericAttribute_i* attr_servant = NULL;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_GenericAttribute_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEDS_IParameters.hxx"
#include <utilities.h>
-using namespace std;
-
#define PT_INTEGER 0
#define PT_REAL 1
#define PT_BOOLEAN 2
_compNames.clear();
}
-int SALOMEDS_IParameters::append(const string& listName, const string& value)
+int SALOMEDS_IParameters::append(const std::string& listName, const std::string& value)
{
if(!_ap) return -1;
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap->IsSet(listName, PT_STRARRAY)) {
if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) _ap->SetStrArray(_AP_LISTS_LIST_, v);
if(listName != _AP_ENTRIES_LIST_ &&
return (v.size()-1);
}
-int SALOMEDS_IParameters::nbValues(const string& listName)
+int SALOMEDS_IParameters::nbValues(const std::string& listName)
{
if(!_ap) return -1;
if(!_ap->IsSet(listName, PT_STRARRAY)) return 0;
- vector<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
return v.size();
}
-vector<string> SALOMEDS_IParameters::getValues(const string& listName)
+std::vector<std::string> SALOMEDS_IParameters::getValues(const std::string& listName)
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(listName, PT_STRARRAY)) return v;
return _ap->GetStrArray(listName);
}
-string SALOMEDS_IParameters::getValue(const string& listName, int index)
+std::string SALOMEDS_IParameters::getValue(const std::string& listName, int index)
{
if(!_ap) return "";
if(!_ap->IsSet(listName, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
if(index >= v.size()) return "";
return v[index];
}
-vector<string> SALOMEDS_IParameters::getLists()
+std::vector<std::string> SALOMEDS_IParameters::getLists()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_LISTS_LIST_);
}
-void SALOMEDS_IParameters::setParameter(const string& entry, const string& parameterName, const string& value)
+void SALOMEDS_IParameters::setParameter(const std::string& entry, const std::string& parameterName, const std::string& value)
{
if(!_ap) return;
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap->IsSet(entry, PT_STRARRAY)) {
append(_AP_ENTRIES_LIST_, entry); //Add the entry to the internal list of entries
_ap->SetStrArray(entry, v);
}
-string SALOMEDS_IParameters::getParameter(const string& entry, const string& parameterName)
+std::string SALOMEDS_IParameters::getParameter(const std::string& entry, const std::string& parameterName)
{
if(!_ap) return "";
if(!_ap->IsSet(entry, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(entry);
+ std::vector<std::string> v = _ap->GetStrArray(entry);
int length = v.size();
for(int i = 0; i<length; i+=1) {
if(v[i] == parameterName) return v[i+1];
}
-vector<string> SALOMEDS_IParameters::getAllParameterNames(const string& entry)
+std::vector<std::string> SALOMEDS_IParameters::getAllParameterNames(const std::string& entry)
{
- vector<string> v, names;
+ std::vector<std::string> v, names;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
return names;
}
-vector<string> SALOMEDS_IParameters::getAllParameterValues(const string& entry)
+std::vector<std::string> SALOMEDS_IParameters::getAllParameterValues(const std::string& entry)
{
- vector<string> v, values;
+ std::vector<std::string> v, values;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
return values;
}
-int SALOMEDS_IParameters::getNbParameters(const string& entry)
+int SALOMEDS_IParameters::getNbParameters(const std::string& entry)
{
if(!_ap) return -1;
if(!_ap->IsSet(entry, PT_STRARRAY)) return -1;
return _ap->GetStrArray(entry).size()/2;
}
-vector<string> SALOMEDS_IParameters::getEntries()
+std::vector<std::string> SALOMEDS_IParameters::getEntries()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(_AP_ENTRIES_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_ENTRIES_LIST_);
}
-void SALOMEDS_IParameters::setProperty(const string& name, const std::string& value)
+void SALOMEDS_IParameters::setProperty(const std::string& name, const std::string& value)
{
if(!_ap) return;
if(!_ap->IsSet(name, PT_STRING)) {
_ap->SetString(name, value);
}
-string SALOMEDS_IParameters::getProperty(const string& name)
+std::string SALOMEDS_IParameters::getProperty(const std::string& name)
{
if(!_ap) return "";
if(!_ap->IsSet(name, PT_STRING)) return "";
return _ap->GetString(name);
}
-vector<string> SALOMEDS_IParameters::getProperties()
+std::vector<std::string> SALOMEDS_IParameters::getProperties()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_PROPERTIES_LIST_);
}
-vector<string> SALOMEDS_IParameters::parseValue(const string& value, const char separator, bool fromEnd)
+std::vector<std::string> SALOMEDS_IParameters::parseValue(const std::string& value, const char separator, bool fromEnd)
{
- string val(value);
- vector<string> v;
+ std::string val(value);
+ std::vector<std::string> v;
int pos;
if(fromEnd) pos = val.rfind(separator);
else pos = val.find(separator);
return v;
}
- string part1, part2;
+ std::string part1, part2;
part1 = val.substr(0, pos);
part2 = val.substr(pos+1, val.size());
v.push_back(part1);
return v;
}
-string SALOMEDS_IParameters::encodeEntry(const string& entry, const string& compName)
+std::string SALOMEDS_IParameters::encodeEntry(const std::string& entry, const std::string& compName)
{
- string tail(entry, 6, entry.length()-1);
- string newEntry(compName);
+ std::string tail(entry, 6, entry.length()-1);
+ std::string newEntry(compName);
newEntry+=("_"+tail);
return newEntry;
}
-string SALOMEDS_IParameters::decodeEntry(const string& entry)
+std::string SALOMEDS_IParameters::decodeEntry(const std::string& entry)
{
if(!_study) return entry;
int pos = entry.rfind("_");
if(pos < 0 || pos >= entry.length()) return entry;
- string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
+ std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
if(_compNames.find(compName) == _compNames.end()) {
_PTR(SObject) so = _study->FindComponent(compName);
}
else compID = _compNames[compName];
- string newEntry(compID);
+ std::string newEntry(compID);
newEntry += (":"+tail);
return newEntry;
}
-void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const string& theID)
+void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const std::string& theID)
{
- string anID;
+ std::string anID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
ap->SetBool(_AP_DUMP_PYTHON_, !isDumpPython(study, theID));
}
-bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const string& theID)
+bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const std::string& theID)
{
- string anID;
+ std::string anID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
return (bool)ap->GetBool(_AP_DUMP_PYTHON_);
}
-string SALOMEDS_IParameters::getDefaultVisualComponent()
+std::string SALOMEDS_IParameters::getDefaultVisualComponent()
{
return "Interface Applicative";
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEDS_IParameters_H
#define SALOMEDS_IParameters_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponent.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <string>
-using namespace std;
-
SALOMEDS_SComponent::SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent)
:SALOMEDS_SObject(theSComponent)
{}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponent.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponentIterator.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponentIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponentIterator_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
-using namespace std;
-
//============================================================================
/*! Function : constructor
*
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponentIterator_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponent_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "utilities.h"
#include <map>
-using namespace std;
-
SALOMEDS::SComponent_ptr SALOMEDS_SComponent_i::New(const SALOMEDSImpl_SComponent& theImpl, CORBA::ORB_ptr theORB)
{
SALOMEDS_SComponent_i* sco_servant = new SALOMEDS_SComponent_i(theImpl, theORB);
char* SALOMEDS_SComponent_i::ComponentDataType()
{
SALOMEDS::Locker lock;
- string aType = dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentDataType();
+ std::string aType = dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentDataType();
return CORBA::string_dup(aType.c_str());
}
CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR)
{
SALOMEDS::Locker lock;
- string ior;
+ std::string ior;
if(!dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentIOR(ior)) {
IOR = CORBA::string_dup("");
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SComponent_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SObject.hxx
// Author : Sergey RUIN
// Module : SALOME
#endif
-
-using namespace std;
-
SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject)
{
#ifdef WIN32
else _corba_impl->Name(theName.c_str());
}
-vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes()
+std::vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes()
{
- vector<_PTR(GenericAttribute)> aVector;
+ std::vector<_PTR(GenericAttribute)> aVector;
int aLength = 0;
SALOMEDSClient_GenericAttribute* anAttr;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<DF_Attribute*> aSeq = _local_impl->GetAllAttributes();
+ std::vector<DF_Attribute*> aSeq = _local_impl->GetAllAttributes();
aLength = aSeq.size();
for (int i = 0; i < aLength; i++) {
anAttr = SALOMEDS_GenericAttribute::CreateAttribute(dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i]));
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SObject.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SObject_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS::SObject_ptr SALOMEDS_SObject_i::New(const SALOMEDSImpl_SObject& theImpl, CORBA::ORB_ptr theORB)
{
SALOMEDS_SObject_i* so_servant = new SALOMEDS_SObject_i(theImpl, theORB);
return SALOMEDS::Study::_nil();
}
- string IOR = aStudy->GetTransientReference();
+ std::string IOR = aStudy->GetTransientReference();
CORBA::Object_var obj = _orb->string_to_object(IOR.c_str());
SALOMEDS::Study_var Study = SALOMEDS::Study::_narrow(obj) ;
ASSERT(!CORBA::is_nil(Study));
SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes()
{
SALOMEDS::Locker lock;
- vector<DF_Attribute*> aSeq = _impl->GetAllAttributes();
+ std::vector<DF_Attribute*> aSeq = _impl->GetAllAttributes();
SALOMEDS::ListOfAttributes_var SeqOfAttr = new SALOMEDS::ListOfAttributes;
int length = aSeq.size();
void SALOMEDS_SObject_i::Name(const char* name)
{
SALOMEDS::Locker lock;
- string aName((char*)name);
+ std::string aName((char*)name);
_impl->Name(aName);
}
SALOMEDS::Locker lock;
CORBA::Object_ptr obj = CORBA::Object::_nil();
try {
- string IOR = _impl->GetIOR();
+ std::string IOR = _impl->GetIOR();
char* c_ior = CORBA::string_dup(IOR.c_str());
obj = _orb->string_to_object(c_ior);
CORBA::string_free(c_ior);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_SObject_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_Server.cxx
// Author : Yves FRICAUD
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
-using namespace std;
// extern "C"
// { // for ccmalloc memory debug
timer.ShowAbsolute();
#endif
orb->run();
+ MESSAGE( "end of SALOME_DS server" );
orb->destroy();
}
catch(CORBA::SystemException&)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Study.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS_Study::SALOMEDS_Study(SALOMEDSImpl_Study* theStudy)
{
_isLocal = true;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName);
+ std::vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName);
aLength = aSeq.size();
for (i = 0; i< aLength; i++)
aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl()));
+ std::vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl()));
if (aSeq.size()) {
aLength = aSeq.size();
for (i = 0; i < aLength; i++)
else _corba_impl->EnableUseCaseAutoFilling(isEnabled);
}
-bool SALOMEDS_Study::DumpStudy(const string& thePath, const string& theBaseName, bool isPublished)
+bool SALOMEDS_Study::DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished)
{
//SRN: Pure CORBA DumpStudy as it does more cleaning than the local one
if(CORBA::is_nil(_corba_impl)) GetStudy(); //If CORBA implementation is null then retrieve it
return ret;
}
-void SALOMEDS_Study::SetStudyLock(const string& theLockerID)
+void SALOMEDS_Study::SetStudyLock(const std::string& theLockerID)
{
if (_isLocal) {
SALOMEDS::Locker lock;
return isLocked;
}
-void SALOMEDS_Study::UnLockStudy(const string& theLockerID)
+void SALOMEDS_Study::UnLockStudy(const std::string& theLockerID)
{
if(_isLocal) _local_impl->UnLockStudy(theLockerID.c_str());
else _corba_impl->UnLockStudy((char*)theLockerID.c_str());
}
-vector<string> SALOMEDS_Study::GetLockerID()
+std::vector<std::string> SALOMEDS_Study::GetLockerID()
{
std::vector<std::string> aVector;
int aLength, i;
}
-void SALOMEDS_Study::SetReal(const string& theVarName, const double theValue)
+void SALOMEDS_Study::SetReal(const std::string& theVarName, const double theValue)
{
if (_isLocal) {
SALOMEDS::Locker lock;
_corba_impl->SetReal((char*)theVarName.c_str(),theValue);
}
-void SALOMEDS_Study::SetInteger(const string& theVarName, const int theValue)
+void SALOMEDS_Study::SetInteger(const std::string& theVarName, const int theValue)
{
if (_isLocal) {
SALOMEDS::Locker lock;
_corba_impl->SetInteger((char*)theVarName.c_str(),theValue);
}
-void SALOMEDS_Study::SetBoolean(const string& theVarName, const bool theValue)
+void SALOMEDS_Study::SetBoolean(const std::string& theVarName, const bool theValue)
{
if (_isLocal) {
SALOMEDS::Locker lock;
_corba_impl->SetBoolean((char*)theVarName.c_str(),theValue);
}
-void SALOMEDS_Study::SetString(const string& theVarName, const string& theValue)
+void SALOMEDS_Study::SetString(const std::string& theVarName, const std::string& theValue)
{
if (_isLocal) {
SALOMEDS::Locker lock;
_corba_impl->SetString((char*)theVarName.c_str(),(char*)theValue.c_str());
}
-void SALOMEDS_Study::SetStringAsDouble(const string& theVarName, const double theValue)
+void SALOMEDS_Study::SetStringAsDouble(const std::string& theVarName, const double theValue)
{
if (_isLocal) {
SALOMEDS::Locker lock;
_corba_impl->SetStringAsDouble((char*)theVarName.c_str(),theValue);
}
-double SALOMEDS_Study::GetReal(const string& theVarName)
+double SALOMEDS_Study::GetReal(const std::string& theVarName)
{
double aResult;
if (_isLocal) {
return aResult;
}
-int SALOMEDS_Study::GetInteger(const string& theVarName)
+int SALOMEDS_Study::GetInteger(const std::string& theVarName)
{
int aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::GetBoolean(const string& theVarName)
+bool SALOMEDS_Study::GetBoolean(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-std::string SALOMEDS_Study::GetString(const string& theVarName)
+std::string SALOMEDS_Study::GetString(const std::string& theVarName)
{
std::string aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsReal(const string& theVarName)
+bool SALOMEDS_Study::IsReal(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsInteger(const string& theVarName)
+bool SALOMEDS_Study::IsInteger(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsBoolean(const string& theVarName)
+bool SALOMEDS_Study::IsBoolean(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsString(const string& theVarName)
+bool SALOMEDS_Study::IsString(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsVariable(const string& theVarName)
+bool SALOMEDS_Study::IsVariable(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-vector<string> SALOMEDS_Study::GetVariableNames()
+std::vector<std::string> SALOMEDS_Study::GetVariableNames()
{
- vector<string> aVector;
+ std::vector<std::string> aVector;
if (_isLocal) {
SALOMEDS::Locker lock;
aVector = _local_impl->GetVariableNames();
SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetVariableNames();
int aLength = aSeq->length();
for (int i = 0; i < aLength; i++)
- aVector.push_back( string(aSeq[i].in()) );
+ aVector.push_back( std::string(aSeq[i].in()) );
}
return aVector;
}
-bool SALOMEDS_Study::RemoveVariable(const string& theVarName)
+bool SALOMEDS_Study::RemoveVariable(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::RenameVariable(const string& theVarName, const string& theNewVarName)
+bool SALOMEDS_Study::RenameVariable(const std::string& theVarName, const std::string& theNewVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsVariableUsed(const string& theVarName)
+bool SALOMEDS_Study::IsVariableUsed(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-vector< vector<string> > SALOMEDS_Study::ParseVariables(const string& theVars)
+std::vector< std::vector<std::string> > SALOMEDS_Study::ParseVariables(const std::string& theVars)
{
- vector< vector<string> > aResult;
+ std::vector< std::vector<std::string> > aResult;
if (_isLocal) {
SALOMEDS::Locker lock;
aResult = _local_impl->ParseVariables(theVars);
else {
SALOMEDS::ListOfListOfStrings_var aSeq = _corba_impl->ParseVariables(theVars.c_str());
for (int i = 0, n = aSeq->length(); i < n; i++) {
- vector<string> aVector;
+ std::vector<std::string> aVector;
SALOMEDS::ListOfStrings aSection = aSeq[i];
for (int j = 0, m = aSection.length(); j < m; j++) {
- aVector.push_back( string(aSection[j].in()) );
+ aVector.push_back( std::string(aSection[j].in()) );
}
aResult.push_back( aVector );
}
}
-_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint)
+_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const std::string& theID, int theSavePoint)
{
SALOMEDSClient_AttributeParameter* AP = NULL;
if(theSavePoint >= 0) {
return _PTR(AttributeParameter)(AP);
}
-_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const string& theID,
- const string& theModuleName, int theSavePoint)
+_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const std::string& theID,
+ const std::string& theModuleName, int theSavePoint)
{
SALOMEDSClient_AttributeParameter* AP = NULL;
if(theSavePoint > 0) {
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Study.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyBuilder.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
-using namespace std;
-
SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder)
{
_isLocal = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyBuilder.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyBuilder_i.cxx
// Author : Seregy RUIN
// Module : SALOME
#include <DF_Document.hxx>
#include <stdlib.h>
-using namespace std;
-
UNEXPECT_CATCH(SBSalomeException, SALOME::SALOME_Exception);
UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection);
SALOMEDS::Locker lock;
CheckLocked();
//char* aDataType = CORBA::string_dup(DataType);
- SALOMEDSImpl_SComponent aSCO = _impl->NewComponent(string(DataType));
+ SALOMEDSImpl_SComponent aSCO = _impl->NewComponent(std::string(DataType));
//CORBA::free_string(aDataType);
if(aSCO.IsNull()) return SALOMEDS::SComponent::_nil();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.inout());
DF_Attribute* anAttr;
try {
- anAttr = _impl->FindOrCreateAttribute(aSO, string(aTypeOfAttribute));
+ anAttr = _impl->FindOrCreateAttribute(aSO, std::string(aTypeOfAttribute));
}
catch (...) {
throw SALOMEDS::StudyBuilder::LockProtection();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
DF_Attribute* anAttr;
- if(!_impl->FindAttribute(aSO, anAttr, string(aTypeOfAttribute))) return false;
+ if(!_impl->FindAttribute(aSO, anAttr, std::string(aTypeOfAttribute))) return false;
anAttribute = SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb);
return true;
ASSERT(!CORBA::is_nil(anObject));
CORBA::String_var anID = anObject->GetID();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
- _impl->RemoveAttribute(aSO, string(aTypeOfAttribute));
+ _impl->RemoveAttribute(aSO, std::string(aTypeOfAttribute));
}
//============================================================================
SALOMEDS::Locker lock;
CheckLocked();
if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory();
- if(!_impl->AddDirectory(string(thePath))) {
- string anErrorCode = _impl->GetErrorCode();
+ if(!_impl->AddDirectory(std::string(thePath))) {
+ std::string anErrorCode = _impl->GetErrorCode();
if(anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed();
if(anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory();
if(anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent();
ASSERT(!CORBA::is_nil(anObject));
CORBA::String_var anID=anObject->GetID();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
- _impl->SetGUID(aSO, string(theGUID));
+ _impl->SetGUID(aSO, std::string(theGUID));
}
//============================================================================
ASSERT(!CORBA::is_nil(anObject));
CORBA::String_var anID=anObject->GetID();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
- return _impl->IsGUID(aSO, string(theGUID));
+ return _impl->IsGUID(aSO, std::string(theGUID));
}
CORBA::String_var anID=theSO->GetID();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
- _impl->SetName(aSO, string(theValue));
+ _impl->SetName(aSO, std::string(theValue));
}
//============================================================================
CORBA::String_var anID=theSO->GetID();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
- _impl->SetComment(aSO, string(theValue));
+ _impl->SetComment(aSO, std::string(theValue));
}
//============================================================================
CORBA::String_var anID=theSO->GetID();
SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in());
- _impl->SetIOR(aSO, string(theValue));
+ _impl->SetIOR(aSO, std::string(theValue));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyBuilder_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_StudyManager.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb);
SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager)
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
aLength = aSeq.size();
for(i = 0; i < aLength; i++)
aVector.push_back(aSeq[i]->Name());
SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
if(!aSCO.IsNull()) {
- string IOREngine = aSCO.GetIOR();
+ std::string IOREngine = aSCO.GetIOR();
if(!IOREngine.empty()) {
CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyManager.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyManager_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
UNEXPECT_CATCH(SalomeException,SALOME::SALOME_Exception);
UNEXPECT_CATCH(LockProtection, SALOMEDS::StudyBuilder::LockProtection);
Unexpect aCatch(SalomeException);
MESSAGE("Begin of SALOMEDS_StudyManager_i::Open");
- SALOMEDSImpl_Study* aStudyImpl = _impl->Open(string(aUrl));
+ SALOMEDSImpl_Study* aStudyImpl = _impl->Open(std::string(aUrl));
if ( !aStudyImpl )
THROW_SALOME_CORBA_EXCEPTION("Impossible to Open study from file", SALOME::BAD_PARAM)
}
SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAs(string(aUrl), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAs(std::string(aUrl), aStudyImpl, _factory, theMultiFile);
}
CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
}
SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAsASCII(string(aUrl), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAsASCII(std::string(aUrl), aStudyImpl, _factory, theMultiFile);
}
//============================================================================
{
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_Study*> anOpened = _impl->GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> anOpened = _impl->GetOpenStudies();
int aLength = anOpened.size();
SALOMEDS::ListOfOpenStudies_var _list_open_studies = new SALOMEDS::ListOfOpenStudies;
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(string(aStudyName));
+ SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(std::string(aStudyName));
if (!aStudyImpl)
{
SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
if(!aSCO.IsNull()) {
- string IOREngine = aSCO.GetIOR();
+ std::string IOREngine = aSCO.GetIOR();
if(!IOREngine.empty()) {
CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_StudyManager_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Study_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <unistd.h>
#endif
-using namespace std;
-
std::map<SALOMEDSImpl_Study* , SALOMEDS_Study_i*> SALOMEDS_Study_i::_mapOfStudies;
//============================================================================
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponent(string(aComponentName));
+ SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponent(std::string(aComponentName));
if(aCompImpl.IsNull()) return SALOMEDS::SComponent::_nil();
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aCompImpl, _orb);
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponentID(string((char*)aComponentID));
+ SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponentID(std::string((char*)aComponentID));
if(aCompImpl.IsNull()) return SALOMEDS::SComponent::_nil();
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aCompImpl, _orb);
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO = _impl->FindObject(string((char*)anObjectName));
+ SALOMEDSImpl_SObject aSO = _impl->FindObject(std::string((char*)anObjectName));
if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
if(aSO.IsComponent()) {
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO = _impl->FindObjectID(string((char*)anObjectID));
+ SALOMEDSImpl_SObject aSO = _impl->FindObjectID(std::string((char*)anObjectID));
if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
return so._retn();
{
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = _impl->FindObjectByName(string((char*)anObjectName),
- string((char*)aComponentName));
+ std::vector<SALOMEDSImpl_SObject> aSeq = _impl->FindObjectByName(std::string((char*)anObjectName),
+ std::string((char*)aComponentName));
int aLength = aSeq.size();
SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject ;
listSO->length(aLength);
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO = _impl->FindObjectIOR(string((char*)anObjectIOR));
+ SALOMEDSImpl_SObject aSO = _impl->FindObjectIOR(std::string((char*)anObjectIOR));
if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO = _impl->FindObjectByPath(string((char*)thePath));
+ SALOMEDSImpl_SObject aSO = _impl->FindObjectByPath(std::string((char*)thePath));
if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
{
SALOMEDS::Locker lock;
- string aPath("");
+ std::string aPath("");
if(CORBA::is_nil(theObject)) return CORBA::string_dup(aPath.c_str());
SALOMEDSImpl_SObject aSO;
SALOMEDS::SObject_var aSObj = SALOMEDS::SObject::_narrow(theObject);
{
SALOMEDS::Locker lock;
- _impl->SetContext(string((char*)thePath));
+ _impl->SetContext(std::string((char*)thePath));
if(_impl->IsError() && _impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
}
if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
throw SALOMEDS::Study::StudyInvalidContext();
- vector<string> aSeq = _impl->GetObjectNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetObjectNames(std::string((char*)theContext));
if (_impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
throw SALOMEDS::Study::StudyInvalidContext();
- vector<string> aSeq = _impl->GetDirectoryNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetDirectoryNames(std::string((char*)theContext));
if (_impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
throw SALOMEDS::Study::StudyInvalidContext();
- vector<string> aSeq = _impl->GetFileNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetFileNames(std::string((char*)theContext));
if (_impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- vector<string> aSeq = _impl->GetComponentNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetComponentNames(std::string((char*)theContext));
int aLength = aSeq.size();
aResult->length(aLength);
void SALOMEDS_Study_i::Name(const char* name)
{
SALOMEDS::Locker lock;
- _impl->Name(string((char*)name));
+ _impl->Name(std::string((char*)name));
}
//============================================================================
void SALOMEDS_Study_i::URL(const char* url)
{
SALOMEDS::Locker lock;
- _impl->URL(string((char*)url));
+ _impl->URL(std::string((char*)url));
}
void SALOMEDS_Study_i::UpdateIORLabelMap(const char* anIOR,const char* anEntry)
{
SALOMEDS::Locker lock;
- _impl->UpdateIORLabelMap(string((char*)anIOR), string((char*)anEntry));
+ _impl->UpdateIORLabelMap(std::string((char*)anIOR), std::string((char*)anEntry));
}
SALOMEDS::Study_ptr SALOMEDS_Study_i::GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb)
{
SALOMEDS::Locker lock;
- vector<string> aSeq = _impl->GetModificationsDate();
+ std::vector<std::string> aSeq = _impl->GetModificationsDate();
int aLength = aSeq.size();
SALOMEDS::ListOfDates_var aDates = new SALOMEDS::ListOfDates;
aDates->length(aLength);
{
SALOMEDS::Locker lock;
- vector<string> anIORs = _impl->GetIORs();
+ std::vector<std::string> anIORs = _impl->GetIORs();
int i, aSize = (int)anIORs.size();
for(i = 0; i < aSize; i++) {
{
SALOMEDS::Locker lock;
- string aPath((char*)thePath), aBaseName((char*)theBaseName);
+ std::string aPath((char*)thePath), aBaseName((char*)theBaseName);
SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb);
CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory);
delete factory;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- vector<string> aSeq = _impl->GetLockerID();
+ std::vector<std::string> aSeq = _impl->GetLockerID();
int aLength = aSeq.size();
aResult->length(aLength);
//============================================================================
void SALOMEDS_Study_i::SetReal(const char* theVarName, CORBA::Double theValue)
{
- _impl->SetVariable(string(theVarName),
+ _impl->SetVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::REAL_VAR);
}
//============================================================================
void SALOMEDS_Study_i::SetInteger(const char* theVarName, CORBA::Long theValue)
{
- _impl->SetVariable(string(theVarName),
+ _impl->SetVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::INTEGER_VAR);
}
//============================================================================
void SALOMEDS_Study_i::SetBoolean(const char* theVarName, CORBA::Boolean theValue)
{
- _impl->SetVariable(string(theVarName),
+ _impl->SetVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
}
//============================================================================
void SALOMEDS_Study_i::SetString(const char* theVarName, const char* theValue)
{
- _impl->SetStringVariable(string(theVarName),
+ _impl->SetStringVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::STRING_VAR);
}
//============================================================================
void SALOMEDS_Study_i::SetStringAsDouble(const char* theVarName, CORBA::Double theValue)
{
- _impl->SetStringVariableAsDouble(string(theVarName),
+ _impl->SetStringVariableAsDouble(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::STRING_VAR);
}
//============================================================================
CORBA::Double SALOMEDS_Study_i::GetReal(const char* theVarName)
{
- return _impl->GetVariableValue(string(theVarName));
+ return _impl->GetVariableValue(std::string(theVarName));
}
//============================================================================
//============================================================================
CORBA::Long SALOMEDS_Study_i::GetInteger(const char* theVarName)
{
- return (int)_impl->GetVariableValue(string(theVarName));
+ return (int)_impl->GetVariableValue(std::string(theVarName));
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::GetBoolean(const char* theVarName)
{
- return (bool)_impl->GetVariableValue(string(theVarName));
+ return (bool)_impl->GetVariableValue(std::string(theVarName));
}
//============================================================================
//============================================================================
char* SALOMEDS_Study_i::GetString(const char* theVarName)
{
- return CORBA::string_dup(_impl->GetStringVariableValue(string(theVarName)).c_str());
+ return CORBA::string_dup(_impl->GetStringVariableValue(std::string(theVarName)).c_str());
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsReal(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::REAL_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsInteger(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::INTEGER_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsBoolean(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsString(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::STRING_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsVariable(const char* theVarName)
{
- return _impl->IsVariable(string(theVarName));
+ return _impl->IsVariable(std::string(theVarName));
}
//============================================================================
//============================================================================
SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetVariableNames()
{
- vector<string> aVarNames = _impl->GetVariableNames();
+ std::vector<std::string> aVarNames = _impl->GetVariableNames();
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
int aLen = aVarNames.size();
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::RemoveVariable(const char* theVarName)
{
- return _impl->RemoveVariable(string(theVarName));
+ return _impl->RemoveVariable(std::string(theVarName));
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::RenameVariable(const char* theVarName, const char* theNewVarName)
{
- return _impl->RenameVariable(string(theVarName), string(theNewVarName));
+ return _impl->RenameVariable(std::string(theVarName), std::string(theNewVarName));
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsVariableUsed(const char* theVarName)
{
- return _impl->IsVariableUsed(string(theVarName));
+ return _impl->IsVariableUsed(std::string(theVarName));
}
//============================================================================
SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theVarName)
{
- vector< vector<string> > aSections = _impl->ParseVariables(string(theVarName));
+ std::vector< std::vector<std::string> > aSections = _impl->ParseVariables(std::string(theVarName));
SALOMEDS::ListOfListOfStrings_var aResult = new SALOMEDS::ListOfListOfStrings;
aResult->length(aSectionsLen);
for (int aSectionInd = 0; aSectionInd < aSectionsLen; aSectionInd++) {
- vector<string> aVarNames = aSections[aSectionInd];
+ std::vector<std::string> aVarNames = aSections[aSectionInd];
SALOMEDS::ListOfStrings_var aList = new SALOMEDS::ListOfStrings;
{
SALOMEDS::Locker lock;
- string script = SALOMEDSImpl_IParameters::getDefaultScript(_impl, theModuleName, theShift);
+ std::string script = SALOMEDSImpl_IParameters::getDefaultScript(_impl, theModuleName, theShift);
return CORBA::string_dup(script.c_str());
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Study_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDSImpl_SObject.cxx
// Author : Sergey RUIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOMEDSIMPL_TMPFILE_I_H__
#define __SALOMEDSIMPL_TMPFILE_I_H__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseBuilder.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <string>
-using namespace std;
-
SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* theBuilder)
{
_isLocal = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseBuilder.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseBuilder_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "utilities.h"
-using namespace std;
-
//============================================================================
/*! Function : constructor
* Purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseBuilder_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseIterator.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDS.hxx"
#include "SALOMEDS_SObject.hxx"
-using namespace std;
-
SALOMEDS_UseCaseIterator::SALOMEDS_UseCaseIterator(const SALOMEDSImpl_UseCaseIterator& theIterator)
{
_isLocal = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseIterator_i.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_SObject.hxx"
#include "utilities.h"
-using namespace std;
-
//============================================================================
/*! Function : constructor
* Purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_UseCaseIterator_i.hxx
// Author : Sergey RUIN
// Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
## @package SALOME_DriverPy
# \brief python implementation of SALOMEDS::Driver interface
#
-#
import SALOMEDS__POA
## Python implementation of generic SALOMEDS::Driver.
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Paul RASCLE
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEDSTest.hxx"
#include "SALOMEDS_SObject.hxx"
-using namespace std;
// ============================================================================
/*!
void SALOMEDSTest::tearDown()
{
_PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
- vector<string> v = sm->GetOpenStudies();
+ std::vector<std::string> v = sm->GetOpenStudies();
for(int i = 0; i<v.size(); i++) {
_PTR(Study) study = sm->GetStudyByName(v[i]);
if(study)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMEDSTEST_HXX_
#define _SALOMEDSTEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeComment
* Use code of SALOMEDS_AttributeComment.cxx
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeDrawable
* Use code of SALOMEDS_AttributeDrawable.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeExpandable
* Use code of SALOMEDS_AttributeExpandable.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeExternalFileDef
* Use code of SALOMEDS_AttributeExternalFileDef.cxx
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeFileType
* Use code of SALOMEDS_AttributeFileType.cxx
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeFlags
* Use code of SALOMEDS_AttributeFlags.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeGraphic
* Use code of SALOMEDS_AttributeGraphic.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeIOR
* Use code of SALOMEDS_AttributeIOR.cxx
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
- string ior = _orb->object_to_string(_sm);
+ std::string ior = _orb->object_to_string(_sm);
//Check method SetValue
_attr->SetValue(ior);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeInteger
* Use code of SALOMEDS_AttributeInteger.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeLocalID
* Use code of SALOMEDS_AttributeLocalID.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeName
* Use code of SALOMEDS_AttributeName.cxx
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeOpened
* Use code of SALOMEDS_AttributeOpened.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#define PT_INTEGER 0
#define PT_REAL 1
#define PT_BOOLEAN 2
CPPUNIT_ASSERT(_attr->IsSet("BoolValue", PT_BOOLEAN));
CPPUNIT_ASSERT(!_attr->GetBool("BoolValue"));
- vector<int> intArray;
+ std::vector<int> intArray;
intArray.push_back(0);
intArray.push_back(1);
CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[0] == 0);
CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[1] == 1);
- vector<double> realArray;
+ std::vector<double> realArray;
realArray.push_back(0.0);
realArray.push_back(1.1);
CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[0] == 0.0);
CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[1] == 1.1);
- vector<string> strArray;
+ std::vector<std::string> strArray;
strArray.push_back("hello");
strArray.push_back("world");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributePersistentRef
* Use code of SALOMEDS_AttributePersistentRef.cxx
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributePixMap
* Use code of SALOMEDS_AttributePixMap.cxx
CPPUNIT_ASSERT(!_attr->HasPixMap());
//Check method SetPixMap
- string pixmap = "something";
+ std::string pixmap = "something";
_attr->SetPixMap(pixmap);
CPPUNIT_ASSERT(_attr->HasPixMap());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributePythonObject
* Use code of SALOMEDS_AttributePythonObject.cxx
//Check method IsScript
CPPUNIT_ASSERT(!_attr->IsScript());
- string pyobj = "some object!";
+ std::string pyobj = "some object!";
//Check method SetObject
_attr->SetObject(pyobj, true);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeReal
* Use code of SALOMEDS_AttributeReal.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeSelectable
* Use code of SALOMEDS_AttributeSelectable.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeSequenceOfInteger
* Use code of SALOMEDS_AttributeSequenceOfInteger.cxx
CPPUNIT_ASSERT(_attr->Value(3) == 3);
//Check method CorbaSequence
- vector<int> v = _attr->CorbaSequence();
+ std::vector<int> v = _attr->CorbaSequence();
CPPUNIT_ASSERT(v.size() == 3);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeSequenceOfReal
* Use code of SALOMEDS_AttributeSequenceOfReal.cxx
CPPUNIT_ASSERT(_attr->Value(3) == 3.3);
//Check method CorbaSequence
- vector<double> v = _attr->CorbaSequence();
+ std::vector<double> v = _attr->CorbaSequence();
CPPUNIT_ASSERT(v.size() == 3);
v.push_back(5.5);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeStudyProperties
* Use code of SALOMEDS_AttributeStudyProperties.cxx
CPPUNIT_ASSERT(_attr->GetUserName() == "srn");
//Check method SetCreationMode
- string value = "from scratch";
+ std::string value = "from scratch";
_attr->SetCreationMode(value);
//Check method GetCreationMode
_attr->SetModification("srn2", 6, 7, 8, 9, 10);
//Check method GetModificationsList
- vector<string> vs;
- vector<int> vi[5];
+ std::vector<std::string> vs;
+ std::vector<int> vi[5];
_attr->GetModificationsList(vs, vi[0], vi[1], vi[2], vi[3], vi[4], false);
CPPUNIT_ASSERT(vs[0] == "srn2" && vi[0][0] == 6 && vi[1][0] == 7 && vi[2][0] == 8 && vi[3][0] == 9 && vi[4][0] == 10);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTableOfInteger
* Use code of SALOMEDS_AttributeTableOfInteger.cxx
CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23);
//Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
+ std::vector<int> rs = _attr->GetRowSetIndices(1);
CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
_attr->PutValue(32, 2,2);
CPPUNIT_ASSERT(_attr->HasValue(2, 2));
- vector<string> rowTitles;
+ std::vector<std::string> rowTitles;
rowTitles.push_back("title1");
rowTitles.push_back("title2");
_attr->SetRowTitle(1, "new_title");
//Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
+ std::vector<std::string> rt = _attr->GetRowTitles();
CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
- vector<string> colTitles;
+ std::vector<std::string> colTitles;
colTitles.push_back("title1");
colTitles.push_back("title2");
_attr->SetColumnTitle(1, "new_title");
//Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
+ std::vector<std::string> ct = _attr->GetColumnTitles();
CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
- vector<string> rowUnits;
+ std::vector<std::string> rowUnits;
rowUnits.push_back("unit1");
rowUnits.push_back("unit2");
_attr->SetRowUnit(1, "new_unit");
//Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
+ std::vector<std::string> ru = _attr->GetRowUnits();
CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
//Check method AddRow
- vector<int> data;
+ std::vector<int> data;
data.push_back(11);
data.push_back(22);
CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
//Check method GetRow
- vector<int> data2 = _attr->GetRow(3);
+ std::vector<int> data2 = _attr->GetRow(3);
CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11 && data2[1] == 22);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTableOfReal
* Use code of SALOMEDS_AttributeTableOfReal.cxx
CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23.23);
//Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
+ std::vector<int> rs = _attr->GetRowSetIndices(1);
CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
_attr->PutValue(32.32, 2,2);
CPPUNIT_ASSERT(_attr->HasValue(2, 2));
- vector<string> rowTitles;
+ std::vector<std::string> rowTitles;
rowTitles.push_back("title1");
rowTitles.push_back("title2");
_attr->SetRowTitle(1, "new_title");
//Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
+ std::vector<std::string> rt = _attr->GetRowTitles();
CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
- vector<string> colTitles;
+ std::vector<std::string> colTitles;
colTitles.push_back("title1");
colTitles.push_back("title2");
_attr->SetColumnTitle(1, "new_title");
//Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
+ std::vector<std::string> ct = _attr->GetColumnTitles();
CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
- vector<string> rowUnits;
+ std::vector<std::string> rowUnits;
rowUnits.push_back("unit1");
rowUnits.push_back("unit2");
_attr->SetRowUnit(1, "new_unit");
//Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
+ std::vector<std::string> ru = _attr->GetRowUnits();
CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
//Check method AddRow
- vector<double> data;
+ std::vector<double> data;
data.push_back(11.11);
data.push_back(22.22);
CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
//Check method GetRow
- vector<double> data2 = _attr->GetRow(3);
+ std::vector<double> data2 = _attr->GetRow(3);
CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11.11 && data2[1] == 22.22);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTableOfString
* Use code of SALOMEDS_AttributeTableOfString.cxx
CPPUNIT_ASSERT(_attr->GetValue(1, 1) == "23");
//Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
+ std::vector<int> rs = _attr->GetRowSetIndices(1);
CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
_attr->PutValue("32", 2,2);
CPPUNIT_ASSERT(_attr->HasValue(2, 2));
- vector<string> rowTitles;
+ std::vector<std::string> rowTitles;
rowTitles.push_back("title1");
rowTitles.push_back("title2");
_attr->SetRowTitle(1, "new_title");
//Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
+ std::vector<std::string> rt = _attr->GetRowTitles();
CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
- vector<string> colTitles;
+ std::vector<std::string> colTitles;
colTitles.push_back("title1");
colTitles.push_back("title2");
_attr->SetColumnTitle(1, "new_title");
//Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
+ std::vector<std::string> ct = _attr->GetColumnTitles();
CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
- vector<string> rowUnits;
+ std::vector<std::string> rowUnits;
rowUnits.push_back("unit1");
rowUnits.push_back("unit2");
_attr->SetRowUnit(1, "new_unit");
//Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
+ std::vector<std::string> ru = _attr->GetRowUnits();
CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
//Check method AddRow
- vector<string> data;
+ std::vector<std::string> data;
data.push_back("11");
data.push_back("22");
CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
//Check method GetRow
- vector<string> data2 = _attr->GetRow(3);
+ std::vector<std::string> data2 = _attr->GetRow(3);
CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == "11" && data2[1] == "22");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTarget
* Use code of SALOMEDS_AttributeTarget.cxx
_attr->Add(so2);
//Check method Get
- vector< _PTR(SObject) > v = _attr->Get();
+ std::vector< _PTR(SObject) > v = _attr->Get();
CPPUNIT_ASSERT(v.size() == 2);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTextColor
* Use code of SALOMEDS_AttributeTextColor.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTextHighlightColor
* Use code of SALOMEDS_AttributeTextHighlightColor.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeTreeNode
* Use code of SALOMEDS_AttributeTreeNode.cxx
//Check the attribute creation
CPPUNIT_ASSERT(_attr);
- string TreeNodeID = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
+ std::string TreeNodeID = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
_PTR(SObject) so1 = study->CreateObjectID("0:1:2");
CPPUNIT_ASSERT(_attr2->GetTreeID() == TreeNodeID);
#else
- cout << endl << "THE TEST IS NOT COMPLETE !!!" << endl;
+ std::cout << std::endl << "THE TEST IS NOT COMPLETE !!!" << std::endl;
#endif
//Try to create the attribute with given TreeID
- string value = "0e1c36e6-1111-4d90-ab3b-18a14310e648";
+ std::string value = "0e1c36e6-1111-4d90-ab3b-18a14310e648";
_PTR(AttributeTreeNode) _attr_guid = studyBuilder->FindOrCreateAttribute(so, "AttributeTreeNodeGUID"+value);
CPPUNIT_ASSERT(_attr_guid && _attr_guid->GetTreeID() == value);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_AttributeUserID
* Use code of SALOMEDS_AttributeUserID.cxx
//Check the attribute creation
CPPUNIT_ASSERT(_attr);
- string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
+ std::string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
//Check method SetValue
_attr->SetValue(value);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_ChildIterator
* Use code of SALOMEDS_ChildIterator.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_SComponent
* Use code of SALOMEDS_SComponent.cxx
//Check method ComponentIOR
- string ior = _orb->object_to_string(_sm);
+ std::string ior = _orb->object_to_string(_sm);
_attr->SetValue(ior);
- string new_ior;
+ std::string new_ior;
CPPUNIT_ASSERT(sco->ComponentIOR(new_ior));
CPPUNIT_ASSERT(new_ior == ior);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_SComponentIterator
* Use code of SALOMEDS_SComponentIterator.cxx
studyBuilder->NewComponent("Test1");
studyBuilder->NewComponent("Test2");
- vector<string> v;
+ std::vector<std::string> v;
v.push_back("Test1");
v.push_back("Test2");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_SObject
* Use code of SALOMEDS_SObject.cxx
_PTR(AttributeName) _attrName = studyBuilder->FindOrCreateAttribute(so, "AttributeName");
_PTR(AttributeComment) _attrComment = studyBuilder->FindOrCreateAttribute(so, "AttributeComment");
- string ior = _orb->object_to_string(_sm);
+ std::string ior = _orb->object_to_string(_sm);
_attrIOR->SetValue(ior);
_attrName->SetValue("SO name");
_attrComment->SetValue("SO comment");
CPPUNIT_ASSERT(so->Name() == "test");
//Check method GetAllAttributes
- vector< _PTR(GenericAttribute) > v = so->GetAllAttributes();
+ std::vector< _PTR(GenericAttribute) > v = so->GetAllAttributes();
CPPUNIT_ASSERT(v.size() == 5); //+AttributeTarget +AttributeTreeNode
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_Study
* Use code of SALOMEDS_Study.cxx
CPPUNIT_ASSERT(!study->FindComponent(""));
//Check method GetComponentNames
- vector<string> components = study->GetComponentNames(""); //The context doesn't matter
+ std::vector<std::string> components = study->GetComponentNames(""); //The context doesn't matter
CPPUNIT_ASSERT(components.size() == 1 && components[0] == "sco1");
//Check method FindComponentID
_PTR(AttributeIOR) ior_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeIOR");
CPPUNIT_ASSERT(ior_attr_so1);
- string ior = _orb->object_to_string(_sm);
+ std::string ior = _orb->object_to_string(_sm);
ior_attr_so1->SetValue(ior);
_PTR(SObject) so2 = studyBuilder->NewObject(so1);
CPPUNIT_ASSERT(!study->FindObjectID(""));
//Check method FindObjectByName
- vector< _PTR(SObject) > v = study->FindObjectByName("so1", sco1->ComponentDataType());
+ std::vector< _PTR(SObject) > v = study->FindObjectByName("so1", sco1->ComponentDataType());
CPPUNIT_ASSERT(v.size()==1 && v[0]->GetID() == so1->GetID());
//Try to find SObject with empty name and empty component type
CPPUNIT_ASSERT(!study->FindObjectIOR(""));
//Check method GetObjectPath
- string path = study->GetObjectPath(so2);
+ std::string path = study->GetObjectPath(so2);
//Try to get path of NULL SObject
_PTR(SObject) emptySO;
study->SetContext("/"); //Root
//Check method GetObjectNames
- vector<string> vs = study->GetObjectNames("/sco1");
+ std::vector<std::string> vs = study->GetObjectNames("/sco1");
CPPUNIT_ASSERT(vs.size() == 2);
//Check method GetDirectoryNames
//Check method FindDependances
studyBuilder->Addreference(so2, so1);
studyBuilder->Addreference(sco1, so1);
- vector< _PTR(SObject) > vso = study->FindDependances(so1);
+ std::vector< _PTR(SObject) > vso = study->FindDependances(so1);
CPPUNIT_ASSERT(vso.size() == 2 && vso[0]->GetID() == so2->GetID() && vso[1]->GetID() == sco1->GetID());
//Check method GetProperties
//Check method GetLastModificationDate
sp->SetModification("srn", 1, 2, 3, 4, 5);
sp->SetModification("srn", 6, 7, 8, 9, 10);
- string date = study->GetLastModificationDate();
+ std::string date = study->GetLastModificationDate();
CPPUNIT_ASSERT(date == "08/09/0010 07:06");
//Check method EnableUseCaseAutoFilling
study->EnableUseCaseAutoFilling(false);
_PTR(SObject) uso1 = study->NewBuilder()->NewObject(sco1);
- vector< _PTR(GenericAttribute) > va1 = uso1->GetAllAttributes();
+ std::vector< _PTR(GenericAttribute) > va1 = uso1->GetAllAttributes();
CPPUNIT_ASSERT(va1.size() == 0);
study->EnableUseCaseAutoFilling(true);
_PTR(SObject) uso2 = study->NewBuilder()->NewObject(sco1);
- vector< _PTR(GenericAttribute) > va2 = uso2->GetAllAttributes();
+ std::vector< _PTR(GenericAttribute) > va2 = uso2->GetAllAttributes();
CPPUNIT_ASSERT(va2.size() == 1); // +AttributeTreeNode
//Check method DumpStudy
study->DumpStudy(".", "SRN", false);
- fstream f("SRN.py");
+ std::fstream f("SRN.py");
char buffer[128];
buffer[81] = (char)0;
f.getline(buffer, 80);
- string line(buffer);
+ std::string line(buffer);
f.close();
system("rm -f SRN.py");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_StudyBuilder
* Use code of SALOMEDS_StudyBuilder.cxx
CPPUNIT_ASSERT(sco1 && sco1->ComponentDataType() == "Test");
//Check method DefineComponentInstance
- string ior = _orb->object_to_string(_sm);
+ std::string ior = _orb->object_to_string(_sm);
studyBuilder->DefineComponentInstance(sco1, ior);
- string newior;
+ std::string newior;
sco1->ComponentIOR(newior);
CPPUNIT_ASSERT(newior == ior);
//Check method NewObject
_PTR(SObject) so1 = studyBuilder->NewObject(sco3);
CPPUNIT_ASSERT(so1);
- string id1 = so1->GetID();
+ std::string id1 = so1->GetID();
//Check method NewObjectToTag
_PTR(SObject) so2 = studyBuilder->NewObjectToTag(so1, 2);
CPPUNIT_ASSERT(so2 && so2->Tag() == 2);
- string id2 = so2->GetID();
+ std::string id2 = so2->GetID();
//Check method FindOrCreateAttribute
_PTR(SObject) so3 = studyBuilder->NewObject(sco3);
CPPUNIT_ASSERT(!so2->ReferencedObject(refSO));
//Check method SetGUID and IsGUID
- string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
+ std::string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
studyBuilder->SetGUID(so1, value);
CPPUNIT_ASSERT(studyBuilder->IsGUID(so1, value));
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_StudyManager
* Use code of SALOMEDS_StudyManager.cxx
CPPUNIT_ASSERT(study4->Name() == study2->Name());
//Check method GetOpenStudies
- vector<string> v = sm->GetOpenStudies();
+ std::vector<std::string> v = sm->GetOpenStudies();
CPPUNIT_ASSERT(v.size() == 2);
//Check method Close
//Check method SaveAs
sm->SaveAs("srn_UnitTest_Save.hdf", study1, false);
- string url = study1->URL();
+ std::string url = study1->URL();
sm->Close(study1);
//Check method Open
CPPUNIT_ASSERT(sco3);
// Add a new SObject with AttributeName that contains "Saved study" string
_PTR(SObject) so3 = sb3->NewObject(sco3);
- string soID = so3->GetID();
+ std::string soID = so3->GetID();
_PTR(AttributeName) na3 = sb3->FindOrCreateAttribute(so3, "AttributeName");
CPPUNIT_ASSERT(na3);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
/*!
* Check all methods of SALOMEDS_UseCaseBuilder and UseCaseIterator
* Use code of SALOMEDS_UseCaseBuilder.cxx and SALOMEDS_UseCaseIterator.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all SALOMEDS Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
#include "NamingService_WaitForServerReadiness.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
-using namespace std;
// ============================================================================
/*!
int size;
gethostname(hostname, size);
char* chr_port = getenv("SALOMEDS_UNITTESTS_PORT");
- string port;
+ std::string port;
if(chr_port) port = chr_port;
if(port.empty()) port = "2810";
- string cfg_file = string(getenv("HOME"))+"/.omniORB_"+string(hostname)+"_"+port+".cfg";
+ std::string cfg_file = std::string(getenv("HOME"))+"/.omniORB_"+std::string(hostname)+"_"+port+".cfg";
setenv("OMNIORB_CONFIG", cfg_file.c_str(), 1);
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
sleep(15);
- string host; // = Kernel_Utils::GetHostname();
+ std::string host; // = Kernel_Utils::GetHostname();
char* wait_Superv = getenv("SALOMEDS_UNITTESTS_WAIT_SUPERVISOR");
if(wait_Superv) host = Kernel_Utils::GetHostname();
if(host.empty())
NamingService_WaitForServerReadiness(&NS, "/myStudyManager");
else {
- string serverName = "/Containers/"+host+"/SuperVisionContainer";
+ std::string serverName = "/Containers/"+host+"/SuperVisionContainer";
NamingService_WaitForServerReadiness(&NS, serverName);
}
}
//Set up the environement for Embedded case
- string kernel_root = getenv("KERNEL_ROOT_DIR");
+ std::string kernel_root = getenv("KERNEL_ROOT_DIR");
CPPUNIT_ASSERT(!kernel_root.empty());
kernel_root+="/share/salome/resources/kernel";
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import orbmodule
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOMEDSClient: client interface of SALOMEDS
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
SALOMEDSClient_AttributeSequenceOfInteger.hxx \
SALOMEDSClient_AttributeSequenceOfReal.hxx \
SALOMEDSClient_AttributeStudyProperties.hxx \
+ SALOMEDSClient_AttributeTable.hxx \
SALOMEDSClient_AttributeTableOfInteger.hxx \
SALOMEDSClient_AttributeTableOfReal.hxx \
SALOMEDSClient_AttributeTableOfString.hxx \
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEDSCLIENT_HXX
#define SALOMEDSCLIENT_HXX
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeComment.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeDrawable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeExpandable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeExternalFileDef.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeFileType.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeFlags.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeFlags.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeLocalID.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeName.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeOpened.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributePersistentRef.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributePixMap.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributePythonObject.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeReal.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeSelectable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeSequenceOfInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeSequenceOfSequenceOfReal.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeString.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeStudyProperties.hxx
// Author : Sergey RUIN
// Module : SALOME
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SALOMEDSClient_AttributeTable.hxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef SALOMEDSClient_AttributeTable_HeaderFile
+#define SALOMEDSClient_AttributeTable_HeaderFile
+
+#include <vector>
+#include <string>
+#include "SALOMEDSClient_definitions.hxx"
+#include "SALOMEDSClient_GenericAttribute.hxx"
+
+class SALOMEDSClient_AttributeTable: public virtual SALOMEDSClient_GenericAttribute
+{
+public:
+ typedef enum {
+ AscendingOrder,
+ DescendingOrder,
+ } SortOrder;
+
+ typedef enum {
+ EmptyLowest,
+ EmptyHighest,
+ EmptyFirst,
+ EmptyLast,
+ EmptyIgnore,
+ } SortPolicy;
+
+ virtual void SetTitle(const std::string& theTitle) = 0;
+ virtual std::string GetTitle() = 0;
+ virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
+ virtual std::string GetRowTitle(int theIndex) = 0;
+ virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
+ virtual std::vector<std::string> GetRowTitles() = 0;
+ virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
+ virtual std::string GetColumnTitle(int theIndex) = 0;
+ virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
+ virtual std::vector<std::string> GetColumnTitles() = 0;
+ virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
+ virtual std::string GetRowUnit(int theIndex) = 0;
+ virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
+ virtual std::vector<std::string> GetRowUnits() = 0;
+
+ virtual int GetNbRows() = 0;
+ virtual int GetNbColumns() = 0;
+ virtual bool HasValue(int theRow, int theColumn) = 0;
+ virtual void RemoveValue(int theRow, int theColumn) = 0;
+
+ virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
+ virtual void SetNbColumns(int theNbColumns) = 0;
+
+ virtual std::vector<int> SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy) = 0;
+ virtual std::vector<int> SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy) = 0;
+ virtual std::vector<int> SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy) = 0;
+ virtual std::vector<int> SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy) = 0;
+ virtual void SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2) = 0;
+ virtual void SwapRows(int theRow1, int theRow2) = 0;
+ virtual void SwapColumns(int theColumn1, int theColumn2) = 0;
+};
+
+#endif // SALOMEDSClient_AttributeTable_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTableOfInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
#include <string>
#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
+#include "SALOMEDSClient_AttributeTable.hxx"
-class SALOMEDSClient_AttributeTableOfInteger: public virtual SALOMEDSClient_GenericAttribute
+class SALOMEDSClient_AttributeTableOfInteger: public SALOMEDSClient_AttributeTable
{
-
public:
-
- virtual void SetTitle(const std::string& theTitle) = 0;
- virtual std::string GetTitle() = 0;
- virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetRowTitles() = 0;
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetColumnTitles() = 0;
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
- virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
- virtual std::vector<std::string> GetRowUnits() = 0;
-
- virtual int GetNbRows() = 0;
- virtual int GetNbColumns() = 0;
virtual void AddRow(const std::vector<int>& theData) = 0;
virtual void SetRow(int theRow, const std::vector<int>& theData) = 0;
virtual std::vector<int> GetRow(int theRow) = 0;
virtual void SetColumn(int theColumn, const std::vector<int>& theData) = 0;
virtual std::vector<int> GetColumn(int theColumn) = 0;
virtual void PutValue(int theValue, int theRow, int theColumn) = 0;
- virtual bool HasValue(int theRow, int theColumn) = 0;
virtual int GetValue(int theRow, int theColumn) = 0;
-
- virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
- virtual void SetNbColumns(int theNbColumns) = 0;
-
};
-#endif
+#endif // SALOMEDSClient_AttributeTableOfInteger_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTableOfReal.hxx
// Author : Michael Ponikarov
// Module : SALOME
#include <vector>
#include <string>
#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
+#include "SALOMEDSClient_AttributeTable.hxx"
-class SALOMEDSClient_AttributeTableOfReal: public virtual SALOMEDSClient_GenericAttribute
+class SALOMEDSClient_AttributeTableOfReal: public SALOMEDSClient_AttributeTable
{
-
public:
-
- virtual void SetTitle(const std::string& theTitle) = 0;
- virtual std::string GetTitle() = 0;
- virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetRowTitles() = 0;
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetColumnTitles() = 0;
- virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
- virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
- virtual std::vector<std::string> GetRowUnits() = 0;
-
- virtual int GetNbRows() = 0;
- virtual int GetNbColumns() = 0;
virtual void AddRow(const std::vector<double>& theData) = 0;
virtual void SetRow(int theRow, const std::vector<double>& theData) = 0;
virtual std::vector<double> GetRow(int theRow) = 0;
virtual void SetColumn(int theColumn, const std::vector<double>& theData) = 0;
virtual std::vector<double> GetColumn(int theColumn) = 0;
virtual void PutValue(double theValue, int theRow, int theColumn) = 0;
- virtual bool HasValue(int theRow, int theColumn) = 0;
virtual double GetValue(int theRow, int theColumn) = 0;
-
- virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
- virtual void SetNbColumns(int theNbColumns) = 0;
-
};
-#endif
+#endif // SALOMEDSClient_AttributeTableOfReal_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTableOfString.hxx
// Author : Sergey RUIN
// Module : SALOME
#include <vector>
#include <string>
#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
+#include "SALOMEDSClient_AttributeTable.hxx"
-class SALOMEDSClient_AttributeTableOfString: public virtual SALOMEDSClient_GenericAttribute
+class SALOMEDSClient_AttributeTableOfString: public SALOMEDSClient_AttributeTable
{
public:
-
- virtual void SetTitle(const std::string& theTitle) = 0;
- virtual std::string GetTitle() = 0;
- virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetRowTitles() = 0;
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetColumnTitles() = 0;
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
- virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
- virtual std::vector<std::string> GetRowUnits() = 0;
-
- virtual int GetNbRows() = 0;
- virtual int GetNbColumns() = 0;
virtual void AddRow(const std::vector<std::string>& theData) = 0;
virtual void SetRow(int theRow, const std::vector<std::string>& theData) = 0;
virtual std::vector<std::string> GetRow(int theRow) = 0;
virtual void SetColumn(int theColumn, const std::vector<std::string>& theData) = 0;
virtual std::vector<std::string> GetColumn(int theColumn) = 0;
virtual void PutValue(const std::string& theValue, int theRow, int theColumn) = 0;
- virtual bool HasValue(int theRow, int theColumn) = 0;
virtual std::string GetValue(int theRow, int theColumn) = 0;
-
- virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
- virtual void SetNbColumns(int theNbColumns) = 0;
-
};
-#endif
+#endif // SALOMEDSClient_AttributeTableOfString_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTarget.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTextColor.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTextHighlightColor.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeTreeNode.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_AttributeUserID.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_ChildIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEDSClient_ClientFactory.hxx"
#ifdef WIN32
static CONVERT_STUDY_FUNCTION aConvertStudy = NULL;
static CONVERT_BUILDER_FUNCTION aConvertBuilder = NULL;
-using namespace std;
-
_PTR(SObject) ClientFactory::SObject(SALOMEDS::SObject_ptr theSObject)
{
SALOMEDSClient_SObject* so = NULL;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_ClientFactory.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient__GenericAttribute.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEDSClient_IParameters_H
#define SALOMEDSClient_IParameters_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_SComponent.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_SComponentIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_SObject.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_Study.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_StudyBuilder.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_StudyManager.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_UseCaseBuilder.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSClient_UseCaseIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEDSCLIENT_DEF_HXX
#define SALOMEDSCLIENT_DEF_HXX
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
SALOMEDSImpl_AttributePixMap.hxx \
SALOMEDSImpl_AttributeLocalID.hxx \
SALOMEDSImpl_AttributeTarget.hxx \
+ SALOMEDSImpl_AttributeTable.hxx \
SALOMEDSImpl_AttributeTableOfInteger.hxx \
SALOMEDSImpl_AttributeTableOfReal.hxx \
SALOMEDSImpl_AttributeTableOfString.hxx \
SALOMEDSImpl_AttributeSequenceOfReal.hxx \
SALOMEDSImpl_Attributes.hxx \
SALOMEDSImpl_AttributeStudyProperties.hxx \
+ SALOMEDSImpl_AttributeTable.hxx \
SALOMEDSImpl_AttributeTableOfInteger.hxx \
SALOMEDSImpl_AttributeTableOfReal.hxx \
SALOMEDSImpl_AttributeTableOfString.hxx \
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeComment.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeComment.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
-const string& SALOMEDSImpl_AttributeComment::GetID ()
+const std::string& SALOMEDSImpl_AttributeComment::GetID ()
{
- static string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9");
+ static std::string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9");
return CommentID;
}
SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L,
- const string& Val)
+ const std::string& Val)
{
SALOMEDSImpl_AttributeComment* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
//function : SetValue
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeComment::SetValue (const string& S)
+void SALOMEDSImpl_AttributeComment::SetValue (const std::string& S)
{
CheckLocked();
//function : ID
//purpose :
//=======================================================================
-const string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); }
+const std::string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); }
//=======================================================================
//function : NewEmpty
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeDrawable.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeDrawable.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeDrawable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeExpandable.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeExpandable.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeExpandable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeExternalFileDef.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile
#define _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeFileType.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeFileType.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMEDSImpl_AttributeFileType_HeaderFile
#define _SALOMEDSImpl_AttributeFileType_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeFlags.cxx
// Author : Sergey LITONIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeFlags.hxx"
-using namespace std;
-
-
/*
Class : SALOMEDSImpl_AttributeFlags
Description : This class is intended for storing different object attributes that
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeFlags.hxx
// Author : Sergey LITONIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeGraphic.cxx
// Author : Sergey LITONIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeGraphic.hxx"
#include "DF_Attribute.hxx"
-using namespace std;
-
/*
Class : SALOMEDSImpl_AttributeGraphic
Description : This class is intended for storing information about
//function : SetVisibility
//purpose : Set visibility of object in all views
//=======================================================================
-void SALOMEDSImpl_AttributeGraphic::SetVisibility( const map<int, int>& theMap )
+void SALOMEDSImpl_AttributeGraphic::SetVisibility( const std::map<int, int>& theMap )
{
myVisibility = theMap;
}
//function : SetVisibility
//purpose : Get visibility of object in all views
//=======================================================================
-const map<int, int>& SALOMEDSImpl_AttributeGraphic::GetVisibility()
+const std::map<int, int>& SALOMEDSImpl_AttributeGraphic::GetVisibility()
{
return myVisibility;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeGraphic.hxx
// Author : Sergey LITONIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeIOR.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
//to disable automatic genericobj management comment the following line
#define WITHGENERICOBJ
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeInteger.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeInteger.hxx"
#include <stdlib.h>
-using namespace std;
//=======================================================================
//function : GetID
//function : Save
//purpose :
//=======================================================================
-string SALOMEDSImpl_AttributeInteger::Save()
+std::string SALOMEDSImpl_AttributeInteger::Save()
{
char buffer[128];
sprintf(buffer, "%d", myValue);
- return string(buffer);
+ return std::string(buffer);
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeInteger::Load(const string& theValue)
+void SALOMEDSImpl_AttributeInteger::Load(const std::string& theValue)
{
myValue = atoi(theValue.c_str());
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeLocalID.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeLocalID.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//function : Save
//purpose :
//=======================================================================
-string SALOMEDSImpl_AttributeLocalID::Save()
+std::string SALOMEDSImpl_AttributeLocalID::Save()
{
char buffer[128];
sprintf(buffer, "%d", myValue);
- return string(buffer);
+ return std::string(buffer);
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeLocalID::Load(const string& theValue)
+void SALOMEDSImpl_AttributeLocalID::Load(const std::string& theValue)
{
myValue = atoi(theValue.c_str());
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeLocalID.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeName.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeName.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeOpened.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeOpened.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeOpened.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeParameter.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <sstream>
#include <sstream>
-using namespace std;
-
-
// Purpose: Each character in the string is replaced by 3 characters: '%' and hex number
// of the character (2 characters)
-string convertString(const string& S)
+std::string convertString(const std::string& S)
{
int length = S.size();
const char *s = S.c_str();
buffer[pos+2] = c[1];
}
- string RS(buffer);
+ std::string RS(buffer);
delete c;
delete buffer;
return RS;
}
//Restors a string converted by the function convertString
-string restoreString(const string& S)
+std::string restoreString(const std::string& S)
{
int length = S.size();
char *c = new char[3], *buffer = new char[length/3+1];
buffer[pos] = (char)val;
}
- string RS(buffer);
+ std::string RS(buffer);
delete c;
delete buffer;
return RS;
* Purpose : Associates a integer value with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& theValue)
+void SALOMEDSImpl_AttributeParameter::SetInt(const std::string& theID, const int& theValue)
{
CheckLocked();
* Purpose : Returns a int value associated with the given ID
*/
//=======================================================================
-int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID)
+int SALOMEDSImpl_AttributeParameter::GetInt(const std::string& theID)
{
if(!IsSet(theID, PT_INTEGER)) throw DFexception("Invalid ID");
return _ints[theID];
* Purpose : Associates a double value with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double& theValue)
+void SALOMEDSImpl_AttributeParameter::SetReal(const std::string& theID, const double& theValue)
{
CheckLocked();
* Purpose : Returns a double value associated with the given ID
*/
//=======================================================================
-double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID)
+double SALOMEDSImpl_AttributeParameter::GetReal(const std::string& theID)
{
if(!IsSet(theID, PT_REAL)) throw DFexception("Invalid ID");
return _reals[theID];
* Purpose : Associates a string with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const string& theValue)
+void SALOMEDSImpl_AttributeParameter::SetString(const std::string& theID, const std::string& theValue)
{
CheckLocked();
* Purpose : Returns a string associated with the given ID
*/
//=======================================================================
-string SALOMEDSImpl_AttributeParameter::GetString(const string& theID)
+std::string SALOMEDSImpl_AttributeParameter::GetString(const std::string& theID)
{
if(!IsSet(theID, PT_STRING)) throw DFexception("Invalid ID");
return _strings[theID];
* Purpose : Associates a bool value with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& theValue)
+void SALOMEDSImpl_AttributeParameter::SetBool(const std::string& theID, const bool& theValue)
{
CheckLocked();
* Purpose : Returns a bool value associated with the ID
*/
//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID)
+bool SALOMEDSImpl_AttributeParameter::GetBool(const std::string& theID)
{
if(!IsSet(theID, PT_BOOLEAN)) throw DFexception("Invalid ID");
return _bools[theID];
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetRealArray(const std::string& theID, const std::vector<double>& theArray)
{
CheckLocked();
* Purpose : Returns double values associated with the ID
*/
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID)
+std::vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const std::string& theID)
{
if(!IsSet(theID, PT_REALARRAY)) throw DFexception("Invalid ID");
return _realarrays[theID];
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetIntArray(const std::string& theID, const std::vector<int>& theArray)
{
CheckLocked();
* Purpose : Returns int values associated with the ID
*/
//=======================================================================
-vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID)
+std::vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const std::string& theID)
{
if(!IsSet(theID, PT_INTARRAY)) throw DFexception("Invalid ID");
return _intarrays[theID];
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetStrArray(const std::string& theID, const std::vector<std::string>& theArray)
{
CheckLocked();
* Purpose : Returns string values associated with the ID
*/
//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID)
+std::vector<std::string> SALOMEDSImpl_AttributeParameter::GetStrArray(const std::string& theID)
{
if(!IsSet(theID, PT_STRARRAY)) throw DFexception("Invalid ID");
return _strarrays[theID];
* a value in the attribute
*/
//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter_Types theType)
+bool SALOMEDSImpl_AttributeParameter::IsSet(const std::string& theID, const Parameter_Types theType)
{
switch(theType) {
case PT_INTEGER: {
* Purpose : Removes a parameter with given ID
*/
//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::RemoveID(const string& theID, const Parameter_Types theType)
+bool SALOMEDSImpl_AttributeParameter::RemoveID(const std::string& theID, const Parameter_Types theType)
{
Backup();
SetModifyFlag();
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
+std::vector<std::string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
{
- vector<string> anArray;
+ std::vector<std::string> anArray;
int i = 0;
switch(theType) {
case PT_INTEGER: {
if(_ints.size()) {
anArray.resize(_ints.size());
- for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
+ for(std::map<std::string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_REAL: {
if(_reals.size()) {
anArray.resize(_reals.size());
- for(map<string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
+ for(std::map<std::string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_BOOLEAN: {
if(_bools.size()) {
anArray.resize(_bools.size());
- for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
+ for(std::map<std::string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_STRING: {
if(_strings.size()) {
anArray.resize(_strings.size());
- for(map<string,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
+ for(std::map<std::string,std::string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
anArray[i] = p->first;
}
break;
case PT_REALARRAY: {
if(_realarrays.size()) {
anArray.resize(_realarrays.size());
- for(map< string, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
+ for(std::map< std::string, std::vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
anArray[i] = p->first;
}
break;
case PT_INTARRAY: {
if(_intarrays.size()) {
anArray.resize(_intarrays.size());
- for(map< string, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
+ for(std::map< std::string, std::vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
anArray[i] = p->first;
}
break;
case PT_STRARRAY: {
if(_strarrays.size()) {
anArray.resize(_strarrays.size());
- for(map< string, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
+ for(std::map< std::string, std::vector<std::string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
anArray[i] = p->first;
}
break;
_intarrays.clear();
_strarrays.clear();
- for(map<string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++)
+ for(std::map<std::string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++)
if(p->first.size()) _ints[p->first] = p->second;
- for(map<string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++)
+ for(std::map<std::string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++)
if(p->first.size()) _reals[p->first] = p->second;
- for(map<string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++)
+ for(std::map<std::string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++)
if(p->first.size()) _bools[p->first] = p->second;
- for(map<string,string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
+ for(std::map<std::string,std::string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
if(p->first.size()) _strings[p->first] = p->second;
- for(map< string,vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
+ for(std::map< std::string,std::vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
if(p->first.size()) _realarrays[p->first] = p->second;
- for(map< string,vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
+ for(std::map< std::string,std::vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
if(p->first.size()) _intarrays[p->first] = p->second;
- for(map< string,vector<string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
+ for(std::map< std::string,std::vector<std::string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
if(p->first.size()) _strarrays[p->first] = p->second;
}
* Purpose : Saves a content of the attribute as a string
*/
//=======================================================================
-string SALOMEDSImpl_AttributeParameter::Save()
+std::string SALOMEDSImpl_AttributeParameter::Save()
{
- ostringstream buffer;
+ std::ostringstream buffer;
char *tmpBuffer = new char[255];
buffer << _ints.size() << " ";
- for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
+ for(std::map<std::string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
buffer << convertString(p->first) << " " << p->second << " ";
}
buffer << _reals.size() << " ";
- for(map<string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
+ for(std::map<std::string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
sprintf(tmpBuffer, "%.64e", p->second);
buffer << convertString(p->first) << " " << tmpBuffer << " ";
}
buffer << _bools.size() << " ";
- for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
+ for(std::map<std::string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
buffer << convertString(p->first) << " " << p->second << " ";
}
buffer << _strings.size() << " ";
- for(map<string,string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
+ for(std::map<std::string,std::string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
buffer << convertString(p->first) << " " << convertString(p->second) << " ";
}
buffer << _realarrays.size() << " ";
- for(map< string,vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
- vector<double> v(p->second);
+ for(std::map< std::string,std::vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
+ std::vector<double> v(p->second);
sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
}
buffer << _intarrays.size() << " ";
- for(map< string,vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
- vector<int> v(p->second);
+ for(std::map< std::string,std::vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
+ std::vector<int> v(p->second);
sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
}
buffer << _strarrays.size() << " ";
- for(map< string,vector<string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
- vector<string> v(p->second);
+ for(std::map< std::string,std::vector<std::string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
+ std::vector<std::string> v(p->second);
sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
delete tmpBuffer;
- string AS = buffer.str();
+ std::string AS = buffer.str();
return AS;
}
* Purpose : Restores the attribute from the string
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::Load(const string& theValue)
+void SALOMEDSImpl_AttributeParameter::Load(const std::string& theValue)
{
Backup();
_realarrays.clear();
_intarrays.clear();
- istringstream buffer(theValue.c_str());
+ std::istringstream buffer(theValue.c_str());
int size, val, ival;
double val2;
- string s, id;
+ std::string s, id;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- vector<double> v;
+ std::vector<double> v;
v.resize(val);
for(int j = 0; j<val; j++) {
buffer >> val2;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- vector<int> v;
+ std::vector<int> v;
v.resize(val);
for(int j = 0; j<val; j++) {
buffer >> ival;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- vector<string> v;
+ std::vector<std::string> v;
v.resize(val);
for(int j = 0; j<val; j++) {
buffer >> s;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributePersistentRef.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributePersistentRef.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributePixMap.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributePixMap.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributePixMap.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributePythonObject.cxx
// Author : Michael Ponikarov
// Module : SALOME
//
#include "SALOMEDSImpl_AttributePythonObject.hxx"
-using namespace std;
-
const std::string& SALOMEDSImpl_AttributePythonObject::GetID()
{
static std::string SALOMEDSImpl_AttributePythonObjectID ("128371A3-8F52-11d6-A8A3-0001021E8C7F");
myIsScript = false;
}
-void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence,
+void SALOMEDSImpl_AttributePythonObject::SetObject(const std::string& theSequence,
const bool theScript)
{
CheckLocked();
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-string SALOMEDSImpl_AttributePythonObject::GetObject() const
+std::string SALOMEDSImpl_AttributePythonObject::GetObject() const
{
return mySequence;
}
}
-string SALOMEDSImpl_AttributePythonObject::Save()
+std::string SALOMEDSImpl_AttributePythonObject::Save()
{
- string aString = GetObject();
- string aResult = IsScript()?"s":"n";
+ std::string aString = GetObject();
+ std::string aResult = IsScript()?"s":"n";
aResult += aString;
return aResult;
}
-void SALOMEDSImpl_AttributePythonObject::Load(const string& value)
+void SALOMEDSImpl_AttributePythonObject::Load(const std::string& value)
{
char* aString = (char*)value.c_str();
SetObject(aString + 1, aString[0]=='s');
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributePythonObject.hxx
// Author : Michael Ponikarov
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeReal.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeReal.hxx"
-using namespace std;
-
#include <stdlib.h>
//function : Save
//purpose :
//=======================================================================
-string SALOMEDSImpl_AttributeReal::Save()
+std::string SALOMEDSImpl_AttributeReal::Save()
{
char buffer[255];
sprintf(buffer, "%.64e", myValue);
- return string(buffer);
+ return std::string(buffer);
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeReal::Load(const string& theValue)
+void SALOMEDSImpl_AttributeReal::Load(const std::string& theValue)
{
myValue = atof(theValue.c_str());
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeReal.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeReference.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeReference.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
const std::string& SALOMEDSImpl_AttributeReference::ID () const { return GetID(); }
-string SALOMEDSImpl_AttributeReference::Save()
+std::string SALOMEDSImpl_AttributeReference::Save()
{
return myLabel.Entry();
}
-void SALOMEDSImpl_AttributeReference::Load(const string& value)
+void SALOMEDSImpl_AttributeReference::Load(const std::string& value)
{
myLabel = DF_Label::Label(Label(), value, true);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeSelectable.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeSelectable.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeSelectable.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeSequenceOfInteger.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
#include <string.h>
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(into)->Assign(myValue);
}
-void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const vector<int>& other)
+void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const std::vector<int>& other)
{
CheckLocked();
Backup();
if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
- typedef vector<int>::iterator VI;
+ typedef std::vector<int>::iterator VI;
int i = 1;
for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) {
if(i == Index) {
-string SALOMEDSImpl_AttributeSequenceOfInteger::Save()
+std::string SALOMEDSImpl_AttributeSequenceOfInteger::Save()
{
int aLength = Length();
char* aResult = new char[aLength * 25];
sprintf(aResult + aPosition , "%d ", Value(i));
aPosition += strlen(aResult + aPosition);
}
- string ret(aResult);
+ std::string ret(aResult);
delete aResult;
return ret;
}
-void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const string& value)
+void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const std::string& value)
{
char* aCopy = (char*)value.c_str();
char* adr = strtok(aCopy, " ");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeSequenceOfInteger.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeSequenceOfReal.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
#include <string.h>
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(into)->Assign(myValue);
}
-void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const vector<double>& other)
+void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const std::vector<double>& other)
{
CheckLocked();
Backup();
if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
- typedef vector<double>::iterator VI;
+ typedef std::vector<double>::iterator VI;
int i = 1;
for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) {
if(i == Index) {
}
-string SALOMEDSImpl_AttributeSequenceOfReal::Save()
+std::string SALOMEDSImpl_AttributeSequenceOfReal::Save()
{
int aLength = Length();
char* aResult = new char[aLength * 127];
sprintf(aResult + aPosition , "%.64e ", Value(i));
aPosition += strlen(aResult + aPosition);
}
- string ret(aResult);
+ std::string ret(aResult);
delete aResult;
return ret;
}
-void SALOMEDSImpl_AttributeSequenceOfReal::Load(const string& value)
+void SALOMEDSImpl_AttributeSequenceOfReal::Load(const std::string& value)
{
char* aCopy = (char*)value.c_str();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeSequenceOfReal.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeString.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeString.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeIOR.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeStudyProperties.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
#include <string.h>
-using namespace std;
-
-
const std::string& SALOMEDSImpl_AttributeStudyProperties::GetID()
{
static std::string SALOMEDSImpl_AttributeStudyPropertiesID ("128371A2-8F52-11d6-A8A3-0001021E8C7F");
}
void SALOMEDSImpl_AttributeStudyProperties::GetModifications
- (vector<string>& theUserNames,
- vector<int>& theMinutes,
- vector<int>& theHours,
- vector<int>& theDays,
- vector<int>& theMonths,
- vector<int>& theYears) const
+ (std::vector<std::string>& theUserNames,
+ std::vector<int>& theMinutes,
+ std::vector<int>& theHours,
+ std::vector<int>& theDays,
+ std::vector<int>& theMonths,
+ std::vector<int>& theYears) const
{
theUserNames = myUserName;
theMinutes = myMinute;
dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(with);
Init();
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
for (int i = 0, len = aNames.size(); i < len; i++) {
myUserName.push_back(aNames[i]);
}
-string SALOMEDSImpl_AttributeStudyProperties::Save()
+std::string SALOMEDSImpl_AttributeStudyProperties::Save()
{
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
int aLength, anIndex;
aProperty[a++] = 1;
}
aProperty[a] = 0;
- string prop(aProperty);
+ std::string prop(aProperty);
delete aProperty;
return prop;
}
-void SALOMEDSImpl_AttributeStudyProperties::Load(const string& value)
+void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value)
{
char* aCopy = (char*)value.c_str();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeStudyProperties.hxx
// Author : Sergey RUIN
// Module : SALOME
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SALOMEDSImpl_AttributeTable.hxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef _SALOMEDSImpl_AttributeTable_HeaderFile
+#define _SALOMEDSImpl_AttributeTable_HeaderFile
+
+#include "SALOMEDSImpl_Defines.hxx"
+
+class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTable
+{
+public:
+ //! Sort order
+ typedef enum {
+ AscendingOrder, //!< The items are sorted ascending
+ DescendingOrder, //!< The items are sorted descending
+ } SortOrder;
+
+ //! Sort policy (specifies how empty cells are taken into account when sorting)
+ typedef enum {
+ EmptyLowest, //!< Empty cells are considered as lowest values
+ EmptyHighest, //!< Empty cells are considered as highest values
+ EmptyFirst, //!< Empty cells are always first
+ EmptyLast, //!< Empty cells are always last
+ EmptyIgnore, //!< Empty cells are ignored (stay at initial positions)
+ } SortPolicy;
+};
+
+template <class TTable> class TableSorter
+{
+ TTable* myTable;
+ SALOMEDSImpl_AttributeTable::SortOrder mySortOrder;
+ SALOMEDSImpl_AttributeTable::SortPolicy mySortPolicy;
+ int myIndex;
+ bool myIsRow;
+
+public:
+ TableSorter( TTable* table,
+ SALOMEDSImpl_AttributeTable::SortOrder so,
+ SALOMEDSImpl_AttributeTable::SortPolicy sp,
+ int index,
+ bool sortRow)
+ : myTable( table ), mySortOrder( so ), mySortPolicy( sp ),
+ myIndex( index ), myIsRow( sortRow ) {}
+
+ bool operator() ( int idx1, int idx2 )
+ {
+ bool hasValue1 = myIsRow ? myTable->HasValue( myIndex, idx1 ) : myTable->HasValue( idx1, myIndex );
+ bool hasValue2 = myIsRow ? myTable->HasValue( myIndex, idx2 ) : myTable->HasValue( idx2, myIndex );
+ if ( !hasValue1 && !hasValue2 ) {
+ return false;
+ }
+ else if ( !hasValue1 || !hasValue2 ) {
+ switch ( mySortPolicy ) {
+ case SALOMEDSImpl_AttributeTable::EmptyLowest:
+ return (!hasValue1) ?
+ (mySortOrder == SALOMEDSImpl_AttributeTable::AscendingOrder) :
+ (mySortOrder == SALOMEDSImpl_AttributeTable::DescendingOrder);
+ case SALOMEDSImpl_AttributeTable::EmptyHighest:
+ return (!hasValue1) ?
+ (mySortOrder != SALOMEDSImpl_AttributeTable::AscendingOrder) :
+ (mySortOrder != SALOMEDSImpl_AttributeTable::DescendingOrder);
+ case SALOMEDSImpl_AttributeTable::EmptyFirst:
+ return (!hasValue1);
+ case SALOMEDSImpl_AttributeTable::EmptyLast:
+ return hasValue1;
+ case SALOMEDSImpl_AttributeTable::EmptyIgnore:
+ default:
+ // should not go here
+ return false;
+ }
+ }
+ else {
+ if ( myIsRow ) {
+ return mySortOrder == SALOMEDSImpl_AttributeTable::AscendingOrder ?
+ myTable->GetValue( myIndex, idx1 ) < myTable->GetValue( myIndex, idx2 ) :
+ myTable->GetValue( myIndex, idx2 ) < myTable->GetValue( myIndex, idx1 );
+ }
+ else {
+ return mySortOrder == SALOMEDSImpl_AttributeTable::AscendingOrder ?
+ myTable->GetValue( idx1, myIndex ) < myTable->GetValue( idx2, myIndex ) :
+ myTable->GetValue( idx2, myIndex ) < myTable->GetValue( idx1, myIndex );
+ }
+ }
+ }
+};
+
+#endif // _SALOMEDSImpl_AttributeTable_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTableOfInteger.cxx
// Author : Michael Ponikarov
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-#include <sstream>
-using namespace std;
+#include <sstream>
+#include <algorithm>
#define SEPARATOR '\1'
-typedef map<int, int>::const_iterator MI;
+typedef std::map<int, int>::const_iterator MI;
static std::string getUnit(std::string theString)
{
CheckLocked();
Backup();
- map<int, int> aMap;
+ std::map<int, int> aMap;
aMap = myTable;
myTable.clear();
-
for(MI p = aMap.begin(); p != aMap.end(); p++) {
int aRow = (int)(p->first/myNbColumns) + 1;
int aCol = (int)(p->first - myNbColumns*(aRow-1));
}
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
}
void SALOMEDSImpl_AttributeTableOfInteger::SetTitle(const std::string& theTitle)
CheckLocked();
Backup();
myTitle = theTitle;
-
+
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
}
void SALOMEDSImpl_AttributeTableOfInteger::SetRowData(const int theRow,
- const vector<int>& theData)
+ const std::vector<int>& theData)
{
CheckLocked();
if(theData.size() > myNbColumns) SetNbColumns(theData.size());
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetRowData(const int theRow)
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetRowData(const int theRow)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, aShift = (theRow-1)*myNbColumns;
for(i = 1; i <= myNbColumns; i++) {
if(myTable.find(aShift+i) != myTable.end())
{
CheckLocked();
Backup();
- string aTitle(theTitle), aUnit = GetRowUnit(theRow);
+ std::string aTitle(theTitle), aUnit = GetRowUnit(theRow);
if(aUnit.size()>0) {
aTitle += SEPARATOR;
aTitle += aUnit;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const vector<string>& theUnits)
+void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const std::vector<std::string>& theUnits)
{
if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows");
int aLength = theUnits.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfInteger::GetRowUnits()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfInteger::GetRowUnits()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myRows.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(getUnit(myRows[i]));
return aSeq;
}
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitles(const vector<string>& theTitles)
+void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitles(const std::vector<std::string>& theTitles)
{
if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows");
int aLength = theTitles.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfInteger::GetRowTitles()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfInteger::GetRowTitles()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myRows.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(getTitle(myRows[i]));
return aSeq;
}
-
std::string SALOMEDSImpl_AttributeTableOfInteger::GetRowTitle(const int theRow) const
{
return getTitle(myRows[theRow-1]);
}
-
std::string SALOMEDSImpl_AttributeTableOfInteger::GetRowUnit(const int theRow) const
{
return getUnit(myRows[theRow-1]);
}
-
void SALOMEDSImpl_AttributeTableOfInteger::SetColumnData(const int theColumn,
- const vector<int>& theData)
+ const std::vector<int>& theData)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetColumnData(const int theColumn)
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetColumnData(const int theColumn)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, anIndex;
for(i = 1; i <= myNbRows; i++) {
anIndex = myNbColumns*(i-1) + theColumn;
}
void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
+ const std::string& theTitle)
{
CheckLocked();
Backup();
return myCols[theColumn-1];
}
-void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const vector<string>& theTitles)
+void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const std::vector<std::string>& theTitles)
{
if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns");
int aLength = theTitles.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitles()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitles()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myCols.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(myCols[i]);
return aSeq;
const int theColumn)
{
CheckLocked();
+ //Backup();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
int anIndex = (theRow-1)*myNbColumns + theColumn;
const int theColumn)
{
if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
- if(theColumn > myNbColumns || theColumn < 1) DFexception("Invalid cell index");
+ if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
int anIndex = (theRow-1)*myNbColumns + theColumn;
if(myTable.find(anIndex) != myTable.end()) return myTable[anIndex];
return 0;
}
+void SALOMEDSImpl_AttributeTableOfInteger::RemoveValue(const int theRow, const int theColumn)
+{
+ CheckLocked();
+ if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
+ if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
+
+ int anIndex = (theRow-1)*myNbColumns + theColumn;
+ if (myTable.find(anIndex) != myTable.end()) {
+ //Backup();
+ myTable.erase(anIndex);
+ SetModifyFlag(); // table is modified
+ }
+}
+
const std::string& SALOMEDSImpl_AttributeTableOfInteger::ID() const
{
return GetID();
aTable->myCols.push_back(GetColumnTitle(anIndex));
}
-
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetSetRowIndices(const int theRow)
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetSetRowIndices(const int theRow)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, aShift = myNbColumns*(theRow-1);
for(i = 1; i <= myNbColumns; i++) {
return aSeq;
}
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetSetColumnIndices(const int theColumn)
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetSetColumnIndices(const int theColumn)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, anIndex;
for(i = 1; i <= myNbRows; i++) {
return aSeq;
}
-
-string SALOMEDSImpl_AttributeTableOfInteger::Save()
+std::string SALOMEDSImpl_AttributeTableOfInteger::Save()
{
- string aString;
+ std::string aString;
char* buffer = new char[1024];
int i, j, l;
return aString;
}
-
-
-void SALOMEDSImpl_AttributeTableOfInteger::Load(const string& value)
+void SALOMEDSImpl_AttributeTableOfInteger::Load(const std::string& value)
{
- vector<string> v;
+ std::vector<std::string> v;
int i, j, l, pos, aSize = (int)value.size();
for(i = 0, pos = 0; i<aSize; i++) {
if(value[i] == '\n') {
myTable[aKey] = aValue;
}
}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::SortRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theRow > 0 && theRow <= myNbRows ) {
+ std::vector<int> indices( myNbColumns );
+ int cnt = 0;
+ for ( int i = 0; i < myNbColumns; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(theRow, i+1) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfInteger> sorter( this, sortOrder, sortPolicy, theRow, true );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbColumns );
+ cnt = 0;
+ for( int i = 0; i < myNbColumns; i++ )
+ other[i] = HasValue(theRow, i+1) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int col = 0; col < indices.size(); col++ ) {
+ int idx = indices[col];
+ if ( col+1 == idx ) continue;
+ SwapCells(theRow, col+1, theRow, idx);
+ int idx1 = 0;
+ for ( int i = col+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == col+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::SortColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theColumn > 0 && theColumn <= myNbColumns ) {
+ std::vector<int> indices( myNbRows );
+ int cnt = 0;
+ for ( int i = 0; i < myNbRows; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(i+1, theColumn) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfInteger> sorter( this, sortOrder, sortPolicy, theColumn, false );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbRows );
+ cnt = 0;
+ for( int i = 0; i < myNbRows; i++ )
+ other[i] = HasValue(i+1, theColumn) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int row = 0; row < indices.size(); row++ ) {
+ int idx = indices[row];
+ if ( row+1 == idx ) continue;
+ SwapCells(row+1, theColumn, idx, theColumn);
+ int idx1 = 0;
+ for ( int i = row+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == row+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::SortByRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theRow > 0 && theRow <= myNbRows ) {
+ std::vector<int> indices( myNbColumns );
+ int cnt = 0;
+ for ( int i = 0; i < myNbColumns; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(theRow, i+1) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfInteger> sorter( this, sortOrder, sortPolicy, theRow, true );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbColumns );
+ cnt = 0;
+ for( int i = 0; i < myNbColumns; i++ )
+ other[i] = HasValue(theRow, i+1) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int col = 0; col < indices.size(); col++ ) {
+ int idx = indices[col];
+ if ( col+1 == idx ) continue;
+ SwapColumns(col+1, idx);
+ int idx1 = 0;
+ for ( int i = col+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == col+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapColumns()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfInteger::SortByColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theColumn > 0 && theColumn <= myNbColumns ) {
+ std::vector<int> indices( myNbRows );
+ int cnt = 0;
+ for ( int i = 0; i < myNbRows; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(i+1, theColumn) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfInteger> sorter( this, sortOrder, sortPolicy, theColumn, false );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbRows );
+ cnt = 0;
+ for( int i = 0; i < myNbRows; i++ )
+ other[i] = HasValue(i+1, theColumn) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int row = 0; row < indices.size(); row++ ) {
+ int idx = indices[row];
+ if ( row+1 == idx ) continue;
+ SwapRows(row+1, idx);
+ int idx1 = 0;
+ for ( int i = row+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == row+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapRows()
+ }
+ return result;
+}
+
+void SALOMEDSImpl_AttributeTableOfInteger::SwapCells(const int theRow1, const int theColumn1,
+ const int theRow2, const int theColumn2)
+{
+ CheckLocked();
+ if (theRow1 > myNbRows || theRow1 < 1) throw DFexception("Invalid cell index");
+ if (theRow2 > myNbRows || theRow2 < 1) throw DFexception("Invalid cell index");
+ if (theColumn1 > myNbColumns || theColumn1 < 1) throw DFexception("Invalid cell index");
+ if (theColumn2 > myNbColumns || theColumn2 < 1) throw DFexception("Invalid cell index");
+
+ int anIndex1 = (theRow1-1)*myNbColumns + theColumn1;
+ int anIndex2 = (theRow2-1)*myNbColumns + theColumn2;
+
+ bool hasValue1 = myTable.find(anIndex1) != myTable.end();
+ bool hasValue2 = myTable.find(anIndex2) != myTable.end();
+
+ if (!hasValue1 && !hasValue2) return; // nothing changed
+
+ int value1 = hasValue1 ? myTable[anIndex1] : 0;
+ int value2 = hasValue2 ? myTable[anIndex2] : 0;
+
+ if (hasValue1 && hasValue2 && value1 == value2) return; // nothing changed
+
+ if (hasValue1) myTable[anIndex2] = value1;
+ else myTable.erase(anIndex2);
+ if (hasValue2) myTable[anIndex1] = value2;
+ else myTable.erase(anIndex1);
+
+ SetModifyFlag(); // table is modified
+}
+
+void SALOMEDSImpl_AttributeTableOfInteger::SwapRows(const int theRow1, const int theRow2)
+{
+ CheckLocked();
+ for (int i = 1; i <= myNbColumns; i++)
+ SwapCells(theRow1, i, theRow2, i);
+ // swap row titles
+ std::string tmp = myRows[theRow1-1];
+ myRows[theRow1-1] = myRows[theRow2-1];
+ myRows[theRow2-1] = tmp;
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+}
+
+void SALOMEDSImpl_AttributeTableOfInteger::SwapColumns(const int theColumn1, const int theColumn2)
+{
+ CheckLocked();
+ for (int i = 1; i <= myNbRows; i++)
+ SwapCells(i, theColumn1, i, theColumn2);
+ // swap column titles
+ std::string tmp = myCols[theColumn1-1];
+ myCols[theColumn1-1] = myCols[theColumn2-1];
+ myCols[theColumn2-1] = tmp;
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server
// File : SALOMEDSImpl_AttributeTableOfInteger.hxx
// Author : Michael Ponikarov
#include "DF_Attribute.hxx"
#include "DF_Label.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
+#include "SALOMEDSImpl_AttributeTable.hxx"
#include <string>
#include <vector>
class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfInteger :
- public SALOMEDSImpl_GenericAttribute
+ public SALOMEDSImpl_GenericAttribute, public SALOMEDSImpl_AttributeTable
{
public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label) ;
+ virtual std::string Save();
+ virtual void Load(const std::string&);
+
+ static const std::string& GetID();
+ static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label);
+
SALOMEDSImpl_AttributeTableOfInteger();
- void SetNbColumns(const int theNbColumns);
- void SetTitle(const std::string& theTitle) ;
- std::string GetTitle() const;
- void SetRowData(const int theRow,const std::vector<int>& theData) ;
- std::vector<int> GetRowData(const int theRow) ;
- void SetRowTitle(const int theRow,const std::string& theTitle) ;
- void SetRowUnit(const int theRow,const std::string& theUnit) ;
- std::string GetRowUnit(const int theRow) const;
- void SetRowUnits(const std::vector<std::string>& theUnits) ;
+
+ void SetNbColumns(const int theNbColumns);
+ void SetTitle(const std::string& theTitle);
+ std::string GetTitle() const;
+ void SetRowData(const int theRow, const std::vector<int>& theData);
+ std::vector<int> GetRowData(const int theRow);
+ void SetRowTitle(const int theRow, const std::string& theTitle);
+ void SetRowUnit(const int theRow, const std::string& theUnit);
+ std::string GetRowUnit(const int theRow) const;
+ void SetRowUnits(const std::vector<std::string>& theUnits);
std::vector<std::string> GetRowUnits();
- void SetRowTitles(const std::vector<std::string>& theTitles) ;
+ void SetRowTitles(const std::vector<std::string>& theTitles);
std::vector<std::string> GetRowTitles();
- std::string GetRowTitle(const int theRow) const;
- void SetColumnData(const int theColumn,const std::vector<int>& theData) ;
- std::vector<int> GetColumnData(const int theColumn) ;
- void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
- std::string GetColumnTitle(const int theColumn) const;
- void SetColumnTitles(const std::vector<std::string>& theTitles);
+ std::string GetRowTitle(const int theRow) const;
+ void SetColumnData(const int theColumn, const std::vector<int>& theData);
+ std::vector<int> GetColumnData(const int theColumn);
+ void SetColumnTitle(const int theColumn, const std::string& theTitle);
+ std::string GetColumnTitle(const int theColumn) const;
+ void SetColumnTitles(const std::vector<std::string>& theTitles);
std::vector<std::string> GetColumnTitles();
- int GetNbRows() const;
- int GetNbColumns() const;
+ int GetNbRows() const;
+ int GetNbColumns() const;
+
+ void PutValue(const int theValue, const int theRow, const int theColumn);
+ bool HasValue(const int theRow, const int theColumn);
+ int GetValue(const int theRow, const int theColumn);
+ void RemoveValue(const int theRow, const int theColumn);
+ const std::string& ID() const;
+ void Restore(DF_Attribute* with);
+ DF_Attribute* NewEmpty() const;
+ void Paste(DF_Attribute* into);
- void PutValue(const int theValue,const int theRow,const int theColumn) ;
- bool HasValue(const int theRow,const int theColumn) ;
- int GetValue(const int theRow,const int theColumn) ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
+ std::vector<int> GetSetRowIndices(const int theRow);
+ std::vector<int> GetSetColumnIndices(const int theColumn);
- std::vector<int> GetSetRowIndices(const int theRow);
- std::vector<int> GetSetColumnIndices(const int theColumn);
+ std::vector<int> SortRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortByRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortByColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy);
+
+ void SwapCells(const int theRow1, const int theColumn1, const int theRow2, const int theColumn2);
+ void SwapRows(const int theRow1, const int theRow2);
+ void SwapColumns(const int theColumn1, const int theColumn2);
~SALOMEDSImpl_AttributeTableOfInteger() {}
private:
-
- std::map<int, int> myTable;
- std::string myTitle;
+ std::map<int, int> myTable;
+ std::string myTitle;
std::vector<std::string> myRows;
std::vector<std::string> myCols;
- int myNbRows;
- int myNbColumns;
-
+ int myNbRows;
+ int myNbColumns;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTableOfReal.cxx
// Author : Michael Ponikarov
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-#include <stdio.h>
-#include <sstream>
-using namespace std;
+#include <sstream>
+#include <algorithm>
#define SEPARATOR '\1'
+typedef std::map<int, double>::const_iterator MI;
-typedef map<int, double>::const_iterator MI;
-
-static std::string getUnit(std::string theString)
+static std::string getUnit(const std::string& theString)
{
std::string aString(theString);
int aPos = aString.find(SEPARATOR);
- if(aPos <= 0 || aPos == aString.size() ) return std::string();
- return aString.substr(aPos+1, aString.size());
+ return aPos < 0 || aPos == aString.size()-1 ? std::string() : aString.substr(aPos+1, aString.size());
}
-static std::string getTitle(std::string theString)
+static std::string getTitle(const std::string& theString)
{
std::string aString(theString);
int aPos = aString.find(SEPARATOR);
- if(aPos < 0) return aString;
- if(aPos == 0) return std::string();
- return aString.substr(0, aPos);
+ return aPos < 0 ? aString :aString.substr(0, aPos);
}
const std::string& SALOMEDSImpl_AttributeTableOfReal::GetID()
CheckLocked();
Backup();
- map<int, double> aMap;
+ std::map<int, double> aMap;
aMap = myTable;
myTable.clear();
myNbColumns = theNbColumns;
while (myCols.size() < myNbColumns) { // append empty columns titles
- myCols.push_back(string(""));
+ myCols.push_back(std::string(""));
}
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
void SALOMEDSImpl_AttributeTableOfReal::SetRowData(const int theRow,
- const vector<double>& theData)
+ const std::vector<double>& theData)
{
CheckLocked();
if(theData.size() > myNbColumns) SetNbColumns(theData.size());
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<double> SALOMEDSImpl_AttributeTableOfReal::GetRowData(const int theRow)
+std::vector<double> SALOMEDSImpl_AttributeTableOfReal::GetRowData(const int theRow)
{
- vector<double> aSeq;
+ std::vector<double> aSeq;
int i, aShift = (theRow-1)*myNbColumns;
for(i = 1; i <= myNbColumns; i++) {
if(myTable.find(aShift+i) != myTable.end())
return aSeq;
}
-
void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const int theRow,
const std::string& theTitle)
{
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const vector<string>& theUnits)
+void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const std::vector<std::string>& theUnits)
{
if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows");
int aLength = theUnits.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfReal::GetRowUnits()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfReal::GetRowUnits()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myRows.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(getUnit(myRows[i]));
return aSeq;
}
-void SALOMEDSImpl_AttributeTableOfReal::SetRowTitles(const vector<string>& theTitles)
+void SALOMEDSImpl_AttributeTableOfReal::SetRowTitles(const std::vector<std::string>& theTitles)
{
if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows");
int aLength = theTitles.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfReal::GetRowTitles()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfReal::GetRowTitles()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myRows.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(getTitle(myRows[i]));
return aSeq;
}
-
std::string SALOMEDSImpl_AttributeTableOfReal::GetRowTitle(const int theRow) const
{
return getTitle(myRows[theRow-1]);
}
void SALOMEDSImpl_AttributeTableOfReal::SetColumnData(const int theColumn,
- const vector<double>& theData)
+ const std::vector<double>& theData)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
if(aLength > myNbRows) {
myNbRows = aLength;
while (myRows.size() < myNbRows) { // append empty row titles
- myRows.push_back(string(""));
+ myRows.push_back(std::string(""));
}
}
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-
-vector<double> SALOMEDSImpl_AttributeTableOfReal::GetColumnData(const int theColumn)
+std::vector<double> SALOMEDSImpl_AttributeTableOfReal::GetColumnData(const int theColumn)
{
- vector<double> aSeq;
+ std::vector<double> aSeq;
int i, anIndex;
for(i = 1; i <= myNbRows; i++) {
return myCols[theColumn-1];
}
-void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const vector<string>& theTitles)
+void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const std::vector<std::string>& theTitles)
{
if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns");
int aLength = theTitles.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfReal::GetColumnTitles()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfReal::GetColumnTitles()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myCols.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(myCols[i]);
return aSeq;
const int theColumn)
{
CheckLocked();
+ //Backup();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
int anIndex = (theRow-1)*myNbColumns + theColumn;
return 0.;
}
+void SALOMEDSImpl_AttributeTableOfReal::RemoveValue(const int theRow, const int theColumn)
+{
+ CheckLocked();
+ if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
+ if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
+
+ int anIndex = (theRow-1)*myNbColumns + theColumn;
+ if (myTable.find(anIndex) != myTable.end()) {
+ //Backup();
+ myTable.erase(anIndex);
+ SetModifyFlag(); // table is modified
+ }
+}
+
const std::string& SALOMEDSImpl_AttributeTableOfReal::ID() const
{
return GetID();
aTable->myCols.push_back(GetColumnTitle(anIndex));
}
-
-vector<int> SALOMEDSImpl_AttributeTableOfReal::GetSetRowIndices(const int theRow)
+std::vector<int> SALOMEDSImpl_AttributeTableOfReal::GetSetRowIndices(const int theRow)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, aShift = myNbColumns*(theRow-1);
for(i = 1; i <= myNbColumns; i++) {
return aSeq;
}
-vector<int> SALOMEDSImpl_AttributeTableOfReal::GetSetColumnIndices(const int theColumn)
+std::vector<int> SALOMEDSImpl_AttributeTableOfReal::GetSetColumnIndices(const int theColumn)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, anIndex;
for(i = 1; i <= myNbRows; i++) {
return aSeq;
}
-string SALOMEDSImpl_AttributeTableOfReal::Save()
+std::string SALOMEDSImpl_AttributeTableOfReal::Save()
{
- string aString;
+ std::string aString;
char* buffer = new char[1024];
int i, j, l;
return aString;
}
-void SALOMEDSImpl_AttributeTableOfReal::Load(const string& value)
+void SALOMEDSImpl_AttributeTableOfReal::Load(const std::string& value)
{
- vector<string> v;
+ std::vector<std::string> v;
int i, j, l, pos, aSize = (int)value.size();
for(i = 0, pos = 0; i<aSize; i++) {
if(value[i] == '\n') {
}
}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfReal::SortRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theRow > 0 && theRow <= myNbRows ) {
+ std::vector<int> indices( myNbColumns );
+ int cnt = 0;
+ for ( int i = 0; i < myNbColumns; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(theRow, i+1) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfReal> sorter( this, sortOrder, sortPolicy, theRow, true );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbColumns );
+ cnt = 0;
+ for( int i = 0; i < myNbColumns; i++ )
+ other[i] = HasValue(theRow, i+1) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int col = 0; col < indices.size(); col++ ) {
+ int idx = indices[col];
+ if ( col+1 == idx ) continue;
+ SwapCells(theRow, col+1, theRow, idx);
+ int idx1 = 0;
+ for ( int i = col+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == col+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfReal::SortColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theColumn > 0 && theColumn <= myNbColumns ) {
+ std::vector<int> indices( myNbRows );
+ int cnt = 0;
+ for ( int i = 0; i < myNbRows; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(i+1, theColumn) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfReal> sorter( this, sortOrder, sortPolicy, theColumn, false );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbRows );
+ cnt = 0;
+ for( int i = 0; i < myNbRows; i++ )
+ other[i] = HasValue(i+1, theColumn) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int row = 0; row < indices.size(); row++ ) {
+ int idx = indices[row];
+ if ( row+1 == idx ) continue;
+ SwapCells(row+1, theColumn, idx, theColumn);
+ int idx1 = 0;
+ for ( int i = row+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == row+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfReal::SortByRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theRow > 0 && theRow <= myNbRows ) {
+ std::vector<int> indices( myNbColumns );
+ int cnt = 0;
+ for ( int i = 0; i < myNbColumns; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(theRow, i+1) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfReal> sorter( this, sortOrder, sortPolicy, theRow, true );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbColumns );
+ cnt = 0;
+ for( int i = 0; i < myNbColumns; i++ )
+ other[i] = HasValue(theRow, i+1) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int col = 0; col < indices.size(); col++ ) {
+ int idx = indices[col];
+ if ( col+1 == idx ) continue;
+ SwapColumns(col+1, idx);
+ int idx1 = 0;
+ for ( int i = col+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == col+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapColumns()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfReal::SortByColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theColumn > 0 && theColumn <= myNbColumns ) {
+ std::vector<int> indices( myNbRows );
+ int cnt = 0;
+ for ( int i = 0; i < myNbRows; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(i+1, theColumn) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfReal> sorter( this, sortOrder, sortPolicy, theColumn, false );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbRows );
+ cnt = 0;
+ for( int i = 0; i < myNbRows; i++ )
+ other[i] = HasValue(i+1, theColumn) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int row = 0; row < indices.size(); row++ ) {
+ int idx = indices[row];
+ if ( row+1 == idx ) continue;
+ SwapRows(row+1, idx);
+ int idx1 = 0;
+ for ( int i = row+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == row+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapRows()
+ }
+ return result;
+}
+
+void SALOMEDSImpl_AttributeTableOfReal::SwapCells(const int theRow1, const int theColumn1,
+ const int theRow2, const int theColumn2)
+{
+ CheckLocked();
+ if (theRow1 > myNbRows || theRow1 < 1) throw DFexception("Invalid cell index");
+ if (theRow2 > myNbRows || theRow2 < 1) throw DFexception("Invalid cell index");
+ if (theColumn1 > myNbColumns || theColumn1 < 1) throw DFexception("Invalid cell index");
+ if (theColumn2 > myNbColumns || theColumn2 < 1) throw DFexception("Invalid cell index");
+
+ int anIndex1 = (theRow1-1)*myNbColumns + theColumn1;
+ int anIndex2 = (theRow2-1)*myNbColumns + theColumn2;
+
+ bool hasValue1 = myTable.find(anIndex1) != myTable.end();
+ bool hasValue2 = myTable.find(anIndex2) != myTable.end();
+
+ if (!hasValue1 && !hasValue2) return; // nothing changed
+
+ double value1 = hasValue1 ? myTable[anIndex1] : 0;
+ double value2 = hasValue2 ? myTable[anIndex2] : 0;
+
+ if (hasValue1 && hasValue2 && value1 == value2) return; // nothing changed
+
+ if (hasValue1) myTable[anIndex2] = value1;
+ else myTable.erase(anIndex2);
+ if (hasValue2) myTable[anIndex1] = value2;
+ else myTable.erase(anIndex1);
+
+ SetModifyFlag(); // table is modified
+}
+
+void SALOMEDSImpl_AttributeTableOfReal::SwapRows(const int theRow1, const int theRow2)
+{
+ CheckLocked();
+ for (int i = 1; i <= myNbColumns; i++)
+ SwapCells(theRow1, i, theRow2, i);
+ // swap row titles
+ std::string tmp = myRows[theRow1-1];
+ myRows[theRow1-1] = myRows[theRow2-1];
+ myRows[theRow2-1] = tmp;
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+}
+
+void SALOMEDSImpl_AttributeTableOfReal::SwapColumns(const int theColumn1, const int theColumn2)
+{
+ CheckLocked();
+ for (int i = 1; i <= myNbRows; i++)
+ SwapCells(i, theColumn1, i, theColumn2);
+ // swap column titles
+ std::string tmp = myCols[theColumn1-1];
+ myCols[theColumn1-1] = myCols[theColumn2-1];
+ myCols[theColumn2-1] = tmp;
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server
// File : SALOMEDSImpl_AttributeTableOfReal.hxx
// Author : Michael Ponikarov
#include "DF_Attribute.hxx"
#include "DF_Label.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
+#include "SALOMEDSImpl_AttributeTable.hxx"
#include <string>
#include <vector>
#include <map>
class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfReal :
- public SALOMEDSImpl_GenericAttribute
+ public SALOMEDSImpl_GenericAttribute, public SALOMEDSImpl_AttributeTable
{
public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ;
+ virtual std::string Save();
+ virtual void Load(const std::string&);
+
+ static const std::string& GetID();
+ static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label);
+
SALOMEDSImpl_AttributeTableOfReal();
- void SetNbColumns(const int theNbColumns);
- void SetTitle(const std::string& theTitle) ;
- std::string GetTitle() const;
- void SetRowData(const int theRow,const std::vector<double>& theData) ;
- std::vector<double> GetRowData(const int theRow) ;
- void SetRowTitle(const int theRow,const std::string& theTitle) ;
- void SetRowUnit(const int theRow,const std::string& theUnit) ;
- std::string GetRowUnit(const int theRow) const;
- void SetRowUnits(const std::vector<std::string>& theUnits) ;
+
+ void SetNbColumns(const int theNbColumns);
+ void SetTitle(const std::string& theTitle);
+ std::string GetTitle() const;
+ void SetRowData(const int theRow, const std::vector<double>& theData);
+ std::vector<double> GetRowData(const int theRow);
+ void SetRowTitle(const int theRow, const std::string& theTitle);
+ void SetRowUnit(const int theRow, const std::string& theUnit);
+ std::string GetRowUnit(const int theRow) const;
+ void SetRowUnits(const std::vector<std::string>& theUnits);
std::vector<std::string> GetRowUnits();
- void SetRowTitles(const std::vector<std::string>& theTitles) ;
+ void SetRowTitles(const std::vector<std::string>& theTitles);
std::vector<std::string> GetRowTitles();
- std::string GetRowTitle(const int theRow) const;
- void SetColumnData(const int theColumn,const std::vector<double>& theData) ;
- std::vector<double> GetColumnData(const int theColumn) ;
- void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
- void SetColumnTitles(const std::vector<std::string>& theTitles);
+ std::string GetRowTitle(const int theRow) const;
+ void SetColumnData(const int theColumn, const std::vector<double>& theData);
+ std::vector<double> GetColumnData(const int theColumn);
+ void SetColumnTitle(const int theColumn, const std::string& theTitle);
+ void SetColumnTitles(const std::vector<std::string>& theTitles);
std::vector<std::string> GetColumnTitles();
- std::string GetColumnTitle(const int theColumn) const;
- int GetNbRows() const;
- int GetNbColumns() const;
+ std::string GetColumnTitle(const int theColumn) const;
+ int GetNbRows() const;
+ int GetNbColumns() const;
- void PutValue(const double& theValue,const int theRow,const int theColumn) ;
- bool HasValue(const int theRow,const int theColumn) ;
- double GetValue(const int theRow,const int theColumn) ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
+ void PutValue(const double& theValue, const int theRow, const int theColumn);
+ bool HasValue(const int theRow, const int theColumn);
+ double GetValue(const int theRow, const int theColumn);
+ void RemoveValue(const int theRow, const int theColumn);
+ const std::string& ID() const;
+ void Restore(DF_Attribute* with);
+ DF_Attribute* NewEmpty() const;
+ void Paste(DF_Attribute* into);
- std::vector<int> GetSetRowIndices(const int theRow);
- std::vector<int> GetSetColumnIndices(const int theColumn);
+ std::vector<int> GetSetRowIndices(const int theRow);
+ std::vector<int> GetSetColumnIndices(const int theColumn);
+
+ std::vector<int> SortRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortByRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortByColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy);
+
+ void SwapCells(const int theRow1, const int theColumn1, const int theRow2, const int theColumn2);
+ void SwapRows(const int theRow1, const int theRow2);
+ void SwapColumns(const int theColumn1, const int theColumn2);
~SALOMEDSImpl_AttributeTableOfReal() {}
private:
- std::map<int, double> myTable;
- std::string myTitle;
+ std::map<int, double> myTable;
+ std::string myTitle;
std::vector<std::string> myRows;
std::vector<std::string> myCols;
- int myNbRows;
- int myNbColumns;
-
+ int myNbRows;
+ int myNbColumns;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTableOfString.cxx
// Author : Sergey Ruin
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sstream>
-using namespace std;
+#include <sstream>
+#include <algorithm>
#define SEPARATOR '\1'
-
-typedef map<int, string>::const_iterator MI;
+typedef std::map<int, std::string>::const_iterator MI;
static std::string getUnit(std::string theString)
{
CheckLocked();
Backup();
- map<int, string> aMap;
+ std::map<int, std::string> aMap;
aMap = myTable;
myTable.clear();
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-void SALOMEDSImpl_AttributeTableOfString::SetRowUnits(const vector<string>& theUnits)
+void SALOMEDSImpl_AttributeTableOfString::SetRowUnits(const std::vector<std::string>& theUnits)
{
if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows");
int aLength = theUnits.size(), i;
for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]);
}
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetRowUnits()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfString::GetRowUnits()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myRows.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(getUnit(myRows[i]));
return aSeq;
}
-void SALOMEDSImpl_AttributeTableOfString::SetRowTitles(const vector<string>& theTitles)
+void SALOMEDSImpl_AttributeTableOfString::SetRowTitles(const std::vector<std::string>& theTitles)
{
if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows");
int aLength = theTitles.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetRowTitles()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfString::GetRowTitles()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myRows.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(getTitle(myRows[i]));
return aSeq;
}
-
std::string SALOMEDSImpl_AttributeTableOfString::GetRowTitle(const int theRow) const
{
return getTitle(myRows[theRow-1]);
}
-
std::string SALOMEDSImpl_AttributeTableOfString::GetRowUnit(const int theRow) const
{
return getUnit(myRows[theRow-1]);
}
void SALOMEDSImpl_AttributeTableOfString::SetRowData(const int theRow,
- const vector<string>& theData)
+ const std::vector<std::string>& theData)
{
CheckLocked();
if(theData.size() > myNbColumns) SetNbColumns(theData.size());
return myTitle;
}
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetRowData(const int theRow)
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfString::GetRowData(const int theRow)
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int i, aShift = (theRow-1)*myNbColumns;
for(i = 1; i <= myNbColumns; i++) {
if(myTable.find(aShift+i) != myTable.end())
}
void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const int theColumn,
- const vector<string>& theData)
+ const std::vector<std::string>& theData)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetColumnData(const int theColumn)
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfString::GetColumnData(const int theColumn)
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int i, anIndex;
for(i = 1; i <= myNbRows; i++) {
return myCols[theColumn-1];
}
-
-void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const vector<string>& theTitles)
+void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const std::vector<std::string>& theTitles)
{
if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns");
int aLength = theTitles.size(), i;
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetColumnTitles()
+std::vector<std::string> SALOMEDSImpl_AttributeTableOfString::GetColumnTitles()
{
- vector<string> aSeq;
+ std::vector<std::string> aSeq;
int aLength = myCols.size(), i;
for(i=0; i<aLength; i++) aSeq.push_back(myCols[i]);
return aSeq;
}
-
int SALOMEDSImpl_AttributeTableOfString::GetNbRows() const
{
return myNbRows;
const int theColumn)
{
CheckLocked();
+ //Backup();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
int anIndex = (theRow-1)*myNbColumns + theColumn;
return "";
}
+void SALOMEDSImpl_AttributeTableOfString::RemoveValue(const int theRow, const int theColumn)
+{
+ CheckLocked();
+ if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
+ if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
+
+ int anIndex = (theRow-1)*myNbColumns + theColumn;
+ if (myTable.find(anIndex) != myTable.end()) {
+ //Backup();
+ myTable.erase(anIndex);
+ SetModifyFlag(); // table is modified
+ }
+}
+
const std::string& SALOMEDSImpl_AttributeTableOfString::ID() const
{
return GetID();
aTable->myCols.push_back(GetColumnTitle(anIndex));
}
-
-vector<int> SALOMEDSImpl_AttributeTableOfString::GetSetRowIndices(const int theRow)
+std::vector<int> SALOMEDSImpl_AttributeTableOfString::GetSetRowIndices(const int theRow)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, aShift = myNbColumns*(theRow-1);
for(i = 1; i <= myNbColumns; i++) {
return aSeq;
}
-vector<int> SALOMEDSImpl_AttributeTableOfString::GetSetColumnIndices(const int theColumn)
+std::vector<int> SALOMEDSImpl_AttributeTableOfString::GetSetColumnIndices(const int theColumn)
{
- vector<int> aSeq;
+ std::vector<int> aSeq;
int i, anIndex;
for(i = 1; i <= myNbRows; i++) {
return aSeq;
}
-
-
-string SALOMEDSImpl_AttributeTableOfString::Save()
+std::string SALOMEDSImpl_AttributeTableOfString::Save()
{
- string aString;
+ std::string aString;
char* buffer = new char[1024];
int i, j, l;
return aString;
}
-void SALOMEDSImpl_AttributeTableOfString::Load(const string& value)
+void SALOMEDSImpl_AttributeTableOfString::Load(const std::string& value)
{
- vector<string> v;
+ std::vector<std::string> v;
int i, j, l, pos, aSize = (int)value.size();
for(i = 0, pos = 0; i<aSize; i++) {
if(value[i] == '\n') {
for(i=1; i<=l; i++) {
aStr = v[pos++]; //Ket as a string
int aKey = strtol(aStr.c_str(), NULL, 10);
- string aValue;
+ std::string aValue;
if(aStr[0] == '0') //If the first character of the key is 0, then empty value
aValue = "";
else {
myTable[aKey] = aValue;
}
}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfString::SortRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theRow > 0 && theRow <= myNbRows ) {
+ std::vector<int> indices( myNbColumns );
+ int cnt = 0;
+ for ( int i = 0; i < myNbColumns; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(theRow, i+1) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfString> sorter( this, sortOrder, sortPolicy, theRow, true );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbColumns );
+ cnt = 0;
+ for( int i = 0; i < myNbColumns; i++ )
+ other[i] = HasValue(theRow, i+1) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int col = 0; col < indices.size(); col++ ) {
+ int idx = indices[col];
+ if ( col+1 == idx ) continue;
+ SwapCells(theRow, col+1, theRow, idx);
+ int idx1 = 0;
+ for ( int i = col+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == col+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfString::SortColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theColumn > 0 && theColumn <= myNbColumns ) {
+ std::vector<int> indices( myNbRows );
+ int cnt = 0;
+ for ( int i = 0; i < myNbRows; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(i+1, theColumn) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfString> sorter( this, sortOrder, sortPolicy, theColumn, false );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbRows );
+ cnt = 0;
+ for( int i = 0; i < myNbRows; i++ )
+ other[i] = HasValue(i+1, theColumn) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int row = 0; row < indices.size(); row++ ) {
+ int idx = indices[row];
+ if ( row+1 == idx ) continue;
+ SwapCells(row+1, theColumn, idx, theColumn);
+ int idx1 = 0;
+ for ( int i = row+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == row+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfString::SortByRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theRow > 0 && theRow <= myNbRows ) {
+ std::vector<int> indices( myNbColumns );
+ int cnt = 0;
+ for ( int i = 0; i < myNbColumns; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(theRow, i+1) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfString> sorter( this, sortOrder, sortPolicy, theRow, true );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbColumns );
+ cnt = 0;
+ for( int i = 0; i < myNbColumns; i++ )
+ other[i] = HasValue(theRow, i+1) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int col = 0; col < indices.size(); col++ ) {
+ int idx = indices[col];
+ if ( col+1 == idx ) continue;
+ SwapColumns(col+1, idx);
+ int idx1 = 0;
+ for ( int i = col+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == col+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapColumns()
+ }
+ return result;
+}
+
+std::vector<int> SALOMEDSImpl_AttributeTableOfString::SortByColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy )
+{
+ CheckLocked();
+ std::vector<int> result;
+ if ( theColumn > 0 && theColumn <= myNbColumns ) {
+ std::vector<int> indices( myNbRows );
+ int cnt = 0;
+ for ( int i = 0; i < myNbRows; i++ ) {
+ if ( sortPolicy != EmptyIgnore || HasValue(i+1, theColumn) ) {
+ indices[cnt++] = i+1;
+ }
+ }
+ indices.resize(cnt);
+
+ TableSorter<SALOMEDSImpl_AttributeTableOfString> sorter( this, sortOrder, sortPolicy, theColumn, false );
+ std::stable_sort( indices.begin(), indices.end(), sorter );
+
+ if ( sortPolicy == EmptyIgnore ) {
+ std::vector<int> other( myNbRows );
+ cnt = 0;
+ for( int i = 0; i < myNbRows; i++ )
+ other[i] = HasValue(i+1, theColumn) ? indices[cnt++] : i+1;
+ indices = other;
+ }
+ result = indices;
+
+ for ( int row = 0; row < indices.size(); row++ ) {
+ int idx = indices[row];
+ if ( row+1 == idx ) continue;
+ SwapRows(row+1, idx);
+ int idx1 = 0;
+ for ( int i = row+1; i < indices.size() && idx1 == 0; i++)
+ if ( indices[i] == row+1 ) idx1 = i;
+ indices[idx1] = idx;
+ }
+ // no need for SetModifyFlag(), since it is done by SwapRows()
+ }
+ return result;
+}
+
+void SALOMEDSImpl_AttributeTableOfString::SwapCells(const int theRow1, const int theColumn1,
+ const int theRow2, const int theColumn2)
+{
+ CheckLocked();
+ if (theRow1 > myNbRows || theRow1 < 1) throw DFexception("Invalid cell index");
+ if (theRow2 > myNbRows || theRow2 < 1) throw DFexception("Invalid cell index");
+ if (theColumn1 > myNbColumns || theColumn1 < 1) throw DFexception("Invalid cell index");
+ if (theColumn2 > myNbColumns || theColumn2 < 1) throw DFexception("Invalid cell index");
+
+ int anIndex1 = (theRow1-1)*myNbColumns + theColumn1;
+ int anIndex2 = (theRow2-1)*myNbColumns + theColumn2;
+
+ bool hasValue1 = myTable.find(anIndex1) != myTable.end();
+ bool hasValue2 = myTable.find(anIndex2) != myTable.end();
+
+ if (!hasValue1 && !hasValue2) return; // nothing changed
+
+ std::string value1 = hasValue1 ? myTable[anIndex1] : 0;
+ std::string value2 = hasValue2 ? myTable[anIndex2] : 0;
+
+ if (hasValue1 && hasValue2 && value1 == value2) return; // nothing changed
+
+ if (hasValue1) myTable[anIndex2] = value1;
+ else myTable.erase(anIndex2);
+ if (hasValue2) myTable[anIndex1] = value2;
+ else myTable.erase(anIndex1);
+
+ SetModifyFlag(); // table is modified
+}
+
+void SALOMEDSImpl_AttributeTableOfString::SwapRows(const int theRow1, const int theRow2)
+{
+ CheckLocked();
+ for (int i = 1; i <= myNbColumns; i++)
+ SwapCells(theRow1, i, theRow2, i);
+ // swap row titles
+ std::string tmp = myRows[theRow1-1];
+ myRows[theRow1-1] = myRows[theRow2-1];
+ myRows[theRow2-1] = tmp;
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+}
+
+void SALOMEDSImpl_AttributeTableOfString::SwapColumns(const int theColumn1, const int theColumn2)
+{
+ CheckLocked();
+ for (int i = 1; i <= myNbRows; i++)
+ SwapCells(i, theColumn1, i, theColumn2);
+ // swap column titles
+ std::string tmp = myCols[theColumn1-1];
+ myCols[theColumn1-1] = myCols[theColumn2-1];
+ myCols[theColumn2-1] = tmp;
+ // no need for SetModifyFlag(), since it is done by SwapCells()
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server
// File : SALOMEDSImpl_AttributeTableOfString.hxx
// Author : Sergey Ruin
#include "DF_Label.hxx"
#include "DF_Attribute.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
+#include "SALOMEDSImpl_AttributeTable.hxx"
#include <string>
#include <vector>
#include <map>
class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfString :
- public SALOMEDSImpl_GenericAttribute
+ public SALOMEDSImpl_GenericAttribute, public SALOMEDSImpl_AttributeTable
{
public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label) ;
+ virtual std::string Save();
+ virtual void Load(const std::string&);
+
+ static const std::string& GetID();
+ static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label);
+
SALOMEDSImpl_AttributeTableOfString();
- void SetNbColumns(const int theNbColumns);
- void SetTitle(const std::string& theTitle) ;
- std::string GetTitle() const;
- void SetRowData(const int theRow,const std::vector<std::string>& theData) ;
- std::vector<std::string> GetRowData(const int theRow) ;
- void SetRowTitle(const int theRow,const std::string& theTitle) ;
- void SetRowUnit(const int theRow,const std::string& theUnit) ;
- std::string GetRowUnit(const int theRow) const;
- void SetRowUnits(const std::vector<std::string>& theUnits) ;
+ void SetNbColumns(const int theNbColumns);
+ void SetTitle(const std::string& theTitle);
+ std::string GetTitle() const;
+ void SetRowData(const int theRow, const std::vector<std::string>& theData);
+ std::vector<std::string> GetRowData(const int theRow);
+ void SetRowTitle(const int theRow, const std::string& theTitle);
+ void SetRowUnit(const int theRow, const std::string& theUnit);
+ std::string GetRowUnit(const int theRow) const;
+ void SetRowUnits(const std::vector<std::string>& theUnits);
std::vector<std::string> GetRowUnits();
- void SetRowTitles(const std::vector<std::string>& theTitles) ;
+ void SetRowTitles(const std::vector<std::string>& theTitles);
std::vector<std::string> GetRowTitles();
- std::string GetRowTitle(const int theRow) const;
- void SetColumnData(const int theColumn,const std::vector<std::string>& theData) ;
- std::vector<std::string> GetColumnData(const int theColumn) ;
- void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
- std::string GetColumnTitle(const int theColumn) const;
- void SetColumnTitles(const std::vector<std::string>& theTitles);
+ std::string GetRowTitle(const int theRow) const;
+ void SetColumnData(const int theColumn, const std::vector<std::string>& theData);
+ std::vector<std::string> GetColumnData(const int theColumn);
+ void SetColumnTitle(const int theColumn, const std::string& theTitle);
+ std::string GetColumnTitle(const int theColumn) const;
+ void SetColumnTitles(const std::vector<std::string>& theTitles);
std::vector<std::string> GetColumnTitles();
- int GetNbRows() const;
- int GetNbColumns() const;
+ int GetNbRows() const;
+ int GetNbColumns() const;
+
+ void PutValue(const std::string& theValue, const int theRow, const int theColumn);
+ bool HasValue(const int theRow, const int theColumn);
+ std::string GetValue(const int theRow, const int theColumn);
+ void RemoveValue(const int theRow, const int theColumn);
+ const std::string& ID() const;
+ void Restore(DF_Attribute* with);
+ DF_Attribute* NewEmpty() const;
+ void Paste(DF_Attribute* into);
- void PutValue(const std::string& theValue,const int theRow,const int theColumn) ;
- bool HasValue(const int theRow,const int theColumn) ;
- std::string GetValue(const int theRow,const int theColumn) ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
+ std::vector<int> GetSetRowIndices(const int theRow);
+ std::vector<int> GetSetColumnIndices(const int theColumn);
- std::vector<int> GetSetRowIndices(const int theRow);
- std::vector<int> GetSetColumnIndices(const int theColumn);
+ std::vector<int> SortRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortByRow(const int theRow, SortOrder sortOrder, SortPolicy sortPolicy);
+ std::vector<int> SortByColumn(const int theColumn, SortOrder sortOrder, SortPolicy sortPolicy);
+
+ void SwapCells(const int theRow1, const int theColumn1, const int theRow2, const int theColumn2);
+ void SwapRows(const int theRow1, const int theRow2);
+ void SwapColumns(const int theColumn1, const int theColumn2);
~SALOMEDSImpl_AttributeTableOfString() {}
private:
-
std::map<int, std::string> myTable;
- std::string myTitle;
- std::vector<std::string> myRows;
- std::vector<std::string> myCols;
- int myNbRows;
- int myNbColumns;
-
+ std::string myTitle;
+ std::vector<std::string> myRows;
+ std::vector<std::string> myCols;
+ int myNbRows;
+ int myNbColumns;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTarget.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeReference.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
-
//=======================================================================
//function : GetID
//purpose :
//function : Get
//purpose :
//=======================================================================
-vector<SALOMEDSImpl_SObject> SALOMEDSImpl_AttributeTarget::Get()
+std::vector<SALOMEDSImpl_SObject> SALOMEDSImpl_AttributeTarget::Get()
{
- vector<SALOMEDSImpl_SObject> aSeq;
+ std::vector<SALOMEDSImpl_SObject> aSeq;
for(int i = 0, len = myVariables.size(); i<len; i++)
aSeq.push_back( SALOMEDSImpl_Study::SObject(myVariables[i]->Label()));
Backup();
DF_Label aRefLabel = theSO.GetLabel();
- vector<DF_Attribute*> va;
+ std::vector<DF_Attribute*> va;
for(int i = 0, len = myVariables.size(); i<len; i++) {
DF_Label L = myVariables[i]->Label();
if(myVariables[i]->Label() == aRefLabel) continue;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTarget.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTextColor.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeTextColor.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//function : TextColor
//purpose :
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeTextColor::TextColor()
+std::vector<double> SALOMEDSImpl_AttributeTextColor::TextColor()
{
return myValue;
}
//function : ChangeArray
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeTextColor::ChangeArray(const vector<double>& newArray)
+void SALOMEDSImpl_AttributeTextColor::ChangeArray(const std::vector<double>& newArray)
{
Backup();
-string SALOMEDSImpl_AttributeTextColor::Save()
+std::string SALOMEDSImpl_AttributeTextColor::Save()
{
char *Val = new char[75];
sprintf(Val, "%f %f %f", (float)myValue[0],
(float)myValue[1],
(float)myValue[2]);
- string ret(Val);
+ std::string ret(Val);
delete Val;
return ret;
}
-void SALOMEDSImpl_AttributeTextColor::Load(const string& value)
+void SALOMEDSImpl_AttributeTextColor::Load(const std::string& value)
{
float r, g, b;
sscanf(value.c_str(), "%f %f %f", &r, &g, &b);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTextColor.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTextHighlightColor.cxx
// Author : Sergey RUIN
// Module : SALOME
//
#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//function : TextHighlightColor
//purpose :
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor()
+std::vector<double> SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor()
{
return myValue;
}
//function : ChangeArray
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const vector<double>& newArray)
+void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const std::vector<double>& newArray)
{
Backup();
dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(into)->ChangeArray (myValue);
}
-string SALOMEDSImpl_AttributeTextHighlightColor::Save()
+std::string SALOMEDSImpl_AttributeTextHighlightColor::Save()
{
char *Val = new char[75];
sprintf(Val, "%f %f %f", (float)myValue[0],
(float)myValue[1],
(float)myValue[2]);
- string ret(Val);
+ std::string ret(Val);
delete Val;
return ret;
}
-void SALOMEDSImpl_AttributeTextHighlightColor::Load(const string& value)
+void SALOMEDSImpl_AttributeTextHighlightColor::Load(const std::string& value)
{
float r, g, b;
sscanf(value.c_str(), "%f %f %f", &r, &g, &b);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTextHighlightColor.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTreeNode.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeTreeNode.hxx"
#include <string.h>
-using namespace std;
-
const std::string& SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID()
{
static std::string TreeNodeID ("0E1C36E6-379B-4d90-AC37-17A14310E648");
return T;
}
-string SALOMEDSImpl_AttributeTreeNode::Type()
+std::string SALOMEDSImpl_AttributeTreeNode::Type()
{
char* aNodeName = new char[127];
sprintf(aNodeName, "AttributeTreeNodeGUID%s", ID().c_str());
- string ret(aNodeName);
+ std::string ret(aNodeName);
delete [] aNodeName;
return ret;
}
-string SALOMEDSImpl_AttributeTreeNode::Save()
+std::string SALOMEDSImpl_AttributeTreeNode::Save()
{
- string aFather, aPrevious, aNext, aFirst;
+ std::string aFather, aPrevious, aNext, aFirst;
if (HasFather()) aFather = GetFather()->Label().Entry(); else aFather = "!";
if (HasPrevious()) aPrevious = GetPrevious()->Label().Entry(); else aPrevious = "!";
aLength += aFather.size() + aPrevious.size() + aNext.size() + aFirst.size();
char* aResult = new char[aLength];
sprintf(aResult, "%s %s %s %s", aFather.c_str(), aPrevious.c_str(), aNext.c_str(), aFirst.c_str());
- string ret(aResult);
+ std::string ret(aResult);
delete [] aResult;
return ret;
}
-void SALOMEDSImpl_AttributeTreeNode::Load(const string& value)
+void SALOMEDSImpl_AttributeTreeNode::Load(const std::string& value)
{
char* aCopy = (char*)value.c_str();
char* adr = strtok(aCopy, " ");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeTreeNode.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeUAttribute.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeUserID.hxx"
#include "Basics_Utils.hxx"
-using namespace std;
-
std::string SALOMEDSImpl_AttributeUserID::DefaultID()
{
return Kernel_Utils::GetGUID(Kernel_Utils::DefUserID);
A->SetValue( myID );
}
-string SALOMEDSImpl_AttributeUserID::Type()
+std::string SALOMEDSImpl_AttributeUserID::Type()
{
char* aUAttrName = new char[127];
sprintf(aUAttrName, "AttributeUserID_%s",ID().c_str());
- string ret(aUAttrName);
+ std::string ret(aUAttrName);
delete aUAttrName;
return ret;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_AttributeUAttribute.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Attributes.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Callback.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Callback.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_ChildIterator.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_ChildIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SALOMEDSImpl_ChildNodeIterator.cxx
// Created: Wed Jan 26 16:43:08 2000
// Author: Denis PASCAL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMEDSImpl_ChildNodeIterator_HeaderFile
#define _SALOMEDSImpl_ChildNodeIterator_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Defines.hxx
// Author : Alexander A. BORODIN
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOMEDSIMPL_DRIVER_H__
#define __SALOMEDSIMPL_DRIVER_H__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_GenericAttribute.hxx
// Author : SERGEY_RUIN
// Module : SALOME
#include "SALOMEDSImpl_Study.hxx"
#include "SALOMEDSImpl_StudyBuilder.hxx"
-using namespace std;
-
-string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
+std::string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
{
SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
if (ga)
return "";
}
-string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
+std::string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
{
SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
if (ga)
ga->CheckLocked();
}
-string SALOMEDSImpl_GenericAttribute::Type()
+std::string SALOMEDSImpl_GenericAttribute::Type()
{
return _type;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_GenericAttribute.hxx
// Author : SERGEY_RUIN
// Module : SALOME
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
// File : SALOMEDSImpl_GenericVariable.cxx
// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
// Module : SALOME
-
+//
#include "SALOMEDSImpl_GenericVariable.hxx"
#include "SALOMEDSImpl_Attributes.hxx"
#include "SALOMEDSImpl_Study.hxx"
#include <string>
-using namespace std;
-
//============================================================================
/*! Function : SALOMEDSImpl_GenericVariable
* Purpose :
//============================================================================
SALOMEDSImpl_GenericVariable::
SALOMEDSImpl_GenericVariable(SALOMEDSImpl_GenericVariable::VariableTypes theType,
- const string& theName):
+ const std::string& theName):
_type(theType),
_name(theName)
{}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_GenericVariable::Name() const
+std::string SALOMEDSImpl_GenericVariable::Name() const
{
return _name;
}
* Purpose :
*/
//============================================================================
-SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String2VariableType(const string& theStrType)
+SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String2VariableType(const std::string& theStrType)
{
return(SALOMEDSImpl_GenericVariable::VariableTypes)atoi((char*)theStrType.c_str());
}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_GenericVariable::Save() const
+std::string SALOMEDSImpl_GenericVariable::Save() const
{
- return string();
+ return std::string();
}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_GenericVariable::SaveToScript() const
+std::string SALOMEDSImpl_GenericVariable::SaveToScript() const
{
- return string();
+ return std::string();
}
//============================================================================
/*! Function : SaveType
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_GenericVariable::SaveType() const
+std::string SALOMEDSImpl_GenericVariable::SaveType() const
{
- return string();
+ return std::string();
}
//============================================================================
* Purpose :
*/
//============================================================================
-void SALOMEDSImpl_GenericVariable::Load(const string& theStrValue)
+void SALOMEDSImpl_GenericVariable::Load(const std::string& theStrValue)
{
}
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
// File : SALOMEDSImpl_GenericVariable.hxx
// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
// Module : SALOME
-
+//
#ifndef _GENERICIMPL_VARIABLE_HXX_
#define _GENERICIMPL_VARIABLE_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEDSImpl_IParameters.hxx"
#include <utilities.h>
#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDSImpl_ChildIterator.hxx"
-using namespace std;
-
#define _AP_LISTS_LIST_ "AP_LISTS_LIST"
#define _AP_ENTRIES_LIST_ "AP_ENTRIES_LIST"
#define _AP_PROPERTIES_LIST_ "AP_PROPERTIES_LIST"
_compNames.clear();
}
-int SALOMEDSImpl_IParameters::append(const string& listName, const string& value)
+int SALOMEDSImpl_IParameters::append(const std::string& listName, const std::string& value)
{
if(!_ap) return -1;
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap->IsSet(listName, PT_STRARRAY)) {
if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) _ap->SetStrArray(_AP_LISTS_LIST_, v);
if(listName != _AP_ENTRIES_LIST_ &&
return (v.size()-1);
}
-int SALOMEDSImpl_IParameters::nbValues(const string& listName)
+int SALOMEDSImpl_IParameters::nbValues(const std::string& listName)
{
if(!_ap) return -1;
if(!_ap->IsSet(listName, PT_STRARRAY)) return 0;
- vector<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
return v.size();
}
-vector<string> SALOMEDSImpl_IParameters::getValues(const string& listName)
+std::vector<std::string> SALOMEDSImpl_IParameters::getValues(const std::string& listName)
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(listName, PT_STRARRAY)) return v;
return _ap->GetStrArray(listName);
}
-string SALOMEDSImpl_IParameters::getValue(const string& listName, int index)
+std::string SALOMEDSImpl_IParameters::getValue(const std::string& listName, int index)
{
if(!_ap) return "";
if(!_ap->IsSet(listName, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
if(index >= v.size()) return "";
return v[index];
}
-vector<string> SALOMEDSImpl_IParameters::getLists()
+std::vector<std::string> SALOMEDSImpl_IParameters::getLists()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_LISTS_LIST_);
}
-void SALOMEDSImpl_IParameters::setParameter(const string& entry, const string& parameterName, const string& value)
+void SALOMEDSImpl_IParameters::setParameter(const std::string& entry, const std::string& parameterName, const std::string& value)
{
if(!_ap) return;
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap->IsSet(entry, PT_STRARRAY)) {
append(_AP_ENTRIES_LIST_, entry); //Add the entry to the internal list of entries
_ap->SetStrArray(entry, v);
}
-string SALOMEDSImpl_IParameters::getParameter(const string& entry, const string& parameterName)
+std::string SALOMEDSImpl_IParameters::getParameter(const std::string& entry, const std::string& parameterName)
{
if(!_ap) return "";
if(!_ap->IsSet(entry, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(entry);
+ std::vector<std::string> v = _ap->GetStrArray(entry);
int length = v.size();
for(int i = 0; i<length; i+=1) {
if(v[i] == parameterName) return v[i+1];
}
-vector<string> SALOMEDSImpl_IParameters::getAllParameterNames(const string& entry)
+std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterNames(const std::string& entry)
{
- vector<string> v, names;
+ std::vector<std::string> v, names;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
return names;
}
-vector<string> SALOMEDSImpl_IParameters::getAllParameterValues(const string& entry)
+std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterValues(const std::string& entry)
{
- vector<string> v, values;
+ std::vector<std::string> v, values;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
return values;
}
-int SALOMEDSImpl_IParameters::getNbParameters(const string& entry)
+int SALOMEDSImpl_IParameters::getNbParameters(const std::string& entry)
{
if(!_ap) return -1;
if(!_ap->IsSet(entry, PT_STRARRAY)) return -1;
return _ap->GetStrArray(entry).size()/2;
}
-vector<string> SALOMEDSImpl_IParameters::getEntries()
+std::vector<std::string> SALOMEDSImpl_IParameters::getEntries()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(_AP_ENTRIES_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_ENTRIES_LIST_);
}
-void SALOMEDSImpl_IParameters::setProperty(const string& name, const std::string& value)
+void SALOMEDSImpl_IParameters::setProperty(const std::string& name, const std::string& value)
{
if(!_ap) return;
if(!_ap->IsSet(name, PT_STRING)) {
_ap->SetString(name, value);
}
-string SALOMEDSImpl_IParameters::getProperty(const string& name)
+std::string SALOMEDSImpl_IParameters::getProperty(const std::string& name)
{
if(!_ap) return "";
if(!_ap->IsSet(name, PT_STRING)) return "";
return _ap->GetString(name);
}
-vector<string> SALOMEDSImpl_IParameters::getProperties()
+std::vector<std::string> SALOMEDSImpl_IParameters::getProperties()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_PROPERTIES_LIST_);
}
-string SALOMEDSImpl_IParameters::decodeEntry(const string& entry)
+std::string SALOMEDSImpl_IParameters::decodeEntry(const std::string& entry)
{
if(!_study) return entry;
int pos = entry.rfind("_");
if(pos < 0 || pos >= entry.size()) return entry;
- string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
+ std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
if(_compNames.find(compName) == _compNames.end()) {
SALOMEDSImpl_SObject so = _study->FindComponent(compName);
}
else compID = _compNames[compName];
- string newEntry(compID);
+ std::string newEntry(compID);
newEntry += (":"+tail);
return newEntry;
}
-bool SALOMEDSImpl_IParameters::isDumpPython(SALOMEDSImpl_Study* study, const string& theID)
+bool SALOMEDSImpl_IParameters::isDumpPython(SALOMEDSImpl_Study* study, const std::string& theID)
{
- string anID;
+ std::string anID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
}
-int SALOMEDSImpl_IParameters::getLastSavePoint(SALOMEDSImpl_Study* study, const string& theID)
+int SALOMEDSImpl_IParameters::getLastSavePoint(SALOMEDSImpl_Study* study, const std::string& theID)
{
- string anID;
+ std::string anID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
-string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID)
+std::string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID)
{
- string anID;
+ std::string anID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
SALOMEDSImpl_AttributeParameter* ap = study->GetCommonParameters((char*)anID.c_str(), savePoint);
SALOMEDSImpl_IParameters ip(ap);
- string dump("");
+ std::string dump("");
dump += "import iparameters\n";
dump += "ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters(\""+anID+"\", 1))\n\n";
- vector<string> v = ip.getProperties();
+ std::vector<std::string> v = ip.getProperties();
if(v.size() > 0) {
dump += "#Set up visual properties:\n";
for(int i = 0; i<v.size(); i++) {
- string prp = ip.getProperty(v[i]);
+ std::string prp = ip.getProperty(v[i]);
dump += "ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
}
}
if(v.size() > 0) {
dump += "#Set up lists:\n";
for(int i = 0; i<v.size(); i++) {
- vector<string> lst = ip.getValues(v[i]);
+ std::vector<std::string> lst = ip.getValues(v[i]);
dump += "# fill list "+v[i]+"\n";
for(int j = 0; j < lst.size(); j++) {
if (lst[j].find('\"') == -1)
return dump;
}
-string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study,
- const string& moduleName,
- const string& shift,
- const string& theID)
+std::string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study,
+ const std::string& moduleName,
+ const std::string& shift,
+ const std::string& theID)
{
- string anID;
+ std::string anID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
- string dump("");
+ std::string dump("");
int savePoint = SALOMEDSImpl_IParameters::getLastSavePoint(study, anID);
if(savePoint < 0) return dump;
dump += shift +"import iparameters\n";
dump += shift + "ipar = iparameters.IParameters(theStudy.GetModuleParameters(\""+anID+"\", \""+moduleName+"\", 1))\n\n";
- vector<string> v = ip.getProperties();
+ std::vector<std::string> v = ip.getProperties();
if(v.size() > 0) {
dump += shift +"#Set up visual properties:\n";
for(int i = 0; i<v.size(); i++) {
- string prp = ip.getProperty(v[i]);
+ std::string prp = ip.getProperty(v[i]);
dump += shift +"ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
}
}
if(v.size() > 0) {
dump += shift +"#Set up lists:\n";
for(int i = 0; i<v.size(); i++) {
- vector<string> lst = ip.getValues(v[i]);
+ std::vector<std::string> lst = ip.getValues(v[i]);
dump += shift +"# fill list "+v[i]+"\n";
for(int j = 0; j < lst.size(); j++)
dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
if(v.size() > 0) {
dump += shift + "#Set up entries:\n";
for(int i = 0; i<v.size(); i++) {
- vector<string> names = ip.getAllParameterNames(v[i]);
- vector<string> values = ip.getAllParameterValues(v[i]);
- string decodedEntry = ip.decodeEntry(v[i]);
+ std::vector<std::string> names = ip.getAllParameterNames(v[i]);
+ std::vector<std::string> values = ip.getAllParameterValues(v[i]);
+ std::string decodedEntry = ip.decodeEntry(v[i]);
SALOMEDSImpl_SObject so = study->FindObjectID(decodedEntry);
- string so_name("");
+ std::string so_name("");
if(so) so_name = so.GetName();
dump += shift + "# set up entry " + v[i] +" ("+so_name+")" + " parameters" + "\n";
for(int j = 0; j < names.size() && j < values.size(); j++)
}
-string SALOMEDSImpl_IParameters::getDefaultVisualComponent()
+std::string SALOMEDSImpl_IParameters::getDefaultVisualComponent()
{
return "Interface Applicative";
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEDSImpl_IParameters_H
#define SALOMEDSImpl_IParameters_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_SComponent.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_AttributeComment.hxx"
#include "SALOMEDSImpl_AttributeIOR.hxx"
-using namespace std;
-
//============================================================================
/*! Function : Empty constructor
* Purpose :
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_SComponent::ComponentDataType()
+std::string SALOMEDSImpl_SComponent::ComponentDataType()
{
- string res = "";
+ std::string res = "";
SALOMEDSImpl_AttributeComment* type;
if ( (type = (SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID())) ) {
res = type->Value();
* Purpose :
*/
//============================================================================
-bool SALOMEDSImpl_SComponent::ComponentIOR(string& IOR)
+bool SALOMEDSImpl_SComponent::ComponentIOR(std::string& IOR)
{
SALOMEDSImpl_AttributeIOR* ior;
if (!(ior = (SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID())) )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_SComponent.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_SComponentIterator.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "SALOMEDSImpl_SComponentIterator.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
//============================================================================
/*! Function : constructor
*
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_SComponentIterator_i.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDSImpl_SObject.cxx
// Author : Sergey RUIN
#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
#include <map>
#include <string.h>
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_SObject::GetID() const
+std::string SALOMEDSImpl_SObject::GetID() const
{
return _lab.Entry();
}
*/
//============================================================================
bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute,
- const string& theTypeOfAttribute) const
+ const std::string& theTypeOfAttribute) const
{
if(_lab.IsNull()) return false;
std::string aGUID = GetGUID(theTypeOfAttribute);
* Purpose : Returns list of all attributes for this sobject
*/
//============================================================================
-vector<DF_Attribute*> SALOMEDSImpl_SObject::GetAllAttributes() const
+std::vector<DF_Attribute*> SALOMEDSImpl_SObject::GetAllAttributes() const
{
- vector<DF_Attribute*> va1, va = _lab.GetAttributes();
+ std::vector<DF_Attribute*> va1, va = _lab.GetAttributes();
for(int i = 0, len = va.size(); i<len; i++) {
SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(va[i]);
- if(ga && ga->Type() != string("AttributeReference"))
+ if(ga && ga->Type() != std::string("AttributeReference"))
va1.push_back(va[i]);
}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_SObject::GetName() const
+std::string SALOMEDSImpl_SObject::GetName() const
{
- string aStr = "";
+ std::string aStr = "";
SALOMEDSImpl_AttributeName* aName;
if ((aName=(SALOMEDSImpl_AttributeName*)_lab.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
aStr =aName->Value();
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_SObject::GetComment() const
+std::string SALOMEDSImpl_SObject::GetComment() const
{
- string aStr = "";
+ std::string aStr = "";
SALOMEDSImpl_AttributeComment* aComment;
if ((aComment=(SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
aStr = aComment->Value();
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_SObject::GetIOR() const
+std::string SALOMEDSImpl_SObject::GetIOR() const
{
- string aStr = "";
+ std::string aStr = "";
SALOMEDSImpl_AttributeIOR* anIOR;
if ((anIOR=(SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
aStr = dynamic_cast<SALOMEDSImpl_AttributeIOR*>(anIOR)->Value();
}
-std::string SALOMEDSImpl_SObject::GetGUID(const string& theType)
+std::string SALOMEDSImpl_SObject::GetGUID(const std::string& theType)
{
__AttributeTypeToGUIDForSObject
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_SObject.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
// File : SALOMEDSImpl_ScalarVariable.cxx
// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
// Module : SALOME
-
+//
#include "SALOMEDSImpl_ScalarVariable.hxx"
#include "SALOMEDSImpl_GenericVariable.hxx"
#include <iostream>
#include <cstdlib>
#include <cstdio>
-using namespace std;
-
//============================================================================
/*! Function : SALOMEDSImpl_ScalarVariable
* Purpose :
//============================================================================
SALOMEDSImpl_ScalarVariable::
SALOMEDSImpl_ScalarVariable(SALOMEDSImpl_GenericVariable::VariableTypes type,
- const string& theName):
+ const std::string& theName):
SALOMEDSImpl_GenericVariable(type,theName)
{}
* Purpose :
*/
//============================================================================
-bool SALOMEDSImpl_ScalarVariable::setStringValue(const string& theValue)
+bool SALOMEDSImpl_ScalarVariable::setStringValue(const std::string& theValue)
{
if(myStrValue == theValue)
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::getStringValue() const
+std::string SALOMEDSImpl_ScalarVariable::getStringValue() const
{
return myStrValue;
}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::Save() const{
+std::string SALOMEDSImpl_ScalarVariable::Save() const{
char buffer[255];
switch(Type())
{
}
default:break;
}
- return string(buffer);
+ return std::string(buffer);
}
//============================================================================
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::SaveToScript() const
+std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const
{
char buffer[255];
switch(Type())
}
default:break;
}
- return string(buffer);
+ return std::string(buffer);
}
//============================================================================
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::SaveType() const{
+std::string SALOMEDSImpl_ScalarVariable::SaveType() const{
char buffer[255];
sprintf(buffer, "%d", (int)Type());
- return string(buffer);
+ return std::string(buffer);
}
//============================================================================
* Purpose :
*/
//============================================================================
-void SALOMEDSImpl_ScalarVariable::Load(const string& theStrValue)
+void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue)
{
double aValue = atof(theStrValue.c_str());
setValue(aValue);
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
// File : SALOMEDSImpl_ScalarVariable.hxx
// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
// Module : SALOME
-
+//
#ifndef _SALOMEDSImpl_ScalarVariable_HeaderFile
#define _SALOMEDSImpl_ScalarVariable_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Study.cxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Study.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_StudyBuilder.cxx
// Author : Sergey RUIN
// Module : SALOME
#include <stdlib.h>
#include <string.h>
-using namespace std;
-
#define USE_CASE_LABEL_TAG 2
#define DIRECTORYID 16661
#define FILELOCALID 26662
* Purpose : Create a new component (Scomponent)
*/
//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const string& DataType)
+SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const std::string& DataType)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::DefineComponentInstance(const SALOMEDSImpl_SComponent& aComponent,
- const string& IOR)
+ const std::string& IOR)
{
_errorCode = "";
if (aLocked) _study->GetProperties()->SetLocked(false);
std::string Res(Att->Value());
- string aHDFPath(Res);
+ std::string aHDFPath(Res);
SALOMEDSImpl_AttributeComment* type = NULL;
std::string DataType;
DefineComponentInstance (anSCO, aDriver->GetIOR());
- string aHDFUrl;
+ std::string aHDFUrl;
bool isASCII = false;
if (HDFascii::isASCII(aHDFPath.c_str())) {
isASCII = true;
char aMultifileState[2];
char ASCIIfileState[2];
try {
- string scoid = anSCO.GetID();
+ std::string scoid = anSCO.GetID();
hdf_file->OpenOnDisk(HDF_RDONLY);
HDFgroup *hdf_group = new HDFgroup("DATACOMPONENT",hdf_file);
hdf_group->OpenOnDisk();
ascii_hdf_dataset->OpenOnDisk();
ascii_hdf_dataset->ReadFromDisk(ASCIIfileState);
- string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res);
+ std::string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res);
bool aResult = (ASCIIfileState[0]=='A')?
aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'):
delete hdf_file;
if (isASCII) {
- vector<string> aFilesToRemove;
+ std::vector<std::string> aFilesToRemove;
aFilesToRemove.push_back("hdf_from_ascii.hdf");
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl),
aFilesToRemove, true);
delete hdf_file;
if (isASCII) {
- vector<string> aFilesToRemove;
+ std::vector<std::string> aFilesToRemove;
aFilesToRemove.push_back(aHDFUrl);
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
*/
//============================================================================
DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
_errorCode = "";
if(!anObject) {
//Add checks for TreeNode and UserID attributes
if (strncmp(aTypeOfAttribute.c_str(), "AttributeTreeNode",17) == 0 ) {
- string aTreeNodeGUID;
+ std::string aTreeNodeGUID;
if (strcmp(aTypeOfAttribute.c_str(), "AttributeTreeNode") == 0) {
aTreeNodeGUID = SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID();
} else {
bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObject,
DF_Attribute*& anAttribute,
- const string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
_errorCode = "";
if(!anObject) {
//============================================================================
bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
_errorCode = "";
CheckLocked();
}
DF_Label Lab = anObject.GetLabel();
- if (aTypeOfAttribute == string("AttributeIOR")) { // Remove from IORLabel map
+ if (aTypeOfAttribute == std::string("AttributeIOR")) { // Remove from IORLabel map
SALOMEDSImpl_AttributeIOR* anAttr = NULL;
if ((anAttr=(SALOMEDSImpl_AttributeIOR*)Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
_study->DeleteIORLabelMapItem(anAttr->Value());
* Purpose : adds a new directory with a path = thePath
*/
//============================================================================
-bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath)
+bool SALOMEDSImpl_StudyBuilder::AddDirectory(const std::string& thePath)
{
_errorCode = "";
CheckLocked();
return false;
}
- string aPath(thePath), aContext(""), aFatherPath;
+ std::string aPath(thePath), aContext(""), aFatherPath;
DF_Label aLabel;
SALOMEDSImpl_SObject anObject;
aPath = _study->GetContext() + aPath;
}
- vector<string> vs = SALOMEDSImpl_Tool::splitString(aPath, '/');
+ std::vector<std::string> vs = SALOMEDSImpl_Tool::splitString(aPath, '/');
if(vs.size() == 1)
aFatherPath = "/";
else {
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
+ const std::string& theGUID)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::IsGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
+ const std::string& theGUID)
{
_errorCode = "";
if(!anObject) {
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const std::string& theValue)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const std::string& theValue)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetIOR(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const std::string& theValue)
{
_errorCode = "";
CheckLocked();
if ((anID=(SALOMEDSImpl_AttributeLocalID*)current.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID())))
if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it
- string persist_ref = Att->Value();
+ std::string persist_ref = Att->Value();
SALOMEDSImpl_SObject so = SALOMEDSImpl_Study::SObject(current);
- string ior_string = driver->LocalPersistentIDToIOR(so,
+ std::string ior_string = driver->LocalPersistentIDToIOR(so,
persist_ref,
isMultiFile,
isASCII);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_StudyBuilder.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_StudyHandle.cxx
// Author : Sergey LITONIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_StudyHandle.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_StudyManager.cxx
// Author : Sergey RUIN
// Module : SALOME
# undef GetUserName
#endif
-using namespace std;
-
#define USE_CASE_LABEL_ID "0:2"
static void SaveAttributes(const SALOMEDSImpl_SObject& SO, HDFgroup *hdf_group_sobject);
* Purpose : Create a New Study of name study_name
*/
//==================================================T==========================
-SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const string& study_name)
+SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const std::string& study_name)
{
_errorCode = "";
* Purpose : Open a Study from it's persistent reference
*/
//============================================================================
-SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl)
+SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const std::string& aUrl)
{
_errorCode = "";
HDFgroup *hdf_notebook_vars = 0;
char* aC_HDFUrl;
- string aHDFUrl;
+ std::string aHDFUrl;
bool isASCII = false;
if (HDFascii::isASCII(aUrl.c_str())) {
isASCII = true;
eStr = new char[strlen(aUrl.c_str())+17];
sprintf(eStr,"Can't open file %s",aUrl.c_str());
delete [] eStr;
- _errorCode = string(eStr);
+ _errorCode = std::string(eStr);
return NULL;
}
{
char *eStr = new char [strlen(aUrl.c_str())+17];
sprintf(eStr,"Can't open file %s", aUrl.c_str());
- _errorCode = string(eStr);
+ _errorCode = std::string(eStr);
return NULL;
}
hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);
if (isASCII) {
- vector<string> aFilesToRemove;
+ std::vector<std::string> aFilesToRemove;
aFilesToRemove.push_back("hdf_from_ascii.hdf");
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
{
_errorCode = "";
- string url = aStudy->URL();
+ std::string url = aStudy->URL();
if (url.empty()) {
_errorCode = "No path specified to save the study. Nothing done";
return false;
{
_errorCode = "";
- string url = aStudy->URL();
+ std::string url = aStudy->URL();
if (url.empty()) {
_errorCode = "No path specified to save the study. Nothing done";
return false;
* Purpose : Save a study to the persistent reference aUrl
*/
//============================================================================
-bool SALOMEDSImpl_StudyManager::SaveAs(const string& aUrl,
+bool SALOMEDSImpl_StudyManager::SaveAs(const std::string& aUrl,
SALOMEDSImpl_Study* aStudy,
SALOMEDSImpl_DriverFactory* aFactory,
bool theMultiFile)
return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, false);
}
-bool SALOMEDSImpl_StudyManager::SaveAsASCII(const string& aUrl,
+bool SALOMEDSImpl_StudyManager::SaveAsASCII(const std::string& aUrl,
SALOMEDSImpl_Study* aStudy,
SALOMEDSImpl_DriverFactory* aFactory,
bool theMultiFile)
* Purpose : Get name list of open studies in the session
*/
//============================================================================
-vector<SALOMEDSImpl_Study*> SALOMEDSImpl_StudyManager::GetOpenStudies()
+std::vector<SALOMEDSImpl_Study*> SALOMEDSImpl_StudyManager::GetOpenStudies()
{
_errorCode = "";
- vector<SALOMEDSImpl_Study*> aList;
+ std::vector<SALOMEDSImpl_Study*> aList;
int nbDocs = _appli->NbDocuments();
}
else {
SALOMEDSImpl_Study* aStudy;
- vector<int> ids = _appli->GetDocumentIDs();
+ std::vector<int> ids = _appli->GetDocumentIDs();
for (int i = 0, len = ids.size(); i<len; i++) {
DF_Document* D = _appli->GetDocument(ids[i]);
if(D == _clipboard) continue;
*/
//============================================================================
SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByName
- (const string& aStudyName)
+ (const std::string& aStudyName)
{
_errorCode = "";
int nbDocs = _appli->NbDocuments();
return NULL;
}
else {
- vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
for (int i = 0, len = studies.size(); i<len; i++) {
if (studies[i]->Name() == aStudyName) return studies[i];
}
}
- _errorCode = string("Found no study with the name ") + aStudyName;
+ _errorCode = std::string("Found no study with the name ") + aStudyName;
return NULL;
}
return NULL;
}
else {
- vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
for (int i = 0, len = studies.size(); i<len; i++) {
if (studies[i]->StudyId() == aStudyID) return studies[i];
}
if (aLocked) aProp->SetLocked(true);
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
* Purpose : save the study in HDF file
*/
//============================================================================
-bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl,
+bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
SALOMEDSImpl_Study* aStudy,
SALOMEDSImpl_DriverFactory* aFactory,
bool theMultiFile,
HDFdataset *hdf_dataset =0;
hdf_size size[1];
hdf_int32 name_len = 0;
- string component_name;
+ std::string component_name;
if(!aStudy) {
_errorCode = "Study is null";
}
//Create a temporary url to which the study is saved
- string aUrl = SALOMEDSImpl_Tool::GetTmpDir() + SALOMEDSImpl_Tool::GetNameFromPath(aStudyUrl);
+ std::string aUrl = SALOMEDSImpl_Tool::GetTmpDir() + SALOMEDSImpl_Tool::GetNameFromPath(aStudyUrl);
int aLocked = aStudy->GetProperties()->IsLocked();
if (aLocked) aStudy->GetProperties()->SetLocked(false);
SALOMEDSImpl_StudyBuilder* SB= aStudy->NewBuilder();
- map<string, SALOMEDSImpl_Driver*> aMapTypeDriver;
+ std::map<std::string, SALOMEDSImpl_Driver*> aMapTypeDriver;
try
{
{
SALOMEDSImpl_SComponent sco = itcomponent1.Value();
// if there is an associated Engine call its method for saving
- string IOREngine;
+ std::string IOREngine;
try {
if (!sco.ComponentIOR(IOREngine)) {
- string aCompType = sco.GetComment();
+ std::string aCompType = sco.GetComment();
if (!aCompType.empty()) {
SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType);
}
}
- string anOldName = aStudy->Name();
+ std::string anOldName = aStudy->Name();
aStudy->URL(aStudyUrl);
// To change for Save
{
SALOMEDSImpl_SComponent sco = itcomponent.Value();
- string scoid = sco.GetID();
+ std::string scoid = sco.GetID();
hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group_datacomponent);
hdf_sco_group->CreateOnDisk();
- string componentDataType = sco.ComponentDataType();
- string IOREngine;
+ std::string componentDataType = sco.ComponentDataType();
+ std::string IOREngine;
if (sco.ComponentIOR(IOREngine))
{
SALOMEDSImpl_Driver* Engine = NULL;
for (; itcomp.More(); itcomp.Next())
{
SALOMEDSImpl_SComponent SC = itcomp.Value();
- string scid = SC.GetID();
+ std::string scid = SC.GetID();
hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure);
hdf_sco_group2->CreateOnDisk();
SaveAttributes(SC, hdf_sco_group2);
hdf_notebook_vars = new HDFgroup("NOTEBOOK_VARIABLES",hdf_file);
hdf_notebook_vars->CreateOnDisk();
- string varValue;
- string varType;
- string varIndex;
+ std::string varValue;
+ std::string varType;
+ std::string varIndex;
for(int i=0 ;i < aStudy->myNoteBookVars.size(); i++ ){
// For each variable create HDF group
char buffer[256];
sprintf(buffer,"%d",i);
- varIndex= string(buffer);
+ varIndex= std::string(buffer);
name_len = (hdf_int32) varIndex.length();
size[0] = name_len +1 ;
hdf_dataset = new HDFdataset("VARIABLE_INDEX",hdf_notebook_var,HDF_STRING,size,1);
//-----------------------------------------------------------------------
//6 - Write the Study Properties
//-----------------------------------------------------------------------
- string study_name = aStudy->Name();
+ std::string study_name = aStudy->Name();
name_len = (hdf_int32) study_name.size();
size[0] = name_len +1 ;
hdf_dataset = new HDFdataset("STUDY_NAME",hdf_group_study_structure,HDF_STRING,size,1);
// The easiest way to get a list of file in the temporary directory
- string aCmd, aTmpFileDir = SALOMEDSImpl_Tool::GetTmpDir();
- string aTmpFile = aTmpFileDir +"files";
- string aStudyTmpDir = SALOMEDSImpl_Tool::GetDirFromPath(aUrl);
+ std::string aCmd, aTmpFileDir = SALOMEDSImpl_Tool::GetTmpDir();
+ std::string aTmpFile = aTmpFileDir +"files";
+ std::string aStudyTmpDir = SALOMEDSImpl_Tool::GetDirFromPath(aUrl);
#ifdef WIN32
aCmd = "dir /B \"" + aStudyTmpDir +"\" > " + aTmpFile;
size_t aLen = strlen(buffer);
if(buffer[aLen-1] == '\n') buffer[aLen-1] = char(0);
#ifdef WIN32
- aCmd = "move /Y \"" + aStudyTmpDir + string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl) +"\"";
+ aCmd = "move /Y \"" + aStudyTmpDir + std::string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl) +"\"";
#else
- aCmd = "mv -f \"" + aStudyTmpDir + string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl)+"\"";
+ aCmd = "mv -f \"" + aStudyTmpDir + std::string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl)+"\"";
#endif
system(aCmd.c_str());
}
{
// mpv: don't save empty labels
- vector<DF_Attribute*> attr = itchild.Value().GetAttributes();
+ std::vector<DF_Attribute*> attr = itchild.Value().GetAttributes();
if (attr.size() == 0) { //No attributes on the label
DF_ChildIterator subchild(itchild.Value());
if (!subchild.More()) {
subchild.Init(itchild.Value(), true);
bool anEmpty = true;
for (; subchild.More() && anEmpty; subchild.Next()) {
- vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
+ std::vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
if (attr2.size()) {
anEmpty = false; //There are attributes on the child label
break;
SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value());
- string scoid = SO.GetID();
+ std::string scoid = SO.GetID();
hdf_group_sobject = new HDFgroup(scoid.c_str(), hdf_group_datatype);
hdf_group_sobject->CreateOnDisk();
SaveAttributes(SO, hdf_group_sobject);
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const string& aUrl)
+std::string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const std::string& aUrl)
{
_errorCode = "";
SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent();
if (!aComponent) return false;
if (aComponent.GetLabel() == theObject.GetLabel()) return false;
- string IOREngine;
+ std::string IOREngine;
if (!aComponent.ComponentIOR(IOREngine)) return false;
if (theEngine == NULL) return false;
return theEngine->CanCopy(theObject);
aAuxTargetLabel = aAuxTargetLabel.FindChild(aSourceLabel.Tag());
}
// iterate attributes
- vector<DF_Attribute*> attrList = theSource.GetAttributes();
+ std::vector<DF_Attribute*> attrList = theSource.GetAttributes();
for(int i = 0, len = attrList.size(); i<len; i++) {
DF_Attribute* anAttr = attrList[i];
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
- if (type.substr(0, 17) == string("AttributeTreeNode")) continue; // never copy tree node attribute
- if (type == string("AttributeTarget")) continue; // and target attribute
+ std::string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
+ if (type.substr(0, 17) == std::string("AttributeTreeNode")) continue; // never copy tree node attribute
+ if (type == std::string("AttributeTarget")) continue; // and target attribute
- if (type == string("AttributeReference")) { // reference copied as Comment in aux tree
+ if (type == std::string("AttributeReference")) { // reference copied as Comment in aux tree
DF_Label aReferenced = dynamic_cast<SALOMEDSImpl_AttributeReference*>(anAttr)->Get();
- string anEntry = aReferenced.Entry();
+ std::string anEntry = aReferenced.Entry();
// store the value of name attribute of referenced label
SALOMEDSImpl_AttributeName* aNameAttribute;
if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aReferenced.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
continue;
}
- if (type == string("AttributeIOR")) { // IOR => ID and TMPFile of Engine
- string anEntry = theSource.Entry();
+ if (type == std::string("AttributeIOR")) { // IOR => ID and TMPFile of Engine
+ std::string anEntry = theSource.Entry();
SALOMEDSImpl_SObject aSO = theSourceStudy->FindObjectID(anEntry);
int anObjID;
long aLen;
SALOMEDSImpl_TMPFile* aStream = theEngine->CopyFrom(aSO, anObjID, aLen);
- string aResStr("");
+ std::string aResStr("");
for(a = 0; a < aLen; a++) {
aResStr += (char)(aStream->Get(a));
}
return false;
}
- string IOREngine;
+ std::string IOREngine;
if (!aComponent.ComponentIOR(IOREngine)) {
_errorCode = "component has no IOR";
return false;
if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
SALOMEDSImpl_AttributeInteger* anObjID = (SALOMEDSImpl_AttributeInteger*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID());
SALOMEDSImpl_AttributeComment* aComponentName = (SALOMEDSImpl_AttributeComment*)theSource.Root().FindAttribute(SALOMEDSImpl_AttributeComment::GetID());
- string aCompName = aComponentName->Value();
+ std::string aCompName = aComponentName->Value();
if (theEngine->CanPaste(aCompName, anObjID->Value())) {
std::string aTMPStr = aNameAttribute->Value();
}
}
- string anEntry = aTargetLabel.Entry();
+ std::string anEntry = aTargetLabel.Entry();
SALOMEDSImpl_SObject aPastedSO = theDestinationStudy->FindObjectID(anEntry);
if (isFirstElement) {
- string aDestEntry = theEngine->PasteInto(aStream,
+ std::string aDestEntry = theEngine->PasteInto(aStream,
aLen,
anObjID->Value(),
aPastedSO.GetFatherComponent());
}
// iterate attributes
- vector<DF_Attribute*> attrList = theSource.GetAttributes();
+ std::vector<DF_Attribute*> attrList = theSource.GetAttributes();
for(int i = 0, len = attrList.size(); i<len; i++) {
DF_Attribute* anAttr = attrList[i];
if (aTargetLabel.FindAttribute(anAttr->ID())) {
SALOMEDSImpl_AttributeComment* aCommentAttribute = NULL;
if ((aCommentAttribute=(SALOMEDSImpl_AttributeComment*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
char * anEntry = new char[aCommentAttribute->Value().size() + 1];
- strcpy(anEntry, string(aCommentAttribute->Value()).c_str());
+ strcpy(anEntry, std::string(aCommentAttribute->Value()).c_str());
char* aNameStart = strchr(anEntry, ' ');
if (aNameStart) {
*aNameStart = '\0';
static void SaveAttributes(const SALOMEDSImpl_SObject& aSO, HDFgroup *hdf_group_sobject)
{
hdf_size size[1];
- vector<DF_Attribute*> attrList = aSO.GetLabel().GetAttributes();
+ std::vector<DF_Attribute*> attrList = aSO.GetLabel().GetAttributes();
DF_Attribute* anAttr = NULL;
for(int i = 0, len = attrList.size(); i<len; i++) {
anAttr = attrList[i];
//The following attributes are not supposed to be written to the file
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
- if(type == string("AttributeIOR")) continue; //IOR attribute is not saved
- string aSaveStr =anAttr->Save();
+ std::string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
+ if(type == std::string("AttributeIOR")) continue; //IOR attribute is not saved
+ std::string aSaveStr =anAttr->Save();
//cout << "Saving: " << aSO.GetID() << " type: "<< type<<"|" << endl;
size[0] = (hdf_int32) strlen(aSaveStr.c_str()) + 1;
HDFdataset *hdf_dataset = new HDFdataset((char*)type.c_str(), hdf_group_sobject, HDF_STRING,size, 1);
bool isASCII)
{
DF_ChildIterator itchild(so.GetLabel());
- string ior_string, persistent_string, curid;
+ std::string ior_string, persistent_string, curid;
for (; itchild.More(); itchild.Next()) {
SALOMEDSImpl_SObject current = SALOMEDSImpl_Study::SObject(itchild.Value());
//Get Nb of variables
int aNbVars = theGroup->nInternalObjects();
- map<int,SALOMEDSImpl_GenericVariable*> aVarsMap;
+ std::map<int,SALOMEDSImpl_GenericVariable*> aVarsMap;
for( int iVar=0;iVar < aNbVars;iVar++ ) {
theGroup->InternalObjectIndentify(iVar,aVarName);
new_group = 0; //will be deleted by hdf_sco_group destructor
SALOMEDSImpl_GenericVariable::VariableTypes aVarType =
- SALOMEDSImpl_GenericVariable::String2VariableType(string(currentVarType));
+ SALOMEDSImpl_GenericVariable::String2VariableType(std::string(currentVarType));
delete [] currentVarType;
//Create variable and add it in the study
SALOMEDSImpl_GenericVariable* aVariable =
- new SALOMEDSImpl_ScalarVariable(aVarType,string(aVarName));
- aVariable->Load(string(currentVarValue));
- aVarsMap.insert(make_pair<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
+ new SALOMEDSImpl_ScalarVariable(aVarType,std::string(aVarName));
+ aVariable->Load(std::string(currentVarValue));
+ aVarsMap.insert(std::make_pair<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
delete [] currentVarValue;
- }
+ }
}
- map<int,SALOMEDSImpl_GenericVariable*>::const_iterator it= aVarsMap.begin();
+ std::map<int,SALOMEDSImpl_GenericVariable*>::const_iterator it= aVarsMap.begin();
for(;it!=aVarsMap.end();it++)
theStudy->AddVariable((*it).second);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_StudyManager.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDSImpl_SObject.cxx
// Author : Sergey RUIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __SALOMEDSIMPL_TMPFILE_H__
#define __SALOMEDSIMPL_TMPFILE_H__
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Tool.cxx
// Created : Mon Oct 21 16:24:34 2002
// Author : Sergey RUIN
#include <windows.h>
#endif
-using namespace std;
-
-
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
// function : GetTempDir
// purpose : Return a temp directory to store created files like "/tmp/sub_dir/"
//============================================================================
-string SALOMEDSImpl_Tool::GetTmpDir()
+std::string SALOMEDSImpl_Tool::GetTmpDir()
{
//Find a temporary directory to store a file
- string aTmpDir;
+ std::string aTmpDir;
char *Tmp_dir = getenv("SALOME_TMP_DIR");
if(Tmp_dir != NULL) {
- aTmpDir = string(Tmp_dir);
+ aTmpDir = std::string(Tmp_dir);
#ifdef WIN32
if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\';
#else
}
else {
#ifdef WIN32
- aTmpDir = string("C:\\");
+ aTmpDir = std::string("C:\\");
#else
- aTmpDir = string("/tmp/");
+ aTmpDir = std::string("/tmp/");
#endif
}
int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory
char buffer[127];
sprintf(buffer, "%d", aRND);
- string aSubDir(buffer);
- if(aSubDir.size() <= 1) aSubDir = string("123409876");
+ std::string aSubDir(buffer);
+ if(aSubDir.size() <= 1) aSubDir = std::string("123409876");
aTmpDir += aSubDir; //Get RND sub directory
- string aDir = aTmpDir;
+ std::string aDir = aTmpDir;
if(Exists(aDir)) {
for(aRND = 0; Exists(aDir); aRND++) {
// function : RemoveTemporaryFiles
// purpose : Removes files listed in theFileList
//============================================================================
-void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory,
- const vector<string>& theFiles,
+void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const std::string& theDirectory,
+ const std::vector<std::string>& theFiles,
const bool IsDirDeleted)
{
- string aDirName = theDirectory;
+ std::string aDirName = theDirectory;
int i, aLength = theFiles.size();
for(i=1; i<=aLength; i++) {
- string aFile(aDirName);
+ std::string aFile(aDirName);
aFile += theFiles[i-1];
if(!Exists(aFile)) continue;
// function : GetNameFromPath
// purpose : Returns the name by the path
//============================================================================
-string SALOMEDSImpl_Tool::GetNameFromPath(const string& thePath) {
+std::string SALOMEDSImpl_Tool::GetNameFromPath(const std::string& thePath) {
if (thePath.empty()) return "";
int pos = thePath.rfind('/');
if(pos > 0) return thePath.substr(pos+1, thePath.size());
// function : GetDirFromPath
// purpose : Returns the dir by the path
//============================================================================
-string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) {
+std::string SALOMEDSImpl_Tool::GetDirFromPath(const std::string& thePath) {
#ifdef WIN32
- string separator = "\\";
+ std::string separator = "\\";
#else
- string separator = "/";
+ std::string separator = "/";
#endif
- string path;
+ std::string path;
if (!thePath.empty()) {
int pos = thePath.rfind('/');
if (pos < 0) pos = thePath.rfind('\\');
if (pos > 0)
path = thePath.substr(0, pos+1);
else
- path = string(".") + separator;
+ path = std::string(".") + separator;
#ifdef WIN32 //Check if the only disk letter is given as path
if (path.size() == 2 && path[1] == ':') path += separator;
// purpose : The functions returns a list of substring of initial string
// divided by given separator
//============================================================================
-vector<string> SALOMEDSImpl_Tool::splitString(const string& theValue, char separator)
+std::vector<std::string> SALOMEDSImpl_Tool::splitString(const std::string& theValue, char separator)
{
- vector<string> vs;
+ std::vector<std::string> vs;
if(theValue[0] == separator && theValue.size() == 1) return vs;
int pos = theValue.find(separator);
if(pos < 0) {
return vs;
}
- string s = theValue;
+ std::string s = theValue;
if(s[0] == separator) s = s.substr(1, s.size());
while((pos = s.find(separator)) >= 0) {
vs.push_back(s.substr(0, pos));
// purpose : The functions returns a list of substring of initial string
// divided by given separator include empty strings
//============================================================================
-vector<string> SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep)
+std::vector<std::string> SALOMEDSImpl_Tool::splitStringWithEmpty(const std::string& theValue, char sep)
{
- vector<string> aResult;
- if(theValue[0] == sep ) aResult.push_back(string());
+ std::vector<std::string> aResult;
+ if(theValue[0] == sep ) aResult.push_back(std::string());
int pos = theValue.find(sep);
if(pos < 0 ) {
aResult.push_back(theValue);
return aResult;
}
- string s = theValue;
+ std::string s = theValue;
if(s[0] == sep) s = s.substr(1, s.size());
while((pos = s.find(sep)) >= 0) {
aResult.push_back(s.substr(0, pos));
}
if(!s.empty() && s[0] != sep) aResult.push_back(s);
- if(theValue[theValue.size()-1] == sep) aResult.push_back(string());
+ if(theValue[theValue.size()-1] == sep) aResult.push_back(std::string());
return aResult;
}
// purpose : The functions returns a list of lists of substrings of initial string
// divided by two given separators include empty strings
//============================================================================
-vector< vector<string> > SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep1, char sep2)
+std::vector< std::vector<std::string> > SALOMEDSImpl_Tool::splitStringWithEmpty(const std::string& theValue, char sep1, char sep2)
{
- vector< vector<string> > aResult;
+ std::vector< std::vector<std::string> > aResult;
if(theValue.size() > 0) {
- vector<string> aSections = splitStringWithEmpty( theValue, sep1 );
+ std::vector<std::string> aSections = splitStringWithEmpty( theValue, sep1 );
for( int i = 0, n = aSections.size(); i < n; i++ )
aResult.push_back( splitStringWithEmpty( aSections[i], sep2 ) );
}
#ifdef WIN32
# undef GetUserName
#endif
-string SALOMEDSImpl_Tool::GetUserName()
+std::string SALOMEDSImpl_Tool::GetUserName()
{
#ifdef WIN32
char* pBuff = new char[UNLEN + 1];
DWORD dwSize = UNLEN + 1;
- string retVal;
+ std::string retVal;
::GetUserNameA( pBuff, &dwSize );
- string theTmpUserName(pBuff,(int)dwSize -1 );
+ std::string theTmpUserName(pBuff,(int)dwSize -1 );
retVal = theTmpUserName;
delete [] pBuff;
return retVal;
#else
struct passwd *infos;
infos = getpwuid(getuid());
- return string(infos->pw_name);
+ return std::string(infos->pw_name);
#endif
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_Tool.hxx
// Created : Mon Oct 21 16:24:50 2002
// Author : Sergey RUIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_UseCaseBuilder.cxx
// Author : Sergey RUIN
// Module : SALOME
#include "DF_ChildIterator.hxx"
-using namespace std;
-
#define USE_CASE_LABEL_TAG 2
#define USE_CASE_GUID "AA43BB12-D9CD-11d6-945D-0050DA506788"
aNode->Remove();
- vector<DF_Attribute*> aList;
+ std::vector<DF_Attribute*> aList;
aList.push_back(aNode);
SALOMEDSImpl_AttributeReference* aRef = NULL;
* Purpose :
*/
//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::SetName(const string& theName) {
+bool SALOMEDSImpl_UseCaseBuilder::SetName(const std::string& theName) {
if(!_root) return false;
SALOMEDSImpl_AttributeName* aNameAttrib = NULL;
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_UseCaseBuilder::GetName()
+std::string SALOMEDSImpl_UseCaseBuilder::GetName()
{
- string aString;
+ std::string aString;
if(!_root) return aString;
SALOMEDSImpl_AttributeName* aName = NULL;
* Purpose :
*/
//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::AddUseCase(const string& theName)
+SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::AddUseCase(const std::string& theName)
{
- string aBasicGUID(USE_CASE_GUID);
+ std::string aBasicGUID(USE_CASE_GUID);
//Create a use cases structure if it not exists
}
-SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetSObject(const string& theEntry)
+SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetSObject(const std::string& theEntry)
{
DF_Label L = DF_Label::Label(_root->Label(), theEntry);
return SALOMEDSImpl_Study::SObject(L);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_UseCaseBuilder.hxx
// Author : Sergey RUIN
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_UseCaseIterator.cxx
// Author : Serge RUIN
// Module : SALOME
#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
//============================================================================
/*! Function : empty constructor
* Purpose :
*/
//============================================================================
SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel,
- const string& theGUID,
+ const std::string& theGUID,
const bool allLevels)
:_guid(theGUID), _levels(allLevels)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDSImpl_UseCaseIterator.hxx
// Author : Sergey RUIN
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Paul RASCLE
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMEDSImplTest.hxx"
#include <iostream>
#include "SALOMEDSImpl_StudyBuilder.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
-using namespace std;
// ============================================================================
/*!
CPPUNIT_ASSERT(_ap->IsSet("BoolValue", PT_BOOLEAN));
CPPUNIT_ASSERT(!_ap->GetBool("BoolValue"));
- vector<int> intArray;
+ std::vector<int> intArray;
intArray.push_back(0);
intArray.push_back(1);
CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[0] == 0);
CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[1] == 1);
- vector<double> realArray;
+ std::vector<double> realArray;
realArray.push_back(0.0);
realArray.push_back(1.1);
CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[0] == 0.0);
CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[1] == 1.1);
- vector<string> strArray;
+ std::vector<std::string> strArray;
strArray.push_back("hello");
strArray.push_back("world");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMEDSImplTEST_HXX_
#define _SALOMEDSImplTEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all SALOMEDSImpl Test from basics until the present directory
//
#include "SALOMEDSImplTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import orbmodule
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//File: testDS.cxx
//Author: Sergey RUIN
//
//#include "SALOMEDSImpl_.hxx"
-using namespace std;
-
int main (int argc, char * argv[])
{
- cout << "Test started " << endl;
+ std::cout << "Test started " << std::endl;
SALOMEDSImpl_StudyManager* aSM = new SALOMEDSImpl_StudyManager();
- cout << "Manager is created " << endl;
+ std::cout << "Manager is created " << std::endl;
SALOMEDSImpl_Study* aStudy = aSM->NewStudy("SRN");
- cout << "Study with id = " << aStudy->StudyId() << " is created " << endl;
+ std::cout << "Study with id = " << aStudy->StudyId() << " is created " << std::endl;
- cout << "Check the study lock, locking" << endl;
+ std::cout << "Check the study lock, locking" << std::endl;
aStudy->SetStudyLock("SRN");
- cout << "Is study locked = " << aStudy->IsStudyLocked() << endl;
- vector<string> ids = aStudy->GetLockerID();
+ std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl;
+ std::vector<std::string> ids = aStudy->GetLockerID();
for(int i = 0; i<ids.size(); i++)
- cout << "Get study locker : " << ids[i] << endl;
+ std::cout << "Get study locker : " << ids[i] << std::endl;
aStudy->UnLockStudy("SRN");
- cout << "Is study locked = " << aStudy->IsStudyLocked() << endl;
+ std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl;
SALOMEDSImpl_StudyBuilder* aBuilder = aStudy->NewBuilder();
- cout << "StudyBuilder is created " << endl;
+ std::cout << "StudyBuilder is created " << std::endl;
SALOMEDSImpl_SComponent aSC = aBuilder->NewComponent("TEST");
- cout << "New component with type " << aSC.ComponentDataType() << " is created " << endl;
+ std::cout << "New component with type " << aSC.ComponentDataType() << " is created " << std::endl;
SALOMEDSImpl_SObject aSO = aBuilder->NewObject(aSC);
- cout << "New SObject with ID = " << aSO.GetID() << " is created" << endl;
- cout << "An entry of newly created SO is " << aSO.GetLabel().Entry() << endl;
+ std::cout << "New SObject with ID = " << aSO.GetID() << " is created" << std::endl;
+ std::cout << "An entry of newly created SO is " << aSO.GetLabel().Entry() << std::endl;
SALOMEDSImpl_AttributeIOR* aIORA = SALOMEDSImpl_AttributeIOR::Set(aSO.GetLabel(), "ior1234");
- cout << "New AttributeIOR is created, it contains " << dynamic_cast<SALOMEDSImpl_AttributeIOR*>(aIORA)->Value() << endl;
- cout << "Attribute has type: " << aIORA->Type() << " and value: " << aIORA->Save() << endl;
- cout << "Just another way to create an attribute: official one :) " << endl;
- cout << "Is SO null : " << aSO.IsNull()<< endl;
+ std::cout << "New AttributeIOR is created, it contains " << dynamic_cast<SALOMEDSImpl_AttributeIOR*>(aIORA)->Value() << std::endl;
+ std::cout << "Attribute has type: " << aIORA->Type() << " and value: " << aIORA->Save() << std::endl;
+ std::cout << "Just another way to create an attribute: official one :) " << std::endl;
+ std::cout << "Is SO null : " << aSO.IsNull()<< std::endl;
DF_Attribute* aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName");
SALOMEDSImpl_AttributeName* aRN = dynamic_cast<SALOMEDSImpl_AttributeName*>(aTDFAttr);
aRN->SetValue("name_attribute");
- cout << " The type = " << aRN->Type() << endl;
- cout << "Attribute has type: " << aRN->Type() << " and value: " << aRN->Save() << endl;
- cout << "Check GetObjectPath: " << aStudy->GetObjectPath(aSO) << endl;
+ std::cout << " The type = " << aRN->Type() << std::endl;
+ std::cout << "Attribute has type: " << aRN->Type() << " and value: " << aRN->Save() << std::endl;
+ std::cout << "Check GetObjectPath: " << aStudy->GetObjectPath(aSO) << std::endl;
SALOMEDSImpl_SObject aSubSO = aBuilder->NewObject(aSO);
aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeIOR");
aBuilder->Addreference(aSubSO, aSO);
SALOMEDSImpl_SObject aRefObject;
aSubSO.ReferencedObject(aRefObject);
- cout << "Check reference : ReferencedObject is " << aRefObject.GetID() << endl;
- cout << "Check : Remove object: " << endl;
+ std::cout << "Check reference : ReferencedObject is " << aRefObject.GetID() << std::endl;
+ std::cout << "Check : Remove object: " << std::endl;
aBuilder->RemoveObject(aSubSO);
- cout << "Remove: done" << endl;
+ std::cout << "Remove: done" << std::endl;
- cout << "Try invalid attribute creation" << endl;
+ std::cout << "Try invalid attribute creation" << std::endl;
aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "invalid type");
- cout << "Address of created attribute : " << aTDFAttr << endl;
+ std::cout << "Address of created attribute : " << aTDFAttr << std::endl;
- cout << "Check AttributeUserID" << endl;
+ std::cout << "Check AttributeUserID" << std::endl;
aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeUserID");
if(aTDFAttr) {
- cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
+ std::cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << std::endl;
}
- else cout << "Can't create AttributeUserID" << endl;
+ else std::cout << "Can't create AttributeUserID" << std::endl;
- string id = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
+ std::string id = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->SetValue(id);
- cout << "SetValue id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
+ std::cout << "SetValue id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << std::endl;
- string id2 = "0e1c36e6-379b-4d90-ab3b-18a14310e648";
+ std::string id2 = "0e1c36e6-379b-4d90-ab3b-18a14310e648";
aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeUserID"+id2);
if(aTDFAttr) {
- cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
+ std::cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << std::endl;
}
- else cout << "Can't create AttributeUserID" << endl;
+ else std::cout << "Can't create AttributeUserID" << std::endl;
- cout << "Check AttributeTreeNode " << endl;
+ std::cout << "Check AttributeTreeNode " << std::endl;
aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeTreeNode");
- cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << endl;
- cout << "Check AttributeTreeNode : done " << endl;
+ std::cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << std::endl;
+ std::cout << "Check AttributeTreeNode : done " << std::endl;
aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeParameter");
- cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << endl;
+ std::cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << std::endl;
- cout << "Check the attributes on SObject" << endl;
- vector<DF_Attribute*> aSeq = aSO.GetAllAttributes();
+ std::cout << "Check the attributes on SObject" << std::endl;
+ std::vector<DF_Attribute*> aSeq = aSO.GetAllAttributes();
for(int i = 0; i < aSeq.size(); i++)
- cout << "Found: " << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i])->Type() << endl;
+ std::cout << "Found: " << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i])->Type() << std::endl;
- cout << "Check UseCase" << endl;
+ std::cout << "Check UseCase" << std::endl;
SALOMEDSImpl_UseCaseBuilder* ucb = aStudy->GetUseCaseBuilder();
ucb->AddUseCase("use_case1");
ucb->AddUseCase("use_case2");
SALOMEDSImpl_UseCaseIterator ucitr = ucb->GetUseCaseIterator(SALOMEDSImpl_SObject());
ucitr.Init(false);
- cout << "More? : " << ucitr.More() << endl;
+ std::cout << "More? : " << ucitr.More() << std::endl;
- cout << "Check AttributeParameter " << endl;
+ std::cout << "Check AttributeParameter " << std::endl;
SALOMEDSImpl_AttributeParameter* AP = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(aTDFAttr);
- cout << "AttributeParameter with type : " << AP->Type() << endl;
+ std::cout << "AttributeParameter with type : " << AP->Type() << std::endl;
AP->SetInt("1", 123);
- cout << "IsSet for int: " << AP->IsSet("1", PT_INTEGER) << " value : " << AP->GetInt("1") << endl;
+ std::cout << "IsSet for int: " << AP->IsSet("1", PT_INTEGER) << " value : " << AP->GetInt("1") << std::endl;
//for(int i = 2; i < 5; i++) AP->SetInt(i, i*i);
AP->SetReal("1", 123.123);
- cout << "IsSet for real: " << AP->IsSet("1", PT_REAL) << " value : " << AP->GetReal("1") << endl;
+ std::cout << "IsSet for real: " << AP->IsSet("1", PT_REAL) << " value : " << AP->GetReal("1") << std::endl;
//for(int i = 2; i < 5; i++) AP->SetReal(i, 0.1);
AP->SetString("1", "value is 123.123!");
- cout << "IsSet for string: " << AP->IsSet("1", PT_STRING) << " value : " << AP->GetString("1") << endl;
+ std::cout << "IsSet for string: " << AP->IsSet("1", PT_STRING) << " value : " << AP->GetString("1") << std::endl;
/*
for(int i = 2; i < 5; i++) {
- string s((double)(1.0/i));
- cout << "Setting for " << i << " value : " << s << endl;
+ std::string s((double)(1.0/i));
+ std::cout << "Setting for " << i << " value : " << s << std::endl;
AP->SetString(i, s);
}
*/
AP->SetBool("1", true);
- cout << "IsSet for bool: " << AP->IsSet("1", PT_BOOLEAN) << " value : " << AP->GetBool("1") << endl;
+ std::cout << "IsSet for bool: " << AP->IsSet("1", PT_BOOLEAN) << " value : " << AP->GetBool("1") << std::endl;
//for(int i = 2; i < 5; i++) AP->SetBool(i, 0);
- vector<double> v;
+ std::vector<double> v;
v.push_back(111.111);
v.push_back(222.22222);
v.push_back(333.3333333);
AP->SetRealArray("1", v);
- cout << "IsSet for array: " << AP->IsSet("1", PT_REALARRAY);
- vector<double> v2 = AP->GetRealArray("1");
- cout.precision(10);
- cout << " values : ";
- for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
- cout << endl;
+ std::cout << "IsSet for array: " << AP->IsSet("1", PT_REALARRAY);
+ std::vector<double> v2 = AP->GetRealArray("1");
+ std::cout.precision(10);
+ std::cout << " values : ";
+ for(int i = 0; i<v2.size(); i++) std::cout << v2[i] << " ";
+ std::cout << std::endl;
v[0] = 211.111;
v[1] = 422.22222;
v[2] = 633.3333333;
AP->SetRealArray("2", v);
- vector<int> vi;
+ std::vector<int> vi;
vi.push_back(1);
vi.push_back(2);
AP->SetIntArray("2", vi);
- vector<string> vs;
+ std::vector<std::string> vs;
vs.push_back("hello, ");
vs.push_back("world!");
AP->SetStrArray("3", vs);
- string as = AP->Save();
- cout << "AS = " << as << endl;
+ std::string as = AP->Save();
+ std::cout << "AS = " << as << std::endl;
AP->Load(as);
- cout << "Restored string with id = 1 is: " << AP->GetString("1") << endl;
- cout << "Restored int with id = 2 is: " << AP->GetInt("1") << endl;
- cout << "Restored real with id = 3 is: " << AP->GetReal("1") << endl;
- cout << "Restored bool with id = 1 is: " << AP->GetBool("1") << endl;
+ std::cout << "Restored string with id = 1 is: " << AP->GetString("1") << std::endl;
+ std::cout << "Restored int with id = 2 is: " << AP->GetInt("1") << std::endl;
+ std::cout << "Restored real with id = 3 is: " << AP->GetReal("1") << std::endl;
+ std::cout << "Restored bool with id = 1 is: " << AP->GetBool("1") << std::endl;
v2 = AP->GetRealArray("2");
- cout << "Restored real array with id = 2 is: ";
- for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
- cout << endl;
+ std::cout << "Restored real array with id = 2 is: ";
+ for(int i = 0; i<v2.size(); i++) std::cout << v2[i] << " ";
+ std::cout << std::endl;
vi = AP->GetIntArray("2");
- cout << "Restored int array with id = 2 is: ";
- for(int i = 0; i<vi.size(); i++) cout << vi[i] << " ";
- cout << endl;
+ std::cout << "Restored int array with id = 2 is: ";
+ for(int i = 0; i<vi.size(); i++) std::cout << vi[i] << " ";
+ std::cout << std::endl;
vs = AP->GetStrArray("3");
- cout << "Restored string array with id = 2 is: ";
- for(int i = 0; i<vs.size(); i++) cout << vs[i] << " ";
- cout << endl;
+ std::cout << "Restored string array with id = 2 is: ";
+ for(int i = 0; i<vs.size(); i++) std::cout << vs[i] << " ";
+ std::cout << std::endl;
- cout << "Check RemoveID 1 with type PT_INTEGER" << endl;
+ std::cout << "Check RemoveID 1 with type PT_INTEGER" << std::endl;
AP->RemoveID("1", PT_INTEGER);
- cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet("1", PT_INTEGER) << endl;
- cout << "Check RemoveID is done" << endl;
+ std::cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet("1", PT_INTEGER) << std::endl;
+ std::cout << "Check RemoveID is done" << std::endl;
- cout << "Check AttributeParameter : done" << endl;
+ std::cout << "Check AttributeParameter : done" << std::endl;
SALOMEDSImpl_SComponent tst = aBuilder->NewComponent("TEST2");
SALOMEDSImpl_ChildIterator ci=aStudy->NewChildIterator(tst);
for(ci.InitEx(true); ci.More(); ci.Next())
- cout << "######## " << ci.Value().GetID() << endl;
+ std::cout << "######## " << ci.Value().GetID() << std::endl;
DF_ChildIterator dci(tst.GetLabel(), true);
for(; dci.More(); dci.Next())
- cout << "###### DF: " << dci.Value().Entry() << endl;
+ std::cout << "###### DF: " << dci.Value().Entry() << std::endl;
- cout << "Test finished " << endl;
+ std::cout << "Test finished " << std::endl;
return 0;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : BaseTraceCollector.cxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
#include "BaseTraceCollector.hxx"
#include "LocalTraceBufferPool.hxx"
-using namespace std;
-
// Class attributes initialisation, for class method BaseTraceCollector::run
BaseTraceCollector* BaseTraceCollector::_singleton = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : BaseTraceCollector.hxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : FileTraceCollector.cxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
#include <fstream>
#include <cstdlib>
-using namespace std;
-
//#define _DEVDEBUG_
#include "FileTraceCollector.hxx"
// --- opens a file with append mode
// so, several processes can share the same file
- ofstream traceFile;
+ std::ofstream traceFile;
const char *theFileName = _fileName.c_str();
DEVTRACE("try to open trace file "<< theFileName);
- traceFile.open(theFileName, ios::out | ios::app);
+ traceFile.open(theFileName, std::ios::out | std::ios::app);
if (!traceFile)
{
- cerr << "impossible to open trace file "<< theFileName << endl;
+ std::cerr << "impossible to open trace file "<< theFileName << std::endl;
exit (1);
}
<< " : " << myTrace.trace;
#endif
traceFile.close();
- cout << flush ;
+ std::cout << std::flush ;
#ifndef WIN32
- cerr << "INTERRUPTION from thread " << myTrace.threadId
+ std::cerr << "INTERRUPTION from thread " << myTrace.threadId
<< " : " << myTrace.trace;
#else
- cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
+ std::cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
<< " : " << myTrace.trace;
#endif
- cerr << flush ;
+ std::cerr << std::flush ;
exit(1);
}
else
if (_threadId)
{
int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close FileTraceCollector : "<< ret << endl;
+ if (ret) std::cerr << "error close FileTraceCollector : "<< ret << std::endl;
else DEVTRACE("FileTraceCollector destruction OK");
delete _threadId;
_threadId = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : FileTraceCollector.hxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : Paul RASCLE (EDF)
// Module : KERNEL
// $Header$
#include "FileTraceCollector.hxx"
#include "utilities.h"
-using namespace std;
-
// In case of truncated message, end of trace contains "...\n\0"
#define TRUNCATED_MESSAGE "...\n"
{
#ifndef WIN32
void* handle;
- string impl_name = string ("lib") + traceKind
- + string("TraceCollector.so");
+ std::string impl_name = std::string ("lib") + traceKind
+ + std::string("TraceCollector.so");
handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ;
#else
HINSTANCE handle;
- string impl_name = string ("lib") + traceKind + string(".dll");
+ std::string impl_name = std::string ("lib") + traceKind + std::string(".dll");
handle = LoadLibrary( impl_name.c_str() );
#endif
if ( handle )
#endif
if ( !TraceCollectorFactory )
{
- cerr << "Can't resolve symbol: SingletonInstance" <<endl;
+ std::cerr << "Can't resolve symbol: SingletonInstance" <<std::endl;
#ifndef WIN32
- cerr << "dlerror: " << dlerror() << endl;
+ std::cerr << "dlerror: " << dlerror() << std::endl;
#endif
exit( 1 );
}
}
else
{
- cerr << "library: " << impl_name << " not found !" << endl;
+ std::cerr << "library: " << impl_name << " not found !" << std::endl;
assert(handle); // to give file and line
exit(1); // in case assert is deactivated
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : Paul RASCLE (EDF)
// Module : KERNEL
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LocalTraceCollector.cxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
#include <fstream>
#include <cstdlib>
-using namespace std;
-
#include "LocalTraceCollector.hxx"
// ============================================================================
myTraceBuffer->retrieve(myTrace);
if (myTrace.traceType == ABORT_MESS)
{
- cout << flush ;
+ std::cout << std::flush ;
#ifndef WIN32
- cerr << "INTERRUPTION from thread " << myTrace.threadId
+ std::cerr << "INTERRUPTION from thread " << myTrace.threadId
<< " : " << myTrace.trace;
#else
- cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
+ std::cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
<< " : " << myTrace.trace;
#endif
- cerr << flush ;
+ std::cerr << std::flush ;
exit(1);
}
else
{
- cout << flush ;
+ std::cout << std::flush ;
#ifndef WIN32
- cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
+ std::cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
#else
- cerr << "th. " << (void*)(&myTrace.threadId)
+ std::cerr << "th. " << (void*)(&myTrace.threadId)
<< " " << myTrace.trace;
#endif
- cerr << flush ;
+ std::cerr << std::flush ;
}
}
pthread_exit(NULL);
if (_threadId)
{
int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl;
+ if (ret) std::cerr << "error close LocalTraceCollector : "<< ret << std::endl;
else DEVTRACE("LocalTraceCollector destruction OK");
delete _threadId;
_threadId = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LocalTraceCollector.hxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOMELocalTrace : log on local machine
# File : Makefile.am
# Author : Guillaume BOULANT (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_LocalTrace.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOMELocalTrace : log on local machine
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMELocalTraceTest.hxx"
#include <iostream>
#include "LocalTraceBufferPool.hxx"
#include "utilities.h"
-using namespace std;
-
// ============================================================================
/*!
// --- trace on file
const char *theFileName = TRACEFILE;
- string s = "file:";
+ std::string s = "file:";
s += theFileName;
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
- ofstream traceFile;
- traceFile.open(theFileName, ios::out | ios::app);
+ std::ofstream traceFile;
+ traceFile.open(theFileName, std::ios::out | std::ios::app);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
void
SALOMELocalTraceTest::testLoadBufferPoolLocal()
{
- string s = "local";
+ std::string s = "local";
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
// --- numThread thread creation for trace generation.
{
const char *theFileName = TRACEFILE;
- string s = "file:";
+ std::string s = "file:";
s += theFileName;
//s = "local";
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
- ofstream traceFile;
- traceFile.open(theFileName, ios::out | ios::trunc);
+ std::ofstream traceFile;
+ traceFile.open(theFileName, std::ios::out | std::ios::trunc);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMELOCALTRACETEST_HXX_
#define _SALOMELOCALTRACETEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all Unit Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import setenv
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : utilities.h
// Author : Antoine YESSAYAN, Paul RASCLE, EDF
#ifdef WIN32
#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
- std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
+ std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
std::cerr << "ABORT return code= "<< code << std::endl; \
/*std::*/exit(code);}
#else
#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
- std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
+ std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
std::cerr << "ABORT return code= "<< code << std::endl; \
std::exit(code);}
#endif
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOMETraceCollector
# File : Makefile.am
# Author : Guillaume BOULANT, CSSI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LocalTraceCollector.cxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
#include <cstdlib>
#include <omniORB4/CORBA.h>
-using namespace std;
-
#include "SALOMETraceCollector.hxx"
#include "TraceCollector_WaitForServerReadiness.hxx"
#include <SALOMEconfig.h>
m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj);
if (CORBA::is_nil(m_pInterfaceLogger))
{
- cerr << "Logger server not found ! Abort" << endl;
- cerr << flush ;
+ std::cerr << "Logger server not found ! Abort" << std::endl;
+ std::cerr << std::flush ;
exit(1);
}
else
{
if (myTrace.traceType == ABORT_MESS)
{
- stringstream abortMessage("");
+ std::stringstream abortMessage("");
#ifndef WIN32
abortMessage << "INTERRUPTION from thread "
<< myTrace.threadId << " : " << myTrace.trace;
}
else
{
- stringstream aMessage("");
+ std::stringstream aMessage("");
#ifndef WIN32
aMessage << "th. " << myTrace.threadId
#else
if (_threadId)
{
int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl;
+ if (ret) std::cerr << "error close SALOMETraceCollector : "<< ret << std::endl;
else DEVTRACE("SALOMETraceCollector destruction OK");
delete _threadId;
_threadId = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMETraceCollector.hxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
####################################### library
# SALOMELocalTrace : log on local machine
# File : Makefile.am
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOMETraceCollectorTest.hxx"
#include <iostream>
#include "LocalTraceBufferPool.hxx"
#include "utilities.h"
-using namespace std;
// ============================================================================
/*!
void
SALOMETraceCollectorTest::testLoadBufferPoolCORBA()
{
- string s = "with_logger";
+ std::string s = "with_logger";
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
// --- NUM_THREADS thread creation for trace generation.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SALOMETRACECOLLECTORTTEST_HXX_
#define _SALOMETRACECOLLECTORTTEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all Unit Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import orbmodule
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : TraceCollector_WaitForServerReadiness.cxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
#include <omnithread/pthread_nt.h>
#endif
-using namespace std;
-
// ============================================================================
/*!
* Wait until a server is registered in naming service.
// ============================================================================
CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
- string serverName)
+ std::string serverName)
{
long TIMESleep = 500000000;
int NumberOfTries = 40;
}
catch( CORBA::SystemException& )
{
- cout << "TraceCollector_WaitForServerReadiness: "
+ std::cout << "TraceCollector_WaitForServerReadiness: "
<< "CORBA::SystemException: "
- << "Unable to contact the Naming Service" << endl;
+ << "Unable to contact the Naming Service" << std::endl;
}
catch(...)
{
- cout << "TraceCollector_WaitForServerReadiness: "
- << "Unknown exception dealing with Naming Service" << endl;
+ std::cout << "TraceCollector_WaitForServerReadiness: "
+ << "Unknown exception dealing with Naming Service" << std::endl;
}
obj=CORBA::Object::_nil();
}
catch (const CosNaming::NamingContext::NotFound&)
{
- cout << "Caught exception: Naming Service can't found Logger";
+ std::cout << "Caught exception: Naming Service can't found Logger";
}
}
#ifndef WIN32
#else
Sleep(TIMESleep / 1000000);
#endif
- cout << "TraceCollector_WaitForServerReadiness: retry look for"
- << serverName << endl;
+ std::cout << "TraceCollector_WaitForServerReadiness: retry look for"
+ << serverName << std::endl;
}
}
catch (const CosNaming::NamingContext::NotFound&)
{
- cout << "Caught exception: Naming Service can't found Logger";
+ std::cout << "Caught exception: Naming Service can't found Logger";
}
catch (CORBA::COMM_FAILURE&)
{
- cout << "Caught CORBA::SystemException CommFailure.";
+ std::cout << "Caught CORBA::SystemException CommFailure.";
}
catch (CORBA::SystemException&)
{
- cout << "Caught CORBA::SystemException.";
+ std::cout << "Caught CORBA::SystemException.";
}
catch (CORBA::Exception&)
{
- cout << "Caught CORBA::Exception.";
+ std::cout << "Caught CORBA::Exception.";
}
catch (...)
{
- cout << "Caught unknown exception.";
+ std::cout << "Caught unknown exception.";
}
return obj._retn();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LocalTrace_WaitForServerReadiness.hxx
// Author : Paul RASCLE (EDF)
// Module : KERNEL
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
#
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Tool.cxx
// Created : Mon Oct 21 16:24:34 2002
// Author : Sergey RUIN
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-using namespace std;
-
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
const SALOMEDS::ListOfFileNames& theFiles,
const bool IsDirDeleted)
{
- string aDirName = theDirectory;
+ std::string aDirName = theDirectory;
int i, aLength = theFiles.length();
for(i=1; i<=aLength; i++) {
- string aFile(aDirName);
+ std::string aFile(aDirName);
aFile += theFiles[i-1];
if(!Exists(aFile)) continue;
return (new SALOMEDS::TMPFile);
//Get a temporary directory for saved a file
- string aTmpDir = theFromDirectory;
+ std::string aTmpDir = theFromDirectory;
long aBufferSize = 0;
long aCurrentPos;
//Check if the file exists
if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ std::string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
if(!Exists(aFullPath)) continue;
#ifdef WIN32
- ifstream aFile(aFullPath.c_str(), ios::binary);
+ std::ifstream aFile(aFullPath.c_str(), std::ios::binary);
#else
- ifstream aFile(aFullPath.c_str());
+ std::ifstream aFile(aFullPath.c_str());
#endif
- aFile.seekg(0, ios::end);
+ aFile.seekg(0, std::ios::end);
aFileSize[i] = aFile.tellg();
aBufferSize += aFileSize[i]; //Add a space to store the file
}
aCurrentPos = 4;
for(i=0; i<aLength; i++) {
- ifstream *aFile;
+ std::ifstream *aFile;
if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ std::string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
if(!Exists(aFullPath)) continue;
#ifdef WIN32
- aFile = new ifstream(aFullPath.c_str(), ios::binary);
+ aFile = new std::ifstream(aFullPath.c_str(), std::ios::binary);
#else
- aFile = new ifstream(aFullPath.c_str());
+ aFile = new std::ifstream(aFullPath.c_str());
#endif
}
//Initialize 4 bytes of the buffer by 0
memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
aCurrentPos += 8;
- aFile->seekg(0, ios::beg);
+ aFile->seekg(0, std::ios::beg);
aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
aFile->close();
delete(aFile);
return aFiles;
//Get a temporary directory for saving a file
- string aTmpDir = theToDirectory;
+ std::string aTmpDir = theToDirectory;
unsigned char *aBuffer = (unsigned char*)theStream.NP_data();
memcpy(&aFileSize, (aBuffer + aCurrentPos), ((sizeof(long) > 8) ? 8 : sizeof(long)));
aCurrentPos += 8;
- string aFullPath = aTmpDir + aFileName;
+ std::string aFullPath = aTmpDir + aFileName;
#ifdef WIN32
- ofstream aFile(aFullPath.c_str(), ios::binary);
+ std::ofstream aFile(aFullPath.c_str(), std::ios::binary);
#else
- ofstream aFile(aFullPath.c_str());
+ std::ofstream aFile(aFullPath.c_str());
#endif
aFile.write((char *)(aBuffer+aCurrentPos), aFileSize);
aFile.close();
//============================================================================
std::string SALOMEDS_Tool::GetNameFromPath(const std::string& thePath) {
if (thePath.empty()) return "";
- string aPath = thePath;
+ std::string aPath = thePath;
bool isFound = false;
int pos = aPath.rfind('/');
if(pos > 0) {
if (thePath.empty()) return "";
int pos = thePath.rfind('/');
- string path;
+ std::string path;
if(pos > 0) {
path = thePath.substr(0, pos+1);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOMEDS_Tool.hxx
// Created : Mon Oct 21 16:24:50 2002
// Author : Sergey RUIN
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME TestContainer : test of container creation and its life cycle
# File : Makefile.in
# Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TestContainer : test of container creation and its life cycle
// File : SALOME_TestComponent.hxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME TestContainer : test of container creation and its life cycle
# File : SALOME_TestComponentPy.py
# Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TestContainer : test of container creation and its life cycle
// File : SALOME_TestComponent_i.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
#include <stdio.h>
#include <cstdlib>
#include <map>
-using namespace std;
Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
void Engines_TestComponent_i::Setenv()
{
// bool overwrite = true;
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
MESSAGE("set environment associated with keys in map _fieldsDict");
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TestContainer : test of container creation and its life cycle
// File : SALOME_TestComponent_i.hxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
#! /usr/bin/env python
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME TestContainer : test of container creation and its life cycle
# File : TestComponentPy.py
# Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TestContainer : test of container creation and its life cycle
// File : TestContainer.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
Engines::TestComponent_ptr create_instance(Engines::Container_ptr iGenFact,
std::string componenttName)
{
+ char* reason;
#if defined(_DEBUG_) || defined(_DEBUG)
bool isLib =
- iGenFact->load_component_Library(componenttName.c_str());
- // iGenFact->load_component_Library("SalomeTestComponent");
+ iGenFact->load_component_Library(componenttName.c_str(),reason);
ASSERT(isLib);
#else
- iGenFact->load_component_Library(componenttName.c_str());
+ iGenFact->load_component_Library(componenttName.c_str(),reason);
#endif
- CORBA::Object_var obj =
- // iGenFact->create_component_instance("SalomeTestComponent",
- iGenFact->create_component_instance(componenttName.c_str(),
- 0);
+ CORBA::string_free(reason);
+ CORBA::Object_var obj = iGenFact->create_component_instance(componenttName.c_str(), 0);
Engines::TestComponent_var anInstance = Engines::TestComponent::_narrow(obj);
MESSAGE("create anInstance");
SCRUTE(anInstance->instanceName());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TestContainer : test of container creation and its life cycle
// File : TestContainer.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
from SALOME_utilities import *
MESSAGE("TestLogger.py : It's OK")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME MPIContainer : implemenation of container based on MPI libraries
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//=============================================================================
// File : TestMPIComponentEngine.cxx
// Created : mer jui 4 12:28:26 CEST 2003
#include <mpi.h>
#include "utilities.h"
#include "TestMPIComponentEngine.hxx"
-using namespace std;
TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc,
CORBA::ORB_ptr orb,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//=============================================================================
// File : TestMPIComponentEngine.hxx
// Created : mer jui 4 12:28:30 CEST 2003
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// using namespace std;
+
//=============================================================================
// File : TestMPIContainer.cxx
// Created : mer jui 4 13:11:27 CEST 2003
# include "Utils_SINGLETON.hxx"
#include "SALOME_NamingService.hxx"
#include "OpUtil.hxx"
-using namespace std;
int main (int argc, char * argv[])
{
int status;
if( argc != 3 || strcmp(argv[1],"-np") ){
- cout << "Usage: TestMPIContainer -np nbproc" << endl;
+ std::cout << "Usage: TestMPIContainer -np nbproc" << std::endl;
exit(0);
}
// Use Name Service to find container
SALOME_NamingService NS(orb) ;
- string containerName = "/Containers/" ;
- string hostName = Kernel_Utils::GetHostname();
+ std::string containerName = "/Containers/" ;
+ std::string hostName = Kernel_Utils::GetHostname();
containerName += hostName + "/MPIFactoryServer_" + argv[2];
- string dirn(getenv("KERNEL_ROOT_DIR"));
+ std::string dirn(getenv("KERNEL_ROOT_DIR"));
dirn += "/lib/salome/libSalomeTestMPIComponentEngine.so";
// Try to resolve MPI Container
if(CORBA::is_nil(iGenFact)){
// Launch MPI Container
- string cmd("mpirun -np ");
+ std::string cmd("mpirun -np ");
cmd += argv[2];
cmd += " ";
cmd += getenv("KERNEL_ROOT_DIR");
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all Unit Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import setenv
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Utils : general SALOME's definitions and tools
# File : Makefile.am
# Author : Guillaume Boulant (CSSI)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : OpUtil.cxx
// Module : SALOME
#else
#include <winsock2.h>
#endif
-using namespace std;
+
//int gethostname(char *name, size_t len);
std::string GetHostname()
char *aDot = (strchr(s,'.'));
if (aDot) aDot[0] = '\0';
- string p = s;
+ std::string p = s;
delete [] s;
return p;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : OpUtil.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Utils.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Utils : general SALOME's definitions and tools
# File : SALOME_utilities.py
# Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
####################################### library
# SALOMELocalTrace : log on local machine
# File : Makefile.am
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all Unit Test from basics until the present directory
//
#include "SALOMELocalTraceTest.hxx"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import orbmodule
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "UtilsTest.hxx"
#include <iostream>
#include "Utils_SALOME_Exception.hxx"
#include "utilities.h"
-using namespace std;
#define TRACEFILE "/tmp/traceUnitTest.log"
// --- trace on file
const char *theFileName = TRACEFILE;
- string s = "file:";
+ std::string s = "file:";
s += theFileName;
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
- ofstream traceFile;
- traceFile.open(theFileName, ios::out | ios::app);
+ std::ofstream traceFile;
+ traceFile.open(theFileName, std::ios::out | std::ios::app);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
}
catch (const SALOME_Exception &ex)
{
- string expectedMessage = EXAMPLE_EXCEPTION_MESSAGE;
- string actualMessage = ex.what();
- CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != string::npos);
+ std::string expectedMessage = EXAMPLE_EXCEPTION_MESSAGE;
+ std::string actualMessage = ex.what();
+ CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != std::string::npos);
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _UTILSTEST_HXX_
#define _UTILSTEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_CommException.cxx
// Author : Antoine YESSAYAN, EDF
// $Header$
//
# include "Utils_CommException.hxx"
-using namespace std;
CommException::CommException( void ): SALOME_Exception( "CommException" )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_CommException.hxx
// Author : Antoine YESSAYAN, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_CorbaException.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_DESTRUCTEUR_GENERIQUE.cxx
// Author : Antoine YESSAYAN, EDF
// static int MYDEBUG = 0;
#endif
-using namespace std;
-
std::list<DESTRUCTEUR_GENERIQUE_*> *DESTRUCTEUR_GENERIQUE_::Destructeurs=0 ;
/*! \class ATEXIT_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_DESTRUCTEUR_GENERIQUE.hxx
// Author : Antoine YESSAYAN, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: Utils_ExceptHandler.cxx
// Created: Mon Mar 15 10:23:41 2004
// Author: Oksana TCHEBANOVA
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
-using namespace std;
-
void SalomeException ()
{
throw SALOME_Exception("Salome Exception");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// KERNEL Utils : common utils for KERNEL
// File : Utils_ExceptHandlers.hxx
// Author : Oksana Tchebanova
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_Identity.cxx
// Author : Pascale NOYRET, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_Identity.hxx
// Author : Pascale NOYRET, EDF
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Utils : general SALOME's definitions and tools
# File : Utils_Identity.py
# Author : Estelle Deville, CEA
# Module : SALOME
# $Header$
-#
## @package Utils_Identity
# \brief Module to get information about user and version
#
-#
-
import sys
import os
import socket
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File: Utils_Mutex.cxx
// Author: Sergey ANIKIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File: Utils_Mutex.hxx
// Author: Sergey ANIKIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_ORB_INIT.cxx
// Author : Antoine YESSAYAN, EDF
_orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ;
#endif
}
- catch( const CORBA::Exception &ex )
+ catch( const CORBA::Exception & )
{
throw CommException( "Unable to create an ORB connexion" ) ;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_ORB_INIT.hxx
// Author : Antoine YESSAYAN, EDF
#include "Utils_CommException.hxx"
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
/*!
* Ce composant prend en charge la connexion et la deconnexion a l'orb
* Il est souhaitable de l'utiliser dans un SINGLETON.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_SALOME_Exception.cxx
// Author : Antoine YESSAYAN, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_SALOME_Exception.hxx
// Author : Antoine YESSAYAN, EDF
# define UTILS_EXPORT __declspec( dllexport )
# else
# define UTILS_EXPORT __declspec( dllimport )
+# undef LOCALIZED
# define LOCALIZED(message) #message
# endif
#else
SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
SALOME_Exception( const SALOME_Exception &ex );
virtual ~SALOME_Exception() throw ();
- friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
+ UTILS_EXPORT friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
virtual const char *what( void ) const throw () ;
} ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_SINGLETON.hxx
// Author : Antoine YESSAYAN, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_Timer.cxx
// Module : SALOME
#ifndef WIN32
unsigned long Absolute_user = (unsigned long) ((timeval*)RefToCurrentTimeB)->tv_sec ;
#else
- unsigned long Absolute_user = *RefToCurrentTimeB;
+ unsigned long Absolute_user = (unsigned long) *RefToCurrentTimeB;
#endif
MESSAGE("Absolute time: " << Absolute_user << " seconds ");
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : Utils_Timer.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Utils : general SALOME's definitions and tools
// File : duplicate.cxx
// Author : Antoine YESSAYAN, EDF
#include "utilities.h"
#include "OpUtil.hxx"
-using namespace std;
-
const char* duplicate( const char *const str )
{
ASSERT(str!=NULL) ;
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
from distutils.core import setup, Extension
module1 = Extension('win32pm',
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <Python.h>
#include <windows.h>