comName=`which $0`
rep=`dirname $comName`
-cp -r $rep/appliskel $1
-chmod +x $1/*.sh $1/run* $1/envd
+if [ $# -ne 1 ]
+ echo "--- usage:"
+ echo $0 AppliName
+ echo "--- In which AppliName is a directory to create with SALOME application scripts"
+elif [ -d $1]
+ echo $1 "directory already exists, nothing done"
+else
+ mkdir -p $1
+ cp -r $rep/appliskel/* $1
+ cp $rep/appliskel/.bashrc $1
+ chmod +x $1/*.sh $1/run* $1/envd
+fi
\ No newline at end of file
to_remove_list=[]
for module in modules_list :
- module_variable=module.upper()+"_ROOT_DIR"
+ module_variable=module+"_ROOT_DIR"
if not os.environ.has_key(module_variable):
print "*******************************************************"
print "*"
pass
if args.has_key("SMESH_plugins"):
for plugin in args["SMESH_plugins"]:
- if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
+ plugin_root = ""
+ if os.environ.has_key(plugin+"_ROOT_DIR"):
+ plugin_root = os.environ[plugin+"_ROOT_DIR"]
+ else:
+ # workaround to avoid modifications of existing environment
+ if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
+ plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
+ pass
+ pass
+ if plugin_root != "":
os.environ["SMESH_MeshersList"] \
= os.environ["SMESH_MeshersList"]+":"+plugin
- plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
if not os.environ.has_key("SALOME_"+plugin+"Resources"):
os.environ["SALOME_"+plugin+"Resources"] \
= plugin_root+"/share/"+args["appname"]+"/resources"
<BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
*/
- void Save(in Study aStudy, in boolean theMultiFile);
+ boolean Save(in Study aStudy, in boolean theMultiFile);
/*! \brief Saving a study in a ASCII file (or files).
Saves a study in an ASCII format file (or files).
\param theMultiFile If this parameter is True the study will be saved in several files.
*/
- void SaveASCII(in Study aStudy, in boolean theMultiFile);
+ boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
/*! \brief Saving the study in a specified HDF file (or files).
Saves the study in a specified file (or files).
<BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
*/
- void SaveAs(in URL aUrl, // if the file already exists
+ boolean SaveAs(in URL aUrl, // if the file already exists
in Study aStudy,
in boolean theMultiFile); // overwrite (as option)
/*! \brief Saving the study in a specified ASCII file (or files).
\param aStudy The study which will be saved
\param theMultiFile If this parameter is True the study will be saved in several files.
*/
- void SaveAsASCII(in URL aUrl, // if the file already exists
+ boolean SaveAsASCII(in URL aUrl, // if the file already exists
in Study aStudy,
in boolean theMultiFile); // overwrite (as option)
AC_SUBST(BOOST_CPPFLAGS)
BOOST_CPPFLAGS=""
+
+AC_SUBST(BOOST_LIBS)
+BOOST_LIBS=""
+
+AC_SUBST(BOOST_LIBTHREAD)
+BOOST_LIBTHREAD=""
+
boost_ok=no
if test -z ${BOOSTDIR}; then
fi
else
AC_MSG_RESULT(\$BOOSTDIR = ${BOOSTDIR})
- AC_CHECKING(for boost/shared_ptr.hpp header file)
+
dnl BOOST headers
+ AC_CHECKING(for boost/shared_ptr.hpp header file)
CPPFLAGS_old="${CPPFLAGS}"
- BOOST_CPPFLAGS="-I${BOOSTDIR}"
+ BOOST_CPPFLAGS="-I${BOOSTDIR}/include"
CPPFLAGS="${CPPFLAGS} ${BOOST_CPPFLAGS}"
AC_CHECK_HEADER(boost/shared_ptr.hpp,boost_ok=yes,boost_ok=no)
CPPFLAGS="${CPPFLAGS_old}"
+
+ if test "x${boost_ok}" = "xyes" ; then
+ AC_MSG_RESULT(\$BOOST_CPPFLAGS = ${BOOST_CPPFLAGS})
+ dnl BOOST libs
+ AC_CHECKING(for libboost_thread-mt.so library file)
+ AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread-mt.so,boost_ok=yes,boost_ok=no)
+ if test "x${boost_ok}" = "xyes" ; then
+ BOOST_LIBS="-L${BOOSTDIR}/lib"
+ AC_MSG_RESULT(\$BOOST_LIBS = ${BOOST_LIBS})
+ BOOST_LIBTHREAD="libboost_thread-mt.so"
+ AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD})
+ else
+ AC_CHECKING(for libboost_thread.so library file)
+ AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread.so,boost_ok=yes,boost_ok=no)
+ if test "x${boost_ok}" = "xyes" ; then
+ BOOST_LIBS="-L${BOOSTDIR}/lib"
+ AC_MSG_RESULT(\$BOOST_LIBS = ${BOOST_LIBS})
+ BOOST_LIBTHREAD="libboost_thread.so"
+ AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD})
+ fi
+ fi
+ fi
fi
+AC_MSG_RESULT(for boost: $boost_ok)
+
AC_LANG_RESTORE
])dnl
AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no")
if test "$WITHLAM" = "yes";then
MPI_LIBS="-lmpi $MPI_LIBS"
+ LIBS="-lmpi $LIBS"
fi
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ LIBS="-llammpi++ $LIBS"
+ AC_MSG_CHECKING(for MPI_Init in -llammpi++)
+ AC_TRY_LINK([
+ #include <mpi.h>
+ ], [MPI::Init();],
+ WITHLAM="yes",WITHLAM="no")
+ if test "$WITHLAM" = "yes";then
+ AC_MSG_RESULT(yes)
+ MPI_LIBS="-llammpi++ $MPI_LIBS"
+ else
+ AC_MSG_RESULT(no)
+ fi
+ AC_LANG_RESTORE
+
AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
fi
AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
AC_CHECK_LIB(pthread,pthread_mutex_lock,
LIBS_PTHREADS="-lpthread $LIBS_PTHREADS",LIBS_PTHREADS="")
+else
+ LDFLAGS="-pthread $LDFLAGS"
fi
if test $flag = no && x$LIBS_PTHREADS = x; then
# BOOST Library
BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LIBS = @BOOST_LIBS@
# OpenPBS
else if(!CORBA::is_nil(mpi_ptr))
{
CORBA::release(sender);
- MPIReceiver<double,MPI_DOUBLE,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
+ MPIReceiver<double,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
return rec.getValue(size);
}
#endif
else if(!CORBA::is_nil(mpi_ptr))
{
CORBA::release(sender);
- MPIReceiver<int,MPI_INT,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
+ MPIReceiver<int,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
return rec.getValue(size);
}
#endif
#ifdef HAVE_MPI2
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
_mySender->release();
}
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
int i=0;
int myproc;
int sproc;
}
MPI_Recv( &_n, 1, MPI_LONG, sproc,p->tag1,com,&status);
_v = new T[_n];
- MPI_Recv( _v, _n, T2, sproc,p->tag2,com,&status);
+ MPI_Recv( _v, _n, MPITRAITS<T>::MpiType, sproc,p->tag2,com,&status);
_mySender->close(p);
MPI_Comm_disconnect( &com );
size=_n;
return _v;
}
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getValue(long &size)
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
/*!
Receiver for MPI transfert.
*/
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+template<class T>
+struct MPITRAITS
+{
+ static MPI_Datatype MpiType;
+};
+
+template<>
+MPI_Datatype MPITRAITS<double>::MpiType=MPI_DOUBLE;
+
+template<>
+MPI_Datatype MPITRAITS<int>::MpiType=MPI_INT;
+
+template<class T,class CorbaSender,class servForT,class ptrForT>
class MPIReceiver : public Receiver<T,servForT,ptrForT>
{
private:
void SALOME_MPISender_i::send()
{
_type=getTypeOfDataTransmitted();
- _argsForThr=new (void *)[8];
+ _argsForThr=new void *[8];
_argsForThr[0]=_portName;
_argsForThr[1]=&_lgrTabToSend;
_argsForThr[2]=(void *)_tabToSend;
// Module : SALOME
#include "SALOMEDS_AttributeComment.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributeComment::Value()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->Value()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeComment)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
else aValue = SALOMEDS::AttributeComment::_narrow(_corba_impl)->Value();
return aValue;
}
void SALOMEDS_AttributeComment::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
else SALOMEDS::AttributeComment::_narrow(_corba_impl)->SetValue(value.c_str());
}
// Module : SALOME
#include "SALOMEDS_AttributeDrawable.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
bool SALOMEDS_AttributeDrawable::IsDrawable()
{
bool aValue;
- if(_isLocal) aValue = (bool)Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_local_impl)->IsDrawable();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = (bool)Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_local_impl)->IsDrawable();
+ }
else aValue = SALOMEDS::AttributeDrawable::_narrow(_corba_impl)->IsDrawable();
return aValue;
}
-
+
void SALOMEDS_AttributeDrawable::SetDrawable(bool value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_local_impl)->SetDrawable((int)value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_local_impl)->SetDrawable((int)value);
+ }
else SALOMEDS::AttributeDrawable::_narrow(_corba_impl)->SetDrawable(value);
}
using namespace std;
-CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable()
+CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable()
{
SALOMEDS::Locker lock;
return (Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_impl)->IsDrawable() == 1);
}
-
-void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value)
+
+void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value)
{
SALOMEDS::Locker lock;
CheckLocked();
Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_impl)->SetDrawable(value);
}
-
// Module : SALOME
#include "SALOMEDS_AttributeExpandable.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
-SALOMEDS_AttributeExpandable::SALOMEDS_AttributeExpandable(const Handle(SALOMEDSImpl_AttributeExpandable)& theAttr)
+SALOMEDS_AttributeExpandable::SALOMEDS_AttributeExpandable
+ (const Handle(SALOMEDSImpl_AttributeExpandable)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
bool SALOMEDS_AttributeExpandable::IsExpandable()
{
bool aValue;
- if(_isLocal) aValue = (bool)Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_local_impl)->IsExpandable();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = (bool)Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_local_impl)->IsExpandable();
+ }
else aValue = SALOMEDS::AttributeExpandable::_narrow(_corba_impl)->IsExpandable();
return aValue;
}
-
+
void SALOMEDS_AttributeExpandable::SetExpandable(bool value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_local_impl)->SetExpandable((int)value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_local_impl)->SetExpandable((int)value);
+ }
else SALOMEDS::AttributeExpandable::_narrow(_corba_impl)->SetExpandable(value);
}
using namespace std;
-CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable()
+CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable()
{
SALOMEDS::Locker lock;
return (Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_impl)->IsExpandable() == 1);
}
-
-void SALOMEDS_AttributeExpandable_i::SetExpandable(CORBA::Boolean value)
+
+void SALOMEDS_AttributeExpandable_i::SetExpandable(CORBA::Boolean value)
{
SALOMEDS::Locker lock;
CheckLocked();
Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_impl)->SetExpandable(value);
}
-
// Module : SALOME
#include "SALOMEDS_AttributeExternalFileDef.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributeExternalFileDef::Value()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->Value()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeExternalFileDef)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
else aValue = SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->Value();
return aValue;
}
void SALOMEDS_AttributeExternalFileDef::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
else SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->SetValue(value.c_str());
}
// Module : SALOME
#include "SALOMEDS_AttributeFileType.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributeFileType::Value()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->Value()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeFileType)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
else aValue = SALOMEDS::AttributeFileType::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeFileType::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
else SALOMEDS::AttributeFileType::_narrow(_corba_impl)->SetValue(value.c_str());
}
// Module : SALOME
#include "SALOMEDS_AttributeFlags.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
int SALOMEDS_AttributeFlags::GetFlags()
{
int aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl)->Get();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl)->Get();
+ }
else aValue = SALOMEDS::AttributeFlags::_narrow(_corba_impl)->GetFlags();
return aValue;
}
void SALOMEDS_AttributeFlags::SetFlags(int theFlags)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl)->Set(theFlags);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl)->Set(theFlags);
+ }
else SALOMEDS::AttributeFlags::_narrow(_corba_impl)->SetFlags(theFlags);
}
void SALOMEDS_AttributeFlags::Set(int theFlag, bool theValue)
{
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeFlags) anAttr = Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl);
- if ( theValue )
- anAttr->Set( anAttr->Get() | theFlag );
+ if (theValue)
+ anAttr->Set(anAttr->Get() | theFlag);
else
- anAttr->Set( anAttr->Get() & ~theFlag );
+ anAttr->Set(anAttr->Get() & ~theFlag);
}
else SALOMEDS::AttributeFlags::_narrow(_corba_impl)->Set(theFlag, theValue);
}
// Module : SALOME
#include "SALOMEDS_AttributeGraphic.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
{}
-bool SALOMEDS_AttributeGraphic:: GetVisibility(int theViewId)
+bool SALOMEDS_AttributeGraphic::GetVisibility(int theViewId)
{
bool aValue;
- if(_isLocal) aValue = (bool)Handle(SALOMEDSImpl_AttributeGraphic)::DownCast(_local_impl)->GetVisibility(theViewId);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = (bool)Handle(SALOMEDSImpl_AttributeGraphic)::DownCast(_local_impl)->GetVisibility(theViewId);
+ }
else aValue = SALOMEDS::AttributeGraphic::_narrow(_corba_impl)->GetVisibility(theViewId);
return aValue;
}
-
+
void SALOMEDS_AttributeGraphic::SetVisibility(int theViewId, bool theValue)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeGraphic)::DownCast(_local_impl)->SetVisibility(theViewId, theValue);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeGraphic)::DownCast(_local_impl)->SetVisibility(theViewId, theValue);
+ }
else SALOMEDS::AttributeGraphic::_narrow(_corba_impl)->SetVisibility(theViewId, theValue);
}
// Module : SALOME
#include "SALOMEDS_AttributeIOR.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributeIOR::Value()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->Value()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeIOR)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
else aValue = SALOMEDS::AttributeIOR::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeIOR::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
else SALOMEDS::AttributeIOR::_narrow(_corba_impl)->SetValue(value.c_str());
}
// Module : SALOME
#include "SALOMEDS_AttributeInteger.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
int SALOMEDS_AttributeInteger::Value()
{
int aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->Value();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->Value();
+ }
else aValue = SALOMEDS::AttributeInteger::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeInteger::SetValue(int value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->SetValue(value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->SetValue(value);
+ }
else SALOMEDS::AttributeInteger::_narrow(_corba_impl)->SetValue(value);
}
// Module : SALOME
#include "SALOMEDS_AttributeLocalID.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
int SALOMEDS_AttributeLocalID::Value()
{
int aValue;
- if(_isLocal) aValue = (bool)Handle(SALOMEDSImpl_AttributeLocalID)::DownCast(_local_impl)->Value();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = (bool)Handle(SALOMEDSImpl_AttributeLocalID)::DownCast(_local_impl)->Value();
+ }
else aValue = SALOMEDS::AttributeLocalID::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeLocalID::SetValue(int value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeLocalID)::DownCast(_local_impl)->SetValue(value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeLocalID)::DownCast(_local_impl)->SetValue(value);
+ }
else SALOMEDS::AttributeLocalID::_narrow(_corba_impl)->SetValue(value);
}
// Module : SALOME
#include "SALOMEDS_AttributeName.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributeName::Value()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->Value()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeName)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
else aValue = SALOMEDS::AttributeName::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeName::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
else SALOMEDS::AttributeName::_narrow(_corba_impl)->SetValue(value.c_str());
}
// Module : SALOME
#include "SALOMEDS_AttributeOpened.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
bool SALOMEDS_AttributeOpened::IsOpened()
{
bool aValue;
- if(_isLocal) aValue = (bool)Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_local_impl)->IsOpened();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = (bool)Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_local_impl)->IsOpened();
+ }
else aValue = SALOMEDS::AttributeOpened::_narrow(_corba_impl)->IsOpened();
return aValue;
}
-
+
void SALOMEDS_AttributeOpened::SetOpened(bool value)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_local_impl)->SetOpened((int)value);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_local_impl)->SetOpened((int)value);
+ }
else SALOMEDS::AttributeOpened::_narrow(_corba_impl)->SetOpened(value);
}
// Module : SALOME
#include "SALOMEDS_AttributePersistentRef.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributePersistentRef::Value()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->Value()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePersistentRef)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
else aValue = SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributePersistentRef::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
else SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->SetValue(value.c_str());
}
// Module : SALOME
#include "SALOMEDS_AttributePixMap.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
bool SALOMEDS_AttributePixMap::HasPixMap()
{
bool ret;
- if(_isLocal) ret = Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->HasPixMap();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->HasPixMap();
+ }
else ret = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->HasPixMap();
return ret;
}
std::string SALOMEDS_AttributePixMap::GetPixMap()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->GetPixMap()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::
+ DownCast(_local_impl)->GetPixMap()).ToCString();
+ }
else aValue = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->GetPixMap();
return aValue;
}
-
+
void SALOMEDS_AttributePixMap::SetPixMap(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->SetPixMap((char*)value.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->SetPixMap((char*)value.c_str());
+ }
else SALOMEDS::AttributePixMap::_narrow(_corba_impl)->SetPixMap(value.c_str());
}
#include "SALOMEDS_AttributePixMap_i.hxx"
#include "SALOMEDS.hxx"
+
#include <TCollection_AsciiString.hxx>
using namespace std;
-CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap()
+CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap()
{
+ SALOMEDS::Locker lock;
return Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->HasPixMap();
}
-char* SALOMEDS_AttributePixMap_i::GetPixMap()
+char* SALOMEDS_AttributePixMap_i::GetPixMap()
{
SALOMEDS::Locker lock;
- CORBA::String_var S =
- CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->GetPixMap()).ToCString());
+ CORBA::String_var S =
+ CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::
+ DownCast(_impl)->GetPixMap()).ToCString());
return S._retn();
}
-void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value)
+void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value)
{
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->SetPixMap(TCollection_ExtendedString(Str));
}
-
// Module : SALOME
#include "SALOMEDS_AttributePythonObject.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
bool SALOMEDS_AttributePythonObject::IsScript()
{
bool ret;
- if(_isLocal) ret = Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->IsScript();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->IsScript();
+ }
else ret = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->IsScript();
return ret;
}
std::string SALOMEDS_AttributePythonObject::GetObject()
{
std::string aValue;
- if(_isLocal)
- aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->GetObject()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePythonObject)::
+ DownCast(_local_impl)->GetObject()).ToCString();
+ }
else aValue = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->GetObject();
return aValue;
}
-
+
void SALOMEDS_AttributePythonObject::SetObject(const std::string& theSequence, bool IsScript)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->SetObject((char*)theSequence.c_str(), IsScript);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributePythonObject)::
+ DownCast(_local_impl)->SetObject((char*)theSequence.c_str(), IsScript);
+ }
else SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->SetObject(theSequence.c_str(), IsScript);
}
// Module : SALOME
#include "SALOMEDS_AttributeReal.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
double SALOMEDS_AttributeReal::Value()
{
double aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeReal)::DownCast(_local_impl)->Value();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeReal)::DownCast(_local_impl)->Value();
+ }
else aValue = SALOMEDS::AttributeReal::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeReal::SetValue(double value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeReal)::DownCast(_local_impl)->SetValue(value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeReal)::DownCast(_local_impl)->SetValue(value);
+ }
else SALOMEDS::AttributeReal::_narrow(_corba_impl)->SetValue(value);
}
// Module : SALOME
#include "SALOMEDS_AttributeSelectable.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
bool SALOMEDS_AttributeSelectable::IsSelectable()
{
bool aValue;
- if(_isLocal) aValue = (bool)Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_local_impl)->IsSelectable();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = (bool)Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_local_impl)->IsSelectable();
+ }
else aValue = SALOMEDS::AttributeSelectable::_narrow(_corba_impl)->IsSelectable();
return aValue;
}
-
+
void SALOMEDS_AttributeSelectable::SetSelectable(bool value)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_local_impl)->SetSelectable((int)value);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_local_impl)->SetSelectable((int)value);
+ }
else SALOMEDS::AttributeSelectable::_narrow(_corba_impl)->SetSelectable(value);
}
// Module : SALOME
#include "SALOMEDS_AttributeSequenceOfInteger.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
-SALOMEDS_AttributeSequenceOfInteger
-::SALOMEDS_AttributeSequenceOfInteger(const Handle(SALOMEDSImpl_AttributeSequenceOfInteger)& theAttr)
+SALOMEDS_AttributeSequenceOfInteger::SALOMEDS_AttributeSequenceOfInteger
+ (const Handle(SALOMEDSImpl_AttributeSequenceOfInteger)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
-SALOMEDS_AttributeSequenceOfInteger::SALOMEDS_AttributeSequenceOfInteger(SALOMEDS::AttributeSequenceOfInteger_ptr theAttr)
+SALOMEDS_AttributeSequenceOfInteger::SALOMEDS_AttributeSequenceOfInteger
+ (SALOMEDS::AttributeSequenceOfInteger_ptr theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
void SALOMEDS_AttributeSequenceOfInteger::Assign(const std::vector<int>& other)
{
int i, aLength = other.size();
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
- for(i = 0; i < aLength; i++) aSeq->Append(other[i]);
+ for (i = 0; i < aLength; i++) aSeq->Append(other[i]);
Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Assign(aSeq);
}
else {
SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = other[i];
+ for (i = 0; i < aLength; i++) aSeq[i] = other[i];
SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Assign(aSeq);
}
}
{
std::vector<int> aVector;
int i, aLength;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeSequenceOfInteger) aSeqAttr;
aSeqAttr = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl);
aLength = aSeqAttr->Length();
- for(i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
+ for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
}
else {
- SALOMEDS::AttributeSequenceOfInteger_var aSeqAttr = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl);
+ SALOMEDS::AttributeSequenceOfInteger_var aSeqAttr =
+ SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl);
aLength = aSeqAttr->Length();
- for(i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
+ for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
}
return aVector;
}
-
+
void SALOMEDS_AttributeSequenceOfInteger::Add(int value)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Add(value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Add(value);
+ }
else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Add(value);
}
void SALOMEDS_AttributeSequenceOfInteger::Remove(int index)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Remove(index);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Remove(index);
+ }
else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Remove(index);
}
-
+
void SALOMEDS_AttributeSequenceOfInteger::ChangeValue(int index, int value)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->ChangeValue(index, value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->ChangeValue(index, value);
+ }
else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->ChangeValue(index, value);
}
-
+
int SALOMEDS_AttributeSequenceOfInteger::Value(int index)
{
int aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Value(index);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Value(index);
+ }
else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Value(index);
return aValue;
}
-
+
int SALOMEDS_AttributeSequenceOfInteger::Length()
{
int aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)-> Length();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)-> Length();
+ }
else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)-> Length();
return aValue;
}
// Module : SALOME
#include "SALOMEDS_AttributeSequenceOfReal.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HSequenceOfReal.hxx>
-SALOMEDS_AttributeSequenceOfReal
-::SALOMEDS_AttributeSequenceOfReal(const Handle(SALOMEDSImpl_AttributeSequenceOfReal)& theAttr)
+SALOMEDS_AttributeSequenceOfReal::SALOMEDS_AttributeSequenceOfReal
+ (const Handle(SALOMEDSImpl_AttributeSequenceOfReal)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
-SALOMEDS_AttributeSequenceOfReal::SALOMEDS_AttributeSequenceOfReal(SALOMEDS::AttributeSequenceOfReal_ptr theAttr)
+SALOMEDS_AttributeSequenceOfReal::SALOMEDS_AttributeSequenceOfReal
+ (SALOMEDS::AttributeSequenceOfReal_ptr theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
void SALOMEDS_AttributeSequenceOfReal::Assign(const std::vector<double>& other)
{
int i, aLength = other.size();
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfReal) aSeq = new TColStd_HSequenceOfReal;
- for(i = 0; i < aLength; i++) aSeq->Append(other[i]);
+ for (i = 0; i < aLength; i++) aSeq->Append(other[i]);
Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Assign(aSeq);
}
else {
SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = other[i];
+ for (i = 0; i < aLength; i++) aSeq[i] = other[i];
SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Assign(aSeq);
}
}
{
std::vector<double> aVector;
int i, aLength;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeSequenceOfReal) aSeqAttr;
aSeqAttr = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl);
aLength = aSeqAttr->Length();
- for(i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
+ for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
}
else {
SALOMEDS::AttributeSequenceOfReal_var aSeqAttr = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl);
aLength = aSeqAttr->Length();
- for(i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
+ for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
}
return aVector;
}
-
+
void SALOMEDS_AttributeSequenceOfReal::Add(double value)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Add(value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Add(value);
+ }
else SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Add(value);
}
void SALOMEDS_AttributeSequenceOfReal::Remove(int index)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Remove(index);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Remove(index);
+ }
else SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Remove(index);
}
-
+
void SALOMEDS_AttributeSequenceOfReal::ChangeValue(int index, double value)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->ChangeValue(index, value);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->ChangeValue(index, value);
+ }
else SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->ChangeValue(index, value);
}
-
+
double SALOMEDS_AttributeSequenceOfReal::Value(int index)
{
double aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Value(index);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)->Value(index);
+ }
else aValue = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Value(index);
return aValue;
}
-
+
int SALOMEDS_AttributeSequenceOfReal::Length()
{
int aValue;
- if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)-> Length();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_local_impl)-> Length();
+ }
else aValue = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)-> Length();
return aValue;
}
// Module : SALOME
#include "SALOMEDS_AttributeStudyProperties.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
void SALOMEDS_AttributeStudyProperties::SetUserName(const std::string& theName)
{
if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeStudyProperties) anImpl =
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl);
anImpl->ChangeCreatorName((char*)theName.c_str());
{
std::string aName;
if (_isLocal) {
+ SALOMEDS::Locker lock;
TCollection_ExtendedString S =
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->GetCreatorName();
aName = TCollection_AsciiString(S).ToCString();
(int theMinute, int theHour, int theDay, int theMonth, int theYear)
{
if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeStudyProperties) anImpl =
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl);
int aTmp;
{
bool ret;
if (_isLocal) {
+ SALOMEDS::Locker lock;
ret = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast
(_local_impl)->GetCreationDate(theMinute, theHour, theDay, theMonth, theYear);
} else {
void SALOMEDS_AttributeStudyProperties::SetCreationMode(const std::string& theMode)
{
if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
if (theMode == "from scratch")
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetCreationMode(1);
else if (theMode == "copy from")
{
std::string aMode;
if (_isLocal) {
+ SALOMEDS::Locker lock;
int mode = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->GetCreationMode();
if (mode == 1) aMode = "from scratch";
if (mode == 2) aMode = "copy from";
void SALOMEDS_AttributeStudyProperties::SetModified(int theModified)
{
- if (_isLocal)
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetModified(theModified);
+ }
else
SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModified(theModified);
}
bool SALOMEDS_AttributeStudyProperties::IsModified()
{
bool ret;
- if (_isLocal)
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
ret = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->IsModified();
+ }
else
ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->IsModified();
return ret;
int SALOMEDS_AttributeStudyProperties::GetModified()
{
int isModified;
- if (_isLocal)
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
isModified = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->GetModified();
+ }
else
isModified = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetModified();
return isModified;
void SALOMEDS_AttributeStudyProperties::SetLocked(bool theLocked)
{
- if (_isLocal)
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetLocked(theLocked);
+ }
else
SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetLocked(theLocked);
}
bool SALOMEDS_AttributeStudyProperties::IsLocked()
{
bool ret;
- if (_isLocal)
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
ret = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->IsLocked();
+ }
else
ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->IsLocked();
return ret;
int theYear)
{
if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeStudyProperties) anImpl =
Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl);
anImpl->SetModification((char*)theName.c_str(), theMinute, theHour, theDay, theMonth, theYear);
int i, aLength;
if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aNames;
Handle(TColStd_HSequenceOfInteger) aMinutes, aHours, aDays, aMonths, aYears;
Handle(SALOMEDSImpl_AttributeStudyProperties) anImpl =
// Module : SALOME
#include "SALOMEDS_AttributeTableOfInteger.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HSequenceOfExtendedString.hxx>
-SALOMEDS_AttributeTableOfInteger
-::SALOMEDS_AttributeTableOfInteger(const Handle(SALOMEDSImpl_AttributeTableOfInteger)& theAttr)
+SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
+ (const Handle(SALOMEDSImpl_AttributeTableOfInteger)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
-SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger(SALOMEDS::AttributeTableOfInteger_ptr theAttr)
+SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
+ (SALOMEDS::AttributeTableOfInteger_ptr theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
void SALOMEDS_AttributeTableOfInteger::SetTitle(const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
}
std::string SALOMEDS_AttributeTableOfInteger::GetTitle()
{
std::string aStr;
- if(_isLocal)
- aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetTitle()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfInteger)::
+ DownCast(_local_impl)->GetTitle()).ToCString();
+ }
else aStr = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetTitle();
return aStr;
}
void SALOMEDS_AttributeTableOfInteger::SetRowTitle(int theIndex, const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowTitle(theIndex,
- (char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfInteger)::
+ DownCast(_local_impl)->SetRowTitle(theIndex, (char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
}
void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vector<std::string>& theTitles)
{
- CheckLocked();
int aLength = theTitles.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowTitles(aSeq);
}
else {
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetRowTitles();
aLength = aSeq->Length();
void SALOMEDS_AttributeTableOfInteger::SetColumnTitle(int theIndex, const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal)
- Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetColumnTitle(theIndex,
- (char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfInteger)::
+ DownCast(_local_impl)->SetColumnTitle(theIndex, (char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
}
void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vector<std::string>& theTitles)
{
- CheckLocked();
int aLength = theTitles.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetColumnTitles(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str();
SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitles(aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetColumnTitles();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumnTitles();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
void SALOMEDS_AttributeTableOfInteger::SetRowUnit(int theIndex, const std::string& theUnit)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowUnit(theIndex,
- (char*)theUnit.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfInteger)::
+ DownCast(_local_impl)->SetRowUnit(theIndex, (char*)theUnit.c_str());
+ }
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
}
void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vector<std::string>& theUnits)
{
- CheckLocked();
int aLength = theUnits.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theUnits[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theUnits[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowUnits(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnits(aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetRowUnits();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowUnits();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
int SALOMEDS_AttributeTableOfInteger::GetNbRows()
{
int aNb;
- if(_isLocal) aNb = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetNbRows();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aNb = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetNbRows();
+ }
else aNb = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetNbRows();
return aNb;
}
int SALOMEDS_AttributeTableOfInteger::GetNbColumns()
{
int aNb;
- if(_isLocal) aNb = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetNbColumns();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aNb = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetNbColumns();
+ }
else aNb = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetNbColumns();
return aNb;
void SALOMEDS_AttributeTableOfInteger::AddRow(const std::vector<int>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfInteger) aRow = new TColStd_HSequenceOfInteger;
void SALOMEDS_AttributeTableOfInteger::SetRow(int theRow, const std::vector<int>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfInteger) aRow = new TColStd_HSequenceOfInteger;
else {
SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = theData[i];
+ for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRow(theRow, aSeq);
}
}
{
std::vector<int> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfInteger) aRow;
aRow = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetRowData(theRow);
aLength = aRow->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aRow->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aRow->Value(i));
}
else {
SALOMEDS::LongSeq_var aRow = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRow(theRow);
- for(i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
+ for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
}
return aVector;
void SALOMEDS_AttributeTableOfInteger::AddColumn(const std::vector<int>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfInteger) aColumn = new TColStd_HSequenceOfInteger;
void SALOMEDS_AttributeTableOfInteger::SetColumn(int theColumn, const std::vector<int>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfInteger) aColumn = new TColStd_HSequenceOfInteger;
else {
SALOMEDS::LongSeq_var aColumn = new SALOMEDS::LongSeq();
aColumn->length(aLength);
- for(i = 0; i < aLength; i++) aColumn[i] = theData[i];
+ for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRow(theColumn, aColumn);
}
}
{
std::vector<int> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfInteger) aColumn;
aColumn = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetColumnData(theColumn);
aLength = aColumn->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aColumn->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aColumn->Value(i));
}
else {
SALOMEDS::LongSeq_var aColumn = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumn(theColumn);
- for(i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
+ for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
}
return aVector;
}
void SALOMEDS_AttributeTableOfInteger::PutValue(int theValue, int theRow, int theColumn)
{
- CheckLocked();
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
try {
- Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->PutValue(theValue, theRow, theColumn);
- }
+ Handle(SALOMEDSImpl_AttributeTableOfInteger)::
+ DownCast(_local_impl)->PutValue(theValue, theRow, theColumn);
+ }
catch(...) {
throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
}
bool SALOMEDS_AttributeTableOfInteger::HasValue(int theRow, int theColumn)
{
bool ret;
- if(_isLocal) ret = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->HasValue(theRow, theColumn);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->HasValue(theRow, theColumn);
+ }
else ret = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->HasValue(theRow, theColumn);
return ret;
}
int SALOMEDS_AttributeTableOfInteger::GetValue(int theRow, int theColumn)
{
int aValue;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
- aValue = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetValue(theRow, theColumn);
+ aValue = Handle(SALOMEDSImpl_AttributeTableOfInteger)::
+ DownCast(_local_impl)->GetValue(theRow, theColumn);
}
catch(...) {
throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
{
std::vector<int> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfInteger) aSet;
aSet = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetSetRowIndices(theRow);
aLength = aSet->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aSet->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSet->Value(i));
}
else {
- SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowSetIndices(theRow);
- for(i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowSetIndices(theRow);
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
}
return aVector;
}
void SALOMEDS_AttributeTableOfInteger::SetNbColumns(int theNbColumns)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetNbColumns(theNbColumns);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetNbColumns(theNbColumns);
+ }
else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
}
// Module : SALOME
#include "SALOMEDS_AttributeTableOfReal.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HSequenceOfExtendedString.hxx>
-SALOMEDS_AttributeTableOfReal
-::SALOMEDS_AttributeTableOfReal(const Handle(SALOMEDSImpl_AttributeTableOfReal)& theAttr)
+SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal
+ (const Handle(SALOMEDSImpl_AttributeTableOfReal)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
void SALOMEDS_AttributeTableOfReal::SetTitle(const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
}
std::string SALOMEDS_AttributeTableOfReal::GetTitle()
{
std::string aStr;
- if(_isLocal)
- aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetTitle()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfReal)::
+ DownCast(_local_impl)->GetTitle()).ToCString();
+ }
else aStr = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetTitle();
return aStr;
}
void SALOMEDS_AttributeTableOfReal::SetRowTitle(int theIndex, const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowTitle(theIndex,
- (char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfReal)::
+ DownCast(_local_impl)->SetRowTitle(theIndex, (char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
}
{
CheckLocked();
int aLength = theTitles.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowTitles(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitles(aSeq);
}
-
}
std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetRowTitles()
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetRowTitles();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowTitles();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
void SALOMEDS_AttributeTableOfReal::SetColumnTitle(int theIndex, const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetColumnTitle(theIndex,
- (char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfReal)::
+ DownCast(_local_impl)->SetColumnTitle(theIndex, (char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
}
void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vector<std::string>& theTitles)
{
- CheckLocked();
int aLength = theTitles.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetColumnTitles(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitles(aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetColumnTitles();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumnTitles();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
void SALOMEDS_AttributeTableOfReal::SetRowUnit(int theIndex, const std::string& theUnit)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowUnit(theIndex,
- (char*)theUnit.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfReal)::
+ DownCast(_local_impl)->SetRowUnit(theIndex, (char*)theUnit.c_str());
+ }
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
}
void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector<std::string>& theUnits)
{
- CheckLocked();
int aLength = theUnits.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theUnits[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theUnits[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowUnits(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnits(aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetRowUnits();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnits();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back(TCollection_AsciiString((char*)aSeq[i].in()).ToCString());
+ for (i = 0; i < aLength; i++) aVector.push_back(TCollection_AsciiString((char*)aSeq[i].in()).ToCString());
}
return aVector;
}
int SALOMEDS_AttributeTableOfReal::GetNbRows()
{
int aNb;
- if(_isLocal) aNb = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetNbRows();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aNb = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetNbRows();
+ }
else aNb = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetNbRows();
return aNb;
}
int SALOMEDS_AttributeTableOfReal::GetNbColumns()
{
int aNb;
- if(_isLocal) aNb = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetNbColumns();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aNb = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetNbColumns();
+ }
else aNb = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetNbColumns();
return aNb;
-
}
void SALOMEDS_AttributeTableOfReal::AddRow(const std::vector<double>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfReal) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfReal) aRow = new TColStd_HSequenceOfReal;
else {
SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = theData[i];
+ for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->AddRow(aSeq);
}
}
void SALOMEDS_AttributeTableOfReal::SetRow(int theRow, const std::vector<double>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfReal) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfReal) aRow = new TColStd_HSequenceOfReal;
else {
SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = theData[i];
+ for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRow(theRow, aSeq);
}
}
{
std::vector<double> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfReal) aRow;
aRow = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetRowData(theRow);
aLength = aRow->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aRow->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aRow->Value(i));
}
else {
SALOMEDS::DoubleSeq_var aRow = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRow(theRow);
- for(i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
+ for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
}
return aVector;
void SALOMEDS_AttributeTableOfReal::AddColumn(const std::vector<double>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfReal) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfReal) aColumn = new TColStd_HSequenceOfReal;
else {
SALOMEDS::DoubleSeq_var aColumn = new SALOMEDS::DoubleSeq();
aColumn->length(aLength);
- for(i = 0; i < aLength; i++) aColumn[i] = theData[i];
+ for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->AddColumn(aColumn);
}
}
void SALOMEDS_AttributeTableOfReal::SetColumn(int theColumn, const std::vector<double>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfReal) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfReal) aColumn = new TColStd_HSequenceOfReal;
else {
SALOMEDS::DoubleSeq_var aColumn = new SALOMEDS::DoubleSeq();
aColumn->length(aLength);
- for(i = 0; i < aLength; i++) aColumn[i] = theData[i];
+ for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRow(theColumn, aColumn);
}
}
{
std::vector<double> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfReal) aColumn;
aColumn = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetColumnData(theColumn);
aLength = aColumn->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aColumn->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aColumn->Value(i));
}
else {
SALOMEDS::DoubleSeq_var aColumn = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumn(theColumn);
- for(i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
+ for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
}
return aVector;
}
void SALOMEDS_AttributeTableOfReal::PutValue(double theValue, int theRow, int theColumn)
{
- CheckLocked();
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
try {
- Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->PutValue(theValue, theRow, theColumn);
+ Handle(SALOMEDSImpl_AttributeTableOfReal)::
+ DownCast(_local_impl)->PutValue(theValue, theRow, theColumn);
}
catch(...) {
throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
bool SALOMEDS_AttributeTableOfReal::HasValue(int theRow, int theColumn)
{
bool ret;
- if(_isLocal) ret = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->HasValue(theRow, theColumn);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->HasValue(theRow, theColumn);
+ }
else ret = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->HasValue(theRow, theColumn);
return ret;
}
double SALOMEDS_AttributeTableOfReal::GetValue(int theRow, int theColumn)
{
double aValue;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
aValue = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetValue(theRow, theColumn);
}
{
std::vector<int> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfInteger) aSet;
aSet = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetSetRowIndices(theRow);
aLength = aSet->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aSet->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSet->Value(i));
}
else {
SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowSetIndices(theRow);
- for(i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
}
return aVector;
}
void SALOMEDS_AttributeTableOfReal::SetNbColumns(int theNbColumns)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetNbColumns(theNbColumns);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetNbColumns(theNbColumns);
+ }
else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
}
// Module : SALOME
#include "SALOMEDS_AttributeTableOfString.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
#include <TColStd_HSequenceOfReal.hxx>
#include <TColStd_HSequenceOfExtendedString.hxx>
-SALOMEDS_AttributeTableOfString
-::SALOMEDS_AttributeTableOfString(const Handle(SALOMEDSImpl_AttributeTableOfString)& theAttr)
+SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString
+ (const Handle(SALOMEDSImpl_AttributeTableOfString)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
-SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString(SALOMEDS::AttributeTableOfString_ptr theAttr)
+SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString
+ (SALOMEDS::AttributeTableOfString_ptr theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
void SALOMEDS_AttributeTableOfString::SetTitle(const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
}
std::string SALOMEDS_AttributeTableOfString::GetTitle()
{
std::string aStr;
- if(_isLocal)
- aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetTitle()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->GetTitle()).ToCString();
+ }
else aStr = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetTitle();
return aStr;
}
void SALOMEDS_AttributeTableOfString::SetRowTitle(int theIndex, const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowTitle(theIndex,
- (char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->SetRowTitle(theIndex, (char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
}
void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vector<std::string>& theTitles)
{
- CheckLocked();
int aLength = theTitles.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowTitles(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitles(aSeq);
}
-
}
std::vector<std::string> SALOMEDS_AttributeTableOfString::GetRowTitles()
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetRowTitles();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowTitles();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
void SALOMEDS_AttributeTableOfString::SetColumnTitle(int theIndex, const std::string& theTitle)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetColumnTitle(theIndex,
- (char*)theTitle.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->SetColumnTitle(theIndex, (char*)theTitle.c_str());
+ }
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
}
void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vector<std::string>& theTitles)
{
- CheckLocked();
int aLength = theTitles.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theTitles[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetColumnTitles(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitles(aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetColumnTitles();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumnTitles();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
void SALOMEDS_AttributeTableOfString::SetRowUnit(int theIndex, const std::string& theUnit)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowUnit(theIndex,
- (char*)theUnit.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->SetRowUnit(theIndex, (char*)theUnit.c_str());
+ }
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
}
void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector<std::string>& theUnits)
{
- CheckLocked();
int aLength = theUnits.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString;
- for(i = 0; i < aLength; i++) aSeq->Append((char*)theUnits[i].c_str());
+ for (i = 0; i < aLength; i++) aSeq->Append((char*)theUnits[i].c_str());
Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowUnits(aSeq);
}
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnits(aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetRowUnits();
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowUnits();
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
int SALOMEDS_AttributeTableOfString::GetNbRows()
{
int aNb;
- if(_isLocal) aNb = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetNbRows();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aNb = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetNbRows();
+ }
else aNb = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetNbRows();
return aNb;
}
int SALOMEDS_AttributeTableOfString::GetNbColumns()
{
int aNb;
- if(_isLocal) aNb = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetNbColumns();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aNb = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetNbColumns();
+ }
else aNb = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetNbColumns();
return aNb;
-
}
void SALOMEDS_AttributeTableOfString::AddRow(const std::vector<std::string>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfString) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfExtendedString) aRow = new TColStd_HSequenceOfExtendedString;
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddRow(aSeq);
}
}
void SALOMEDS_AttributeTableOfString::SetRow(int theRow, const std::vector<std::string>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfString) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfExtendedString) aRow = new TColStd_HSequenceOfExtendedString;
else {
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str();
+ for (i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theRow, aSeq);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aRow;
aRow = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetRowData(theRow);
aLength = aRow->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aRow->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(TCollection_AsciiString(aRow->Value(i)).ToCString());
}
else {
SALOMEDS::StringSeq_var aRow = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRow(theRow);
- for(i = 0; i < aLength; i++) aVector.push_back((char*)aRow[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aRow[i].in());
}
return aVector;
void SALOMEDS_AttributeTableOfString::AddColumn(const std::vector<std::string>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfString) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfExtendedString) aColumn = new TColStd_HSequenceOfExtendedString;
else {
SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq();
aColumn->length(aLength);
- for(i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str();
+ for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddColumn(aColumn);
}
}
void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector<std::string>& theData)
{
- CheckLocked();
int aLength = theData.size(), i;
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTableOfString) aTable;
aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl);
Handle(TColStd_HSequenceOfExtendedString) aColumn = new TColStd_HSequenceOfExtendedString;
else {
SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq();
aColumn->length(aLength);
- for(i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str();
+ for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str();
SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theColumn, aColumn);
}
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfExtendedString) aColumn;
- aColumn = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetColumnData(theColumn);
+ aColumn = Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->GetColumnData(theColumn);
aLength = aColumn->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aColumn->Value(i)).ToCString());
+ for (i = 1; i <= aLength; i++)
+ aVector.push_back(TCollection_AsciiString(aColumn->Value(i)).ToCString());
}
else {
- SALOMEDS::StringSeq_var aColumn = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumn(theColumn);
- for(i = 0; i < aLength; i++) aVector.push_back(aColumn[i].in());
+ SALOMEDS::StringSeq_var aColumn =
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumn(theColumn);
+ for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i].in());
}
return aVector;
}
void SALOMEDS_AttributeTableOfString::PutValue(const std::string& theValue, int theRow, int theColumn)
{
- CheckLocked();
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
try {
- Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->PutValue((char*)theValue.c_str(),
- theRow,
- theColumn);
+ Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->PutValue((char*)theValue.c_str(), theRow, theColumn);
}
catch(...) {
throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
bool SALOMEDS_AttributeTableOfString::HasValue(int theRow, int theColumn)
{
bool ret;
- if(_isLocal) ret = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->HasValue(theRow, theColumn);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->HasValue(theRow, theColumn);
+ }
else ret = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->HasValue(theRow, theColumn);
return ret;
}
std::string SALOMEDS_AttributeTableOfString::GetValue(int theRow, int theColumn)
{
std::string aValue;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
- aValue =
- TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetValue(theRow,
- theColumn)).ToCString();
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfString)::
+ DownCast(_local_impl)->GetValue(theRow, theColumn)).ToCString();
}
catch(...) {
throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
{
std::vector<int> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfInteger) aSet;
aSet = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetSetRowIndices(theRow);
aLength = aSet->Length();
- for(i = 1; i<= aLength; i++) aVector.push_back(aSet->Value(i));
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSet->Value(i));
}
else {
- SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowSetIndices(theRow);
- for(i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
+ SALOMEDS::LongSeq_var aSet =
+ SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowSetIndices(theRow);
+ for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
}
return aVector;
}
void SALOMEDS_AttributeTableOfString::SetNbColumns(int theNbColumns)
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetNbColumns(theNbColumns);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetNbColumns(theNbColumns);
+ }
else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
}
// Module : SALOME
#include "SALOMEDS_AttributeTarget.hxx"
+#include "SALOMEDS.hxx"
#include <TColStd_HSequenceOfTransient.hxx>
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Add(aSO->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Add(aSO->GetLocalImpl());
+ }
else SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Add(aSO->GetCORBAImpl());
}
int aLength, i;
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) {
- Handle(TColStd_HSequenceOfTransient) aSeq = Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Get();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(TColStd_HSequenceOfTransient) aSeq =
+ Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Get();
aLength = aSeq->Length();
- for(i=1; i<=aLength; i++) {
+ for (i = 1; i <= aLength; i++) {
aSO = new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)));
aVector.push_back(_PTR(SObject)(aSO));
}
SALOMEDS::Study::ListOfSObject_var aSeq = SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Get();
aLength = aSeq->length();
aSO = new SALOMEDS_SObject(aSeq[i].in());
- for(i = 0; i<aLength; i++) aVector.push_back(_PTR(SObject)(aSO));
+ for (i = 0; i < aLength; i++) aVector.push_back(_PTR(SObject)(aSO));
}
return aVector;
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Remove(aSO->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Remove(aSO->GetLocalImpl());
+ }
else SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Remove(aSO->GetCORBAImpl());
}
-
// Module : SALOME
#include "SALOMEDS_AttributeTextColor.hxx"
+#include "SALOMEDS.hxx"
#include <TColStd_HArray1OfReal.hxx>
-SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor(const Handle(SALOMEDSImpl_AttributeTextColor)& theAttr)
+SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor
+ (const Handle(SALOMEDSImpl_AttributeTextColor)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
STextColor SALOMEDS_AttributeTextColor::TextColor()
{
STextColor aColor;
- if(_isLocal) {
- Handle(TColStd_HArray1OfReal) aSeq = Handle(SALOMEDSImpl_AttributeTextColor)::DownCast(_local_impl)->TextColor();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(TColStd_HArray1OfReal) aSeq =
+ Handle(SALOMEDSImpl_AttributeTextColor)::DownCast(_local_impl)->TextColor();
aColor.R = aSeq->Value(1);
aColor.G = aSeq->Value(2);
aColor.B = aSeq->Value(3);
}
return aColor;
}
-
+
void SALOMEDS_AttributeTextColor::SetTextColor(STextColor value)
{
- CheckLocked();
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HArray1OfReal) aSeq = new TColStd_HArray1OfReal(1, 3);
aSeq->SetValue(1, value.R);
aSeq->SetValue(2, value.G);
// Module : SALOME
#include "SALOMEDS_AttributeTextHighlightColor.hxx"
+#include "SALOMEDS.hxx"
#include <TColStd_HArray1OfReal.hxx>
-SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor(const Handle(SALOMEDSImpl_AttributeTextHighlightColor)& theAttr)
+SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor
+ (const Handle(SALOMEDSImpl_AttributeTextHighlightColor)& theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
-SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor(SALOMEDS::AttributeTextHighlightColor_ptr theAttr)
+SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor
+ (SALOMEDS::AttributeTextHighlightColor_ptr theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
STextColor SALOMEDS_AttributeTextHighlightColor::TextHighlightColor()
{
STextColor aColor;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HArray1OfReal) aSeq;
aSeq = Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast(_local_impl)->TextHighlightColor();
aColor.R = aSeq->Value(1);
aColor.B = aSeq->Value(3);
}
else {
- SALOMEDS::Color anImplColor = SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->TextHighlightColor();
+ SALOMEDS::Color anImplColor =
+ SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->TextHighlightColor();
aColor.R = anImplColor.R;
aColor.G = anImplColor.G;
aColor.B = anImplColor.B;
}
return aColor;
}
-
+
void SALOMEDS_AttributeTextHighlightColor::SetTextHighlightColor(STextColor value)
{
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(TColStd_HArray1OfReal) aSeq = new TColStd_HArray1OfReal(1, 3);
aSeq->SetValue(1, value.R);
aSeq->SetValue(2, value.G);
// Module : SALOME
#include "SALOMEDS_AttributeTreeNode.hxx"
+#include "SALOMEDS.hxx"
#include <string>
+
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_GUID.hxx>
void SALOMEDS_AttributeTreeNode::SetFather(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aFather;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aFather = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
bool SALOMEDS_AttributeTreeNode::HasFather()
{
bool ret;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
ret = aNode->HasFather();
}
else {
_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFather()
{
SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFather());
}
else {
void SALOMEDS_AttributeTreeNode::SetPrevious(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aPrev;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aPrev = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
bool SALOMEDS_AttributeTreeNode::HasPrevious()
{
bool ret;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
ret = aNode->HasPrevious();
}
else {
_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetPrevious()
{
SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aTN = new SALOMEDS_AttributeTreeNode(aNode->GetPrevious());
}
else {
void SALOMEDS_AttributeTreeNode::SetNext(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aNext;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aNext = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
bool SALOMEDS_AttributeTreeNode::HasNext()
{
bool ret;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
ret = aNode->HasNext();
}
else {
_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetNext()
{
SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aTN = new SALOMEDS_AttributeTreeNode(aNode->GetNext());
}
else {
void SALOMEDS_AttributeTreeNode::SetFirst(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aFirst;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aFirst = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
bool SALOMEDS_AttributeTreeNode::HasFirst()
{
bool ret;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
ret = aNode->HasFirst();
}
else {
_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFirst()
{
SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFirst());
}
else {
void SALOMEDS_AttributeTreeNode::SetTreeID(const std::string& value)
{
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
aNode->SetTreeID(Standard_GUID((char*)value.c_str()));
}
else {
std::string SALOMEDS_AttributeTreeNode::GetTreeID()
{
TCollection_AsciiString aGUID;
- if(_isLocal) {
- Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode) aNode =
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
char guid[40];
aNode->GetTreeID().ToCString(guid);
aGUID = TCollection_AsciiString(guid);
void SALOMEDS_AttributeTreeNode::Append(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
void SALOMEDS_AttributeTreeNode::Prepend(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
void SALOMEDS_AttributeTreeNode::InsertBefore(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
void SALOMEDS_AttributeTreeNode::InsertAfter(const _PTR(AttributeTreeNode)& value)
{
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
void SALOMEDS_AttributeTreeNode::Remove()
{
- if(_isLocal) Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl)->Remove();
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl)->Remove();
+ }
else SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Remove();
}
int SALOMEDS_AttributeTreeNode::Depth()
{
int aDepth;
- if(_isLocal) aDepth = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl)->Depth();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aDepth = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl)->Depth();
+ }
else aDepth = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Depth();
return aDepth;
}
bool SALOMEDS_AttributeTreeNode::IsRoot()
{
bool ret;
- if(_isLocal) ret = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl)->IsRoot();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl)->IsRoot();
+ }
else ret = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->IsRoot();
return ret;
}
{
bool ret;
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
{
bool ret;
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
{
bool ret;
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther;
aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl);
anOther = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(aTN->_local_impl);
std::string SALOMEDS_AttributeTreeNode::Label()
{
- TCollection_AsciiString aLabel;
- if(_isLocal) TDF_Tool::Entry(_local_impl->Label(), aLabel);
+ string aLabel;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ TCollection_AsciiString anAsciiLabel;
+ TDF_Tool::Entry(_local_impl->Label(), anAsciiLabel);
+ aLabel = std::string(anAsciiLabel.ToCString());
+ }
else aLabel = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Label();
- return std::string(aLabel.ToCString());
+ return aLabel;
}
-
-
// Module : SALOME
#include "SALOMEDS_AttributeUserID.hxx"
+#include "SALOMEDS.hxx"
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_AttributeUserID::Value()
{
std::string aValue;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
char guid[40];
Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->Value().ToCString(guid);
aValue = std::string(guid);
else aValue = SALOMEDS::AttributeUserID::_narrow(_corba_impl)->Value();
return aValue;
}
-
+
void SALOMEDS_AttributeUserID::SetValue(const std::string& value)
{
- CheckLocked();
- if(_isLocal) Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->SetValue(Standard_GUID((char*)value.c_str()));
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeUserID)::
+ DownCast(_local_impl)->SetValue(Standard_GUID((char*)value.c_str()));
+ }
else SALOMEDS::AttributeUserID::_narrow(_corba_impl)->SetValue(value.c_str());
}
#include "SALOMEDS_ChildIterator.hxx"
#include "SALOMEDS_SObject.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const Handle(SALOMEDSImpl_ChildIterator)& theIterator)
{
+ SALOMEDS::Locker lock;
+
_isLocal = true;
_local_impl = theIterator;
_corba_impl = SALOMEDS::ChildIterator::_nil();
void SALOMEDS_ChildIterator::Init()
{
- if(_isLocal) _local_impl->Init();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Init();
+ }
else _corba_impl->Init();
}
void SALOMEDS_ChildIterator::InitEx(bool theAllLevels)
{
- if(_isLocal) _local_impl->InitEx(theAllLevels);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->InitEx(theAllLevels);
+ }
else _corba_impl->InitEx(theAllLevels);
}
bool SALOMEDS_ChildIterator::More()
{
bool ret;
- if(_isLocal) ret = _local_impl->More();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->More();
+ }
else ret = _corba_impl->More();
return ret;
}
void SALOMEDS_ChildIterator::Next()
{
- if(_isLocal) _local_impl->Next();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Next();
+ }
else _corba_impl->Next();
}
_PTR(SObject) SALOMEDS_ChildIterator::Value()
{
SALOMEDSClient_SObject* aSO;
- if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->Value());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aSO = new SALOMEDS_SObject(_local_impl->Value());
+ }
else aSO = new SALOMEDS_SObject(_corba_impl->Value());
return _PTR(SObject)(aSO);
}
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
SALOMEDS::TMPFile_var aStream;
CORBA::String_var url = CORBA::string_dup(theURL.ToCString());
- SALOMEDS::unlock();
+ SALOMEDS::unlock();
aStream = _driver->Save(sco.in(), url, isMultiFile);
+ SALOMEDS::lock();
theStreamLength = aStream->length();
unsigned char* aRetStream = NULL;
- if(theStreamLength > 0) {
+ if (theStreamLength > 0) {
aRetStream = new unsigned char[theStreamLength];
memcpy(aRetStream, aStream->NP_data(), theStreamLength);
}
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
SALOMEDS::TMPFile_var aStream;
CORBA::String_var url = CORBA::string_dup(theURL.ToCString());
- SALOMEDS::unlock();
+ SALOMEDS::unlock();
aStream = _driver->SaveASCII(sco.in(), url, isMultiFile);
+ SALOMEDS::lock();
theStreamLength = aStream->length();
unsigned char* aRetStream = NULL;
- if(theStreamLength > 0) {
+ if (theStreamLength > 0) {
aRetStream = new unsigned char[theStreamLength];
memcpy(aRetStream, aStream->NP_data(), theStreamLength);
}
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
CORBA::String_var url = CORBA::string_dup(theURL.ToCString());
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
+ CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
SALOMEDS::TMPFile_var aStream;
- if(theStreamLength > 0)
+ if (theStreamLength > 0)
aStream = new SALOMEDS::TMPFile(theStreamLength, theStreamLength, anOctetBuf, 0);
else
aStream = new SALOMEDS::TMPFile(0);
- SALOMEDS::unlock();
- return _driver->Load(sco.in(), aStream.in(), url, isMultiFile);
+ SALOMEDS::unlock();
+ bool isOk = _driver->Load(sco.in(), aStream.in(), url, isMultiFile);
+ SALOMEDS::lock();
+ return isOk;
}
bool SALOMEDS_Driver_i::LoadASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
CORBA::String_var url = CORBA::string_dup(theURL.ToCString());
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
+ CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
SALOMEDS::TMPFile_var aStream;
if(theStreamLength > 0)
else
aStream = new SALOMEDS::TMPFile(0);
- SALOMEDS::unlock();
- return _driver->LoadASCII(sco.in(), aStream.in(), url, isMultiFile);
+ SALOMEDS::unlock();
+ bool isOk = _driver->LoadASCII(sco.in(), aStream.in(), url, isMultiFile);
+ SALOMEDS::lock();
+ return isOk;
}
void SALOMEDS_Driver_i::Close(const Handle(SALOMEDSImpl_SComponent)& theComponent)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
- SALOMEDS::unlock();
+ SALOMEDS::unlock();
_driver->Close(sco.in());
+ SALOMEDS::lock();
}
-
+
TCollection_AsciiString SALOMEDS_Driver_i::IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theSObject, _orb);
CORBA::String_var ior = CORBA::string_dup(IORString.ToCString());
- SALOMEDS::unlock();
+ SALOMEDS::unlock();
CORBA::String_var pers_string =_driver->IORToLocalPersistentID(so.in(), ior.in(), isMultiFile, isASCII);
+ SALOMEDS::lock();
return TCollection_AsciiString(pers_string);
}
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
CORBA::String_var pers_string = CORBA::string_dup(aLocalPersistentID.ToCString());
- SALOMEDS::unlock();
- CORBA::String_var IOR =_driver->LocalPersistentIDToIOR(so.in(), pers_string.in(), isMultiFile, isASCII);
+ SALOMEDS::unlock();
+ CORBA::String_var IOR = _driver->LocalPersistentIDToIOR(so.in(), pers_string.in(), isMultiFile, isASCII);
+ SALOMEDS::lock();
return TCollection_AsciiString(IOR);
}
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
SALOMEDS::unlock();
- return _driver->CanCopy(so.in());
+ bool isOk = _driver->CanCopy(so.in());
+ SALOMEDS::lock();
+ return isOk;
}
SALOMEDS::unlock();
aStream = _driver->CopyFrom(so.in(), anObjectID);
+ SALOMEDS::lock();
theObjectID = anObjectID;
theStreamLength = aStream->length();
bool SALOMEDS_Driver_i::CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID)
{
SALOMEDS::unlock();
- return _driver->CanPaste(theComponentName.ToCString(), theObjectID);
+ bool canPaste = _driver->CanPaste(theComponentName.ToCString(), theObjectID);
+ SALOMEDS::lock();
+ return canPaste;
}
TCollection_AsciiString SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream,
SALOMEDS::unlock();
SALOMEDS::SObject_var ret_so = _driver->PasteInto(aStream.in(), theObjectID, so.in());
+ SALOMEDS::lock();
return TCollection_AsciiString((char*)ret_so->GetID());
}
// SALOMEDS_DriverFactory
//###############################################################################################################
-SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const TCollection_AsciiString& theComponentType)
+SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType
+ (const TCollection_AsciiString& theComponentType)
{
CORBA::Object_var obj;
if (theComponentType == "SUPERV") aFactoryType = "SuperVisionContainer";
else aFactoryType = "FactoryServer";
- SALOMEDS::unlock();
- obj = SALOME_LifeCycleCORBA(_name_service).FindOrLoad_Component(aFactoryType.ToCString(),
- theComponentType.ToCString());
-
+ SALOMEDS::unlock();
+ obj = SALOME_LifeCycleCORBA(_name_service).FindOrLoad_Component
+ (aFactoryType.ToCString(), theComponentType.ToCString());
+ SALOMEDS::lock();
+
if (CORBA::is_nil(obj)) {
- obj = SALOME_LifeCycleCORBA(_name_service).FindOrLoad_Component("FactoryServerPy", theComponentType.ToCString());
+ obj = SALOME_LifeCycleCORBA(_name_service).FindOrLoad_Component
+ ("FactoryServerPy", theComponentType.ToCString());
}
-
+
if (!CORBA::is_nil(obj)) {
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
return new SALOMEDS_Driver_i(aDriver, _orb);
#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDS_SObject.hxx"
#include "SALOMEDS_ClientAttributes.hxx"
+#include "SALOMEDS.hxx"
#ifdef WIN32
#include <process.h>
void SALOMEDS_GenericAttribute::CheckLocked()
{
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
_local_impl->CheckLocked();
}
std::string SALOMEDS_GenericAttribute::Type()
{
std::string aType;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
aType = _local_impl->Type().ToCString();
}
else {
std::string SALOMEDS_GenericAttribute::GetClassType()
{
std::string aType;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
aType = _local_impl->GetClassType().ToCString();
}
else {
_PTR(SObject) SALOMEDS_GenericAttribute::GetSObject()
{
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
aSO = new SALOMEDS_SObject(_local_impl->GetSObject());
}
else {
}
-SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(const Handle(SALOMEDSImpl_GenericAttribute)& theGA)
+SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute
+ (const Handle(SALOMEDSImpl_GenericAttribute)& theGA)
{
+ SALOMEDS::Locker lock;
+
SALOMEDS_GenericAttribute* aGA = NULL;
std::string aTypeOfAttribute = theGA->GetClassType().ToCString();
__CreateGenericClientAttributeLocal
- return aGA;
+ return aGA;
}
SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(SALOMEDS::GenericAttribute_ptr theGA)
SALOMEDS_GenericAttribute* aGA = NULL;
std::string aTypeOfAttribute = theGA->GetClassType();
__CreateGenericClientAttributeCORBA
- return aGA;
+ return aGA;
}
-
if (!_impl.IsNull()) {
return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl));
}
-
+
return "";
-}
+}
-SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute(const Handle(TDF_Attribute)& theAttr,
- CORBA::ORB_ptr theOrb)
+SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute
+ (const Handle(TDF_Attribute)& theAttr,
+ CORBA::ORB_ptr theOrb)
{
-/*
SALOMEDS::Locker lock;
-
+
+/*
static std::map<TDF_Attribute*, SALOMEDS_GenericAttribute_i*> _mapOfAttrib;
SALOMEDS::GenericAttribute_var anAttribute;
SALOMEDS_GenericAttribute_i* attr_servant = NULL;
}
*/
// mpv: now servants Destroyed by common algos of CORBA
- char* aTypeOfAttribute = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(theAttr)->GetClassType().ToCString();
+ char* aTypeOfAttribute = Handle(SALOMEDSImpl_GenericAttribute)::
+ DownCast(theAttr)->GetClassType().ToCString();
SALOMEDS::GenericAttribute_var anAttribute;
SALOMEDS_GenericAttribute_i* attr_servant = NULL;
__CreateGenericCORBAAttribute
return anAttribute._retn();
-}
+}
//===========================================================================
// PRIVATE FUNCTIONS
long pid = (long)_getpid();
#else
long pid = (long)getpid();
-#endif
+#endif
isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
TDF_Attribute* local_impl = _impl.operator->();
return ((long)local_impl);
#include "SALOMEDS_SComponent.hxx"
+
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SComponent_i.hxx"
+
#include <string>
#include <TCollection_AsciiString.hxx>
std::string SALOMEDS_SComponent::ComponentDataType()
{
std::string aType;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
aType = (Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()))->ComponentDataType().ToCString();
}
else aType = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentDataType();
bool SALOMEDS_SComponent::ComponentIOR(std::string& theID)
{
bool ret;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
TCollection_AsciiString anIOR;
ret = (Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()))->ComponentIOR(anIOR);
theID = anIOR.ToCString();
SALOMEDS::SComponent_ptr SALOMEDS_SComponent::GetSComponent()
{
- if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
- SALOMEDS::SComponent_var aSCO = SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()),
- _orb);
+ if (_isLocal) {
+ if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
+ SALOMEDS::SComponent_var aSCO =
+ SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
return aSCO._retn();
}
else {
return SALOMEDS::SComponent::_nil();
}
-
// Module : SALOME
#include "SALOMEDS_SComponentIterator.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
+
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SComponent.hxx"
+#include "SALOMEDSImpl_SComponent.hxx"
SALOMEDS_SComponentIterator::SALOMEDS_SComponentIterator(const SALOMEDSImpl_SComponentIterator& theIterator)
:_local_impl(theIterator)
void SALOMEDS_SComponentIterator::Init()
{
- if(_isLocal) _local_impl.Init();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl.Init();
+ }
else _corba_impl->Init();
}
bool SALOMEDS_SComponentIterator::More()
{
bool ret;
- if(_isLocal) ret = _local_impl.More();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl.More();
+ }
else ret = _corba_impl->More();
return ret;
}
-
+
void SALOMEDS_SComponentIterator::Next()
{
- if(_isLocal) _local_impl.Next();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl.Next();
+ }
else _corba_impl->Next();
}
-
+
_PTR(SComponent) SALOMEDS_SComponentIterator::Value()
{
SALOMEDSClient_SComponent* aSCO = NULL;
- if(_isLocal) aSCO = new SALOMEDS_SComponent(_local_impl.Value());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aSCO = new SALOMEDS_SComponent(_local_impl.Value());
+ }
else aSCO = new SALOMEDS_SComponent(_corba_impl->Value());
return _PTR(SComponent)(aSCO);
}
#include <TColStd_HSequenceOfTransient.hxx>
#include "SALOMEDS_SObject.hxx"
+
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
#include "SALOMEDS_Study.hxx"
+
+#include "SALOMEDSImpl_SComponent.hxx"
+#include "SALOMEDSImpl_GenericAttribute.hxx"
#include "SALOMEDSImpl_Study.hxx"
#include "Utils_ORB_INIT.hxx"
std::string SALOMEDS_SObject::GetID()
{
std::string aValue;
- if(_isLocal) aValue = _local_impl->GetID().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = _local_impl->GetID().ToCString();
+ }
else aValue = _corba_impl->GetID();
return aValue;
}
_PTR(SComponent) SALOMEDS_SObject::GetFatherComponent()
{
- if(_isLocal) {
- Handle(SALOMEDSImpl_SComponent) aSCO = Handle(SALOMEDSImpl_SComponent)::DownCast(_local_impl->GetFatherComponent());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_SComponent) aSCO =
+ Handle(SALOMEDSImpl_SComponent)::DownCast(_local_impl->GetFatherComponent());
return _PTR(SComponent)(new SALOMEDS_SComponent(aSCO));
}
return _PTR(SComponent)(new SALOMEDS_SComponent(_corba_impl->GetFatherComponent()));
_PTR(SObject) SALOMEDS_SObject::GetFather()
{
- if(_isLocal) return _PTR(SObject)(new SALOMEDS_SObject(_local_impl->GetFather()));
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ return _PTR(SObject)(new SALOMEDS_SObject(_local_impl->GetFather()));
+ }
return _PTR(SObject)(new SALOMEDS_SObject(_corba_impl->GetFather()));
}
-bool SALOMEDS_SObject::FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute)
+bool SALOMEDS_SObject::FindAttribute(_PTR(GenericAttribute)& anAttribute,
+ const std::string& aTypeOfAttribute)
{
bool ret = false;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_GenericAttribute) anAttr;
ret = _local_impl->FindAttribute(anAttr, (char*)aTypeOfAttribute.c_str());
if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(anAttr));
bool SALOMEDS_SObject::ReferencedObject(_PTR(SObject)& theObject)
{
bool ret = false;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_SObject) aSO;
ret = _local_impl->ReferencedObject(aSO);
if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO));
bool SALOMEDS_SObject::FindSubObject(int theTag, _PTR(SObject)& theObject)
{
bool ret = false;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_SObject) aSO;
ret = _local_impl->FindSubObject(theTag, aSO);
if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO));
_PTR(Study) SALOMEDS_SObject::GetStudy()
{
- if(_isLocal) return _PTR(Study)(new SALOMEDS_Study(_local_impl->GetStudy()));
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ return _PTR(Study)(new SALOMEDS_Study(_local_impl->GetStudy()));
+ }
return _PTR(Study)(new SALOMEDS_Study(_corba_impl->GetStudy()));
}
std::string SALOMEDS_SObject::Name()
{
std::string aName;
- if(_isLocal) aName = _local_impl->Name().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aName = _local_impl->Name().ToCString();
+ }
else aName = _corba_impl->Name();
return aName;
void SALOMEDS_SObject::Name(const std::string& theName)
{
- if(_isLocal) _local_impl->Name((char*)theName.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Name((char*)theName.c_str());
+ }
else _corba_impl->Name(theName.c_str());
}
int aLength = 0;
SALOMEDSClient_GenericAttribute* anAttr;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->GetAllAttributes();
aLength = aSeq->Length();
- for(int i = 1; i <= aLength; i++) {
- anAttr = SALOMEDS_GenericAttribute::CreateAttribute(Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aSeq->Value(i)));
+ for (int i = 1; i <= aLength; i++) {
+ anAttr = SALOMEDS_GenericAttribute::CreateAttribute
+ (Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aSeq->Value(i)));
aVector.push_back(_PTR(GenericAttribute)(anAttr));
}
}
else {
SALOMEDS::ListOfAttributes_var aSeq = _corba_impl->GetAllAttributes();
aLength = aSeq->length();
- for(int i = 0; i < aLength; i++) {
+ for (int i = 0; i < aLength; i++) {
anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aSeq[i]);
aVector.push_back(_PTR(GenericAttribute)(anAttr));
}
std::string SALOMEDS_SObject::GetName()
{
std::string aName;
- if(_isLocal) aName = _local_impl->GetName().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aName = _local_impl->GetName().ToCString();
+ }
else aName = _corba_impl->GetName();
return aName;
std::string SALOMEDS_SObject::GetComment()
{
std::string aComment;
- if(_isLocal) aComment = _local_impl->GetComment().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aComment = _local_impl->GetComment().ToCString();
+ }
else aComment = _corba_impl->GetComment();
return aComment;
std::string SALOMEDS_SObject::GetIOR()
{
std::string anIOR;
- if(_isLocal) anIOR = _local_impl->GetIOR().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ anIOR = _local_impl->GetIOR().ToCString();
+ }
else anIOR = _corba_impl->GetIOR();
return anIOR;
int SALOMEDS_SObject::Tag()
{
- if(_isLocal) return _local_impl->Tag();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ return _local_impl->Tag();
+ }
return _corba_impl->Tag();
}
int SALOMEDS_SObject::Depth()
{
- if(_isLocal) return _local_impl->Depth();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ return _local_impl->Depth();
+ }
return _corba_impl->Depth();
}
CORBA::Object_ptr SALOMEDS_SObject::GetObject()
{
CORBA::Object_var obj;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
std::string anIOR = GetIOR();
if (!anIOR.empty())
obj = _orb->string_to_object(anIOR.c_str());
#include "utilities.h"
#include "SALOMEDS_Study.hxx"
+
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDS_StudyBuilder.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
#include "SALOMEDS_ChildIterator.hxx"
-#include "SALOMEDSImpl_ChildIterator.hxx"
#include "SALOMEDS_SComponentIterator.hxx"
-#include "SALOMEDSImpl_SComponentIterator.hxx"
#include "SALOMEDS_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
#include "SALOMEDS_UseCaseBuilder.hxx"
+
+#include "SALOMEDSImpl_SComponent.hxx"
+#include "SALOMEDSImpl_SObject.hxx"
+#include "SALOMEDSImpl_StudyBuilder.hxx"
+#include "SALOMEDSImpl_ChildIterator.hxx"
+#include "SALOMEDSImpl_SComponentIterator.hxx"
+#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
#include "SALOMEDSImpl_UseCaseBuilder.hxx"
#include "SALOMEDS_Driver_i.hxx"
std::string SALOMEDS_Study::GetPersistentReference()
{
std::string aRef;
- if(_isLocal) aRef = _local_impl->GetPersistentReference().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aRef = _local_impl->GetPersistentReference().ToCString();
+ }
else aRef = _corba_impl->GetPersistentReference();
return aRef;
}
std::string SALOMEDS_Study::GetTransientReference()
{
std::string aRef;
- if(_isLocal) aRef = _local_impl->GetTransientReference().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aRef = _local_impl->GetTransientReference().ToCString();
+ }
else aRef = _corba_impl->GetTransientReference();
return aRef;
}
bool SALOMEDS_Study::IsEmpty()
{
bool ret;
- if(_isLocal) ret = _local_impl->IsEmpty();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->IsEmpty();
+ }
else ret = _corba_impl->IsEmpty();
return ret;
}
_PTR(SComponent) SALOMEDS_Study::FindComponent (const std::string& aComponentName)
{
SALOMEDSClient_SComponent* aSCO = NULL;
- if(_isLocal) {
- Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponent((char*)aComponentName.c_str());
- if(aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
+ Handle(SALOMEDSImpl_SComponent) aSCO_impl =
+ _local_impl->FindComponent((char*)aComponentName.c_str());
+ if (aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO);
aSCO = new SALOMEDS_SComponent(aSCO_impl);
}
else {
SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponent((char*)aComponentName.c_str());
- if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO);
+ if (CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO);
aSCO = new SALOMEDS_SComponent(aSCO_impl);
}
return _PTR(SComponent)(aSCO);
_PTR(SComponent) SALOMEDS_Study::FindComponentID(const std::string& aComponentID)
{
SALOMEDSClient_SComponent* aSCO = NULL;
- if(_isLocal) {
- Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponentID((char*)aComponentID.c_str());
- if(aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
+ Handle(SALOMEDSImpl_SComponent) aSCO_impl =
+ _local_impl->FindComponentID((char*)aComponentID.c_str());
+ if (aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO);
aSCO = new SALOMEDS_SComponent(aSCO_impl);
}
else {
aSCO = new SALOMEDS_SComponent(aSCO_impl);
}
return _PTR(SComponent)(aSCO);
-
}
_PTR(SObject) SALOMEDS_Study::FindObject(const std::string& anObjectName)
{
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObject((char*)anObjectName.c_str());
- if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
+ if (aSO_impl.IsNull()) return _PTR(SObject)(aSO);
Handle(SALOMEDSImpl_SComponent) aSCO_impl = Handle(SALOMEDSImpl_SComponent)::DownCast(aSO_impl);
- if(!aSCO_impl.IsNull()) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
+ if (!aSCO_impl.IsNull()) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
aSO = new SALOMEDS_SObject(aSO_impl);
}
else {
SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObject((char*)anObjectName.c_str());
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
+ if (CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
SALOMEDS::SComponent_var aSCO_impl = SALOMEDS::SComponent::_narrow(aSO_impl);
- if(!CORBA::is_nil(aSCO_impl)) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
+ if (!CORBA::is_nil(aSCO_impl)) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
aSO = new SALOMEDS_SObject(aSO_impl);
}
return _PTR(SObject)(aSO);
}
-
+
std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& anObjectName,
- const std::string& aComponentName)
+ const std::string& aComponentName)
{
std::vector<_PTR(SObject)> aVector;
int i, aLength = 0;
-
- if(_isLocal) {
- Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindObjectByName((char*)anObjectName.c_str(), (char*)aComponentName.c_str());
+
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
+ Handle(TColStd_HSequenceOfTransient) aSeq =
+ _local_impl->FindObjectByName((char*)anObjectName.c_str(), (char*)aComponentName.c_str());
aLength = aSeq->Length();
- for(i = 1; i<= aLength; i++)
- aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)))));
+ for (i = 1; i<= aLength; i++)
+ aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject
+ (Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)))));
}
else {
SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(),
(char*)aComponentName.c_str());
aLength = aSeq->length();
- for(i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
+ for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
}
return aVector;
}
-
+
_PTR(SObject) SALOMEDS_Study::FindObjectID(const std::string& anObjectID)
{
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectID((char*)anObjectID.c_str());
if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
return _PTR(SObject)(new SALOMEDS_SObject(aSO_impl));
_PTR(SObject) SALOMEDS_Study::CreateObjectID(const std::string& anObjectID)
{
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->CreateObjectID((char*)anObjectID.c_str()));
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aSO = new SALOMEDS_SObject(_local_impl->CreateObjectID((char*)anObjectID.c_str()));
+ }
else aSO = new SALOMEDS_SObject(_corba_impl->CreateObjectID((char*)anObjectID.c_str()));
return _PTR(SObject)(aSO);
}
-
+
_PTR(SObject) SALOMEDS_Study::FindObjectIOR(const std::string& anObjectIOR)
{
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectIOR((char*)anObjectIOR.c_str());
- if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
+ if (aSO_impl.IsNull()) return _PTR(SObject)(aSO);
aSO = new SALOMEDS_SObject(aSO_impl);
}
else {
SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectIOR((char*)anObjectIOR.c_str());
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
+ if (CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
aSO = new SALOMEDS_SObject(aSO_impl);
}
return _PTR(SObject)(aSO);
_PTR(SObject) SALOMEDS_Study::FindObjectByPath(const std::string& thePath)
{
SALOMEDSClient_SObject* aSO = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectByPath((char*)thePath.c_str());
- if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
+ if (aSO_impl.IsNull()) return _PTR(SObject)(aSO);
aSO = new SALOMEDS_SObject(aSO_impl);
}
else {
SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectByPath((char*)thePath.c_str());
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
+ if (CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
aSO = new SALOMEDS_SObject(aSO_impl);
}
return _PTR(SObject)(aSO);
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
std::string aPath;
- if(_isLocal) aPath = _local_impl->GetObjectPath(aSO->GetLocalImpl()).ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aPath = _local_impl->GetObjectPath(aSO->GetLocalImpl()).ToCString();
+ }
else aPath = _corba_impl->GetObjectPath(aSO->GetCORBAImpl());
return aPath;
}
void SALOMEDS_Study::SetContext(const std::string& thePath)
{
- if(_isLocal) _local_impl->SetContext((char*)thePath.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetContext((char*)thePath.c_str());
+ }
else _corba_impl->SetContext((char*)thePath.c_str());
}
std::string SALOMEDS_Study::GetContext()
{
std::string aPath;
- if(_isLocal) aPath = _local_impl->GetContext().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aPath = _local_impl->GetContext().ToCString();
+ }
else aPath = _corba_impl->GetContext();
return aPath;
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetObjectNames((char*)theContext.c_str());
aLength = aSeq->Length();
- for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
}
else {
SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetObjectNames((char*)theContext.c_str());
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back(std::string((std::string)aSeq[i].in()));
+ for (i = 0; i < aLength; i++) aVector.push_back(std::string((std::string)aSeq[i].in()));
}
return aVector;
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
- Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetDirectoryNames((char*)theContext.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
+ Handle(TColStd_HSequenceOfAsciiString) aSeq =
+ _local_impl->GetDirectoryNames((char*)theContext.c_str());
aLength = aSeq->Length();
- for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
}
else {
SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetDirectoryNames((char*)theContext.c_str());
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetFileNames((char*)theContext.c_str());
aLength = aSeq->Length();
- for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
}
else {
SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetFileNames((char*)theContext.c_str());
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetComponentNames((char*)theContext.c_str());
aLength = aSeq->Length();
- for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
}
else {
SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetComponentNames((char*)theContext.c_str());
aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
SALOMEDSClient_ChildIterator* aCI = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_ChildIterator) aCIimpl = _local_impl->NewChildIterator(aSO->GetLocalImpl());
aCI = new SALOMEDS_ChildIterator(aCIimpl);
}
_PTR(SComponentIterator) SALOMEDS_Study::NewComponentIterator()
{
SALOMEDSClient_SComponentIterator* aCI = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
SALOMEDSImpl_SComponentIterator aCIimpl = _local_impl->NewComponentIterator();
aCI = new SALOMEDS_SComponentIterator(aCIimpl);
}
return _PTR(SComponentIterator)(aCI);
}
-
+
_PTR(StudyBuilder) SALOMEDS_Study::NewBuilder()
{
SALOMEDSClient_StudyBuilder* aSB = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_StudyBuilder) aSBimpl = _local_impl->NewBuilder();
aSB = new SALOMEDS_StudyBuilder(aSBimpl);
}
std::string SALOMEDS_Study::Name()
{
std::string aName;
- if(_isLocal) aName = _local_impl->Name().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aName = _local_impl->Name().ToCString();
+ }
else aName = _corba_impl->Name();
return aName;
}
-
+
void SALOMEDS_Study::Name(const std::string& theName)
{
- if(_isLocal) _local_impl->Name((char*)theName.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Name((char*)theName.c_str());
+ }
else _corba_impl->Name((char*)theName.c_str());
}
bool SALOMEDS_Study::IsSaved()
{
bool isSaved;
- if(_isLocal) isSaved = _local_impl->IsSaved();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ isSaved = _local_impl->IsSaved();
+ }
else isSaved = _corba_impl->IsSaved();
return isSaved;
}
void SALOMEDS_Study::IsSaved(bool save)
{
- if(_isLocal) _local_impl->IsSaved(save);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->IsSaved(save);
+ }
else _corba_impl->IsSaved(save);
}
bool SALOMEDS_Study::IsModified()
{
bool isModified;
- if(_isLocal) isModified = _local_impl->IsModified();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ isModified = _local_impl->IsModified();
+ }
else isModified = _corba_impl->IsModified();
return isModified;
}
std::string SALOMEDS_Study::URL()
{
std::string aURL;
- if(_isLocal) aURL = _local_impl->URL().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aURL = _local_impl->URL().ToCString();
+ }
else aURL = _corba_impl->URL();
return aURL;
}
void SALOMEDS_Study::URL(const std::string& url)
{
- if(_isLocal) _local_impl->URL((char*)url.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->URL((char*)url.c_str());
+ }
else _corba_impl->URL((char*)url.c_str());
}
int SALOMEDS_Study::StudyId()
{
int anID;
- if(_isLocal) anID = _local_impl->StudyId();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ anID = _local_impl->StudyId();
+ }
else anID = _corba_impl->StudyId();
return anID;
}
void SALOMEDS_Study::StudyId(int id)
{
- if(_isLocal) _local_impl->StudyId(id);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->StudyId(id);
+ }
else _corba_impl->StudyId(id);
}
std::vector<_PTR(SObject)> aVector;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindDependances(aSO->GetLocalImpl());
- if ( !aSeq.IsNull() )
- {
+ if (!aSeq.IsNull()) {
aLength = aSeq->Length();
- for(i=1; i<=aLength; i++)
+ for (i = 1; i <= aLength; i++)
aVector.push_back(_PTR(SObject)(
new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)))));
}
else {
SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindDependances(aSO->GetCORBAImpl());
aLength = aSeq->length();
- for(i=0; i<aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
+ for (i = 0; i < aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
}
return aVector;
}
_PTR(AttributeStudyProperties) SALOMEDS_Study::GetProperties()
{
SALOMEDSClient_AttributeStudyProperties* aProp;
- if(_isLocal) aProp = new SALOMEDS_AttributeStudyProperties(_local_impl->GetProperties());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aProp = new SALOMEDS_AttributeStudyProperties(_local_impl->GetProperties());
+ }
else aProp = new SALOMEDS_AttributeStudyProperties(_corba_impl->GetProperties());
return _PTR(AttributeStudyProperties)(aProp);
}
std::string SALOMEDS_Study::GetLastModificationDate()
{
std::string aDate;
- if(_isLocal) aDate = _local_impl->GetLastModificationDate().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aDate = _local_impl->GetLastModificationDate().ToCString();
+ }
else aDate = _corba_impl->GetLastModificationDate();
return aDate;
}
{
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetModificationsDate();
aLength = aSeq->Length();
- for(i=1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
+ for (i = 1; i <= aLength; i++) aVector.push_back(aSeq->Value(i).ToCString());
}
else {
SALOMEDS::ListOfDates_var aSeq = _corba_impl->GetModificationsDate();
aLength = aSeq->length();
- for(i=0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
}
return aVector;
}
_PTR(UseCaseBuilder) SALOMEDS_Study::GetUseCaseBuilder()
{
SALOMEDSClient_UseCaseBuilder* aUB = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_UseCaseBuilder) aUBimpl = _local_impl->GetUseCaseBuilder();
aUB = new SALOMEDS_UseCaseBuilder(aUBimpl);
}
void SALOMEDS_Study::Close()
{
- if(_isLocal) _local_impl->Close();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Close();
+ }
else _corba_impl->Close();
}
bool SALOMEDS_Study::DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished)
{
- bool ret;
- if(_isLocal) {
- SALOMEDS_DriverFactory_i* aFactory = new SALOMEDS_DriverFactory_i(_orb);
- ret = _local_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished, aFactory);
- delete aFactory;
- }
- else ret = _corba_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished);
+ //SRN: Pure CORBA DumpStudy as it does more cleaning than the local one
+ bool ret = _corba_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished);
return ret;
}
SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy()
{
- if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
+ if (!CORBA::is_nil(_corba_impl)) return _corba_impl;
std::string anIOR = _local_impl->GetTransientReference().ToCString();
SALOMEDS::Study_var aStudy;
- if(!_local_impl->IsError() && anIOR != "") {
+ if (!_local_impl->IsError() && anIOR != "") {
aStudy = SALOMEDS::Study::_narrow(_orb->string_to_object(anIOR.c_str()));
}
else {
else {
return _corba_impl;
}
-
+
return SALOMEDS::Study::_nil();
}
#include "utilities.h"
#include "SALOMEDS_StudyBuilder.hxx"
+
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDS_Driver_i.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
+#include "SALOMEDS_StudyManager.hxx"
+
+#include "SALOMEDS_Driver_i.hxx"
+
+#include "SALOMEDSImpl_SObject.hxx"
+#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
+
#include <string>
+
#include <TCollection_AsciiString.hxx>
#include <TDF_Attribute.hxx>
-#include "SALOMEDS_StudyManager.hxx"
#include "Utils_CorbaException.hxx"
#include "Utils_ORB_INIT.hxx"
_PTR(SComponent) SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType)
{
- CheckLocked();
-
SALOMEDSClient_SComponent* aSCO = NULL;
-
- if(_isLocal) {
+
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->NewComponent((char*)ComponentDataType.c_str());
if(aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO);
aSCO = new SALOMEDS_SComponent(aSCO_impl);
if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO);
aSCO = new SALOMEDS_SComponent(aSCO_impl);
}
-
+
return _PTR(SComponent)(aSCO);
}
void SALOMEDS_StudyBuilder::DefineComponentInstance (const _PTR(SComponent)& theSCO,
const std::string& ComponentIOR)
{
- CheckLocked();
-
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- if(_isLocal) _local_impl->DefineComponentInstance(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()),
- (char*)ComponentIOR.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->DefineComponentInstance(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()),
+ (char*)ComponentIOR.c_str());
+ }
else {
CORBA::Object_var obj = _orb->string_to_object(ComponentIOR.c_str());
_corba_impl->DefineComponentInstance(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()), obj);
void SALOMEDS_StudyBuilder::RemoveComponent(const _PTR(SComponent)& theSCO)
{
- CheckLocked();
-
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- if(_isLocal) _local_impl->RemoveComponent(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()));
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->RemoveComponent(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()));
+ }
else _corba_impl->RemoveComponent(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()));
}
SALOMEDSClient_SObject* aSO = NULL;
SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get());
- if(father == NULL) return _PTR(SObject)(aSO);
- if(_isLocal) {
+ if (father == NULL) return _PTR(SObject)(aSO);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->NewObject(father->GetLocalImpl());
if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
aSO = new SALOMEDS_SObject(aSO_impl);
SALOMEDSClient_SObject* aSO = NULL;
SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get());
- if(father == NULL) return _PTR(SObject)(aSO);
- if(_isLocal) {
+ if (father == NULL) return _PTR(SObject)(aSO);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->NewObjectToTag(father->GetLocalImpl(), theTag);
if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
aSO = new SALOMEDS_SObject(aSO_impl);
}
return _PTR(SObject)(aSO);
-
}
void SALOMEDS_StudyBuilder::AddDirectory(const std::string& thePath)
{
- CheckLocked();
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
- if(_isLocal) {
_local_impl->AddDirectory((char*)thePath.c_str());
- if(_local_impl->IsError()) {
+ if (_local_impl->IsError()) {
std::string anErrorCode = _local_impl->GetErrorCode().ToCString();
- if(anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed();
- if(anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory();
- if(anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent();
+ if (anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed();
+ if (anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory();
+ if (anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent();
}
}
else _corba_impl->AddDirectory((char*)thePath.c_str());
CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str());
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
SALOMEDS_Driver_i* drv = new SALOMEDS_Driver_i(aDriver, _orb);
- Handle(SALOMEDSImpl_SComponent) aSCO_impl = Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl());
+ Handle(SALOMEDSImpl_SComponent) aSCO_impl =
+ Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl());
bool isDone = _local_impl->LoadWith(aSCO_impl, drv);
delete drv;
if(!isDone && _local_impl->IsError())
void SALOMEDS_StudyBuilder::Load(const _PTR(SObject)& theSCO)
{
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- if(_isLocal) _local_impl->Load(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()));
+ if (_isLocal) _local_impl->Load(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()));
else _corba_impl->Load(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()));
}
void SALOMEDS_StudyBuilder::RemoveObject(const _PTR(SObject)& theSO)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->RemoveObject(aSO->GetLocalImpl());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->RemoveObject(aSO->GetLocalImpl());
+ }
else _corba_impl->RemoveObject(aSO->GetCORBAImpl());
}
void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(const _PTR(SObject)& theSO)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->RemoveObjectWithChildren(aSO->GetLocalImpl());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->RemoveObjectWithChildren(aSO->GetLocalImpl());
+ }
else _corba_impl->RemoveObjectWithChildren(aSO->GetCORBAImpl());
}
-
+
_PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(SObject)& theSO,
const std::string& aTypeOfAttribute)
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
SALOMEDSClient_GenericAttribute* anAttr = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_GenericAttribute) aGA;
try {
- aGA=Handle(SALOMEDSImpl_GenericAttribute)::DownCast(_local_impl->FindOrCreateAttribute(aSO->GetLocalImpl(),
- (char*)aTypeOfAttribute.c_str()));
- }
+ aGA = Handle(SALOMEDSImpl_GenericAttribute)::DownCast
+ (_local_impl->FindOrCreateAttribute(aSO->GetLocalImpl(), (char*)aTypeOfAttribute.c_str()));
+ }
catch (...) {
throw SALOMEDS::StudyBuilder::LockProtection();
- }
+ }
anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA);
}
else {
- SALOMEDS::GenericAttribute_var aGA = _corba_impl->FindOrCreateAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str());
+ SALOMEDS::GenericAttribute_var aGA =
+ _corba_impl->FindOrCreateAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str());
anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA);
}
{
bool ret;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_GenericAttribute) aGA;
ret = _local_impl->FindAttribute(aSO->GetLocalImpl(), aGA, (char*)aTypeOfAttribute.c_str());
if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(aGA));
return ret;
}
-
+
void SALOMEDS_StudyBuilder::RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->RemoveAttribute(aSO->GetLocalImpl(), (char*)aTypeOfAttribute.c_str());
- else _corba_impl->RemoveAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->RemoveAttribute(aSO->GetLocalImpl(), (char*)aTypeOfAttribute.c_str());
+ }
+ else _corba_impl->RemoveAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str());
}
void SALOMEDS_StudyBuilder::Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(me.get());
SALOMEDS_SObject* aRefSO = dynamic_cast<SALOMEDS_SObject*>(thereferencedObject.get());
- if(_isLocal) _local_impl->Addreference(aSO->GetLocalImpl(), aRefSO->GetLocalImpl());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->Addreference(aSO->GetLocalImpl(), aRefSO->GetLocalImpl());
+ }
else _corba_impl->Addreference(aSO->GetCORBAImpl(), aRefSO->GetCORBAImpl());
}
void SALOMEDS_StudyBuilder::RemoveReference(const _PTR(SObject)& me)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(me.get());
- if(_isLocal) _local_impl->RemoveReference(aSO->GetLocalImpl());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->RemoveReference(aSO->GetLocalImpl());
+ }
else _corba_impl->RemoveReference(aSO->GetCORBAImpl());
}
void SALOMEDS_StudyBuilder::SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->SetGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->SetGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str());
+ }
else _corba_impl->SetGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str());
}
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
bool ret;
- if(_isLocal) ret = _local_impl->IsGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
+ ret = _local_impl->IsGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str());
+ }
else ret = _corba_impl->IsGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str());
return ret;
void SALOMEDS_StudyBuilder::NewCommand()
{
- if(_isLocal) _local_impl->NewCommand();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->NewCommand();
+ }
else _corba_impl->NewCommand();
}
void SALOMEDS_StudyBuilder::CommitCommand()
{
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
_local_impl->CommitCommand();
}
bool SALOMEDS_StudyBuilder::HasOpenCommand()
{
bool ret;
- if(_isLocal) ret = _local_impl->HasOpenCommand();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->HasOpenCommand();
+ }
else ret = _corba_impl->HasOpenCommand();
return ret;
}
void SALOMEDS_StudyBuilder::AbortCommand()
{
- if(_isLocal) _local_impl->AbortCommand();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->AbortCommand();
+ }
else _corba_impl->AbortCommand();
}
void SALOMEDS_StudyBuilder::Undo()
{
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
_local_impl->Undo();
}
}
else _corba_impl->Undo();
}
-
+
void SALOMEDS_StudyBuilder::Redo()
{
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
_local_impl->Redo();
}
}
else _corba_impl->Redo();
}
-
+
bool SALOMEDS_StudyBuilder::GetAvailableUndos()
{
bool ret;
- if(_isLocal) ret = _local_impl->GetAvailableUndos();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->GetAvailableUndos();
+ }
else ret = _corba_impl->GetAvailableUndos();
return ret;
}
bool SALOMEDS_StudyBuilder::GetAvailableRedos()
{
bool ret;
- if(_isLocal) ret = _local_impl->GetAvailableRedos();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->GetAvailableRedos();
+ }
else ret = _corba_impl->GetAvailableRedos();
return ret;
}
int SALOMEDS_StudyBuilder::UndoLimit()
{
int aLimit;
- if(_isLocal) aLimit = _local_impl->UndoLimit();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aLimit = _local_impl->UndoLimit();
+ }
else aLimit = _corba_impl->UndoLimit();
return aLimit;
}
void SALOMEDS_StudyBuilder::UndoLimit(int theLimit)
{
- CheckLocked();
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
- if(_isLocal) _local_impl->UndoLimit(theLimit);
+ _local_impl->UndoLimit(theLimit);
+ }
else _corba_impl->UndoLimit(theLimit);
}
void SALOMEDS_StudyBuilder::CheckLocked()
{
//There is only local part as CORBA part throws the correct exeception
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
try {
_local_impl->CheckLocked();
}
void SALOMEDS_StudyBuilder::SetName(const _PTR(SObject)& theSO, const std::string& theValue)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->SetName(aSO->GetLocalImpl(), (char*)theValue.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->SetName(aSO->GetLocalImpl(), (char*)theValue.c_str());
+ }
else _corba_impl->SetName(aSO->GetCORBAImpl(), (char*)theValue.c_str());
}
void SALOMEDS_StudyBuilder::SetComment(const _PTR(SObject)& theSO, const std::string& theValue)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->SetComment(aSO->GetLocalImpl(), (char*)theValue.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->SetComment(aSO->GetLocalImpl(), (char*)theValue.c_str());
+ }
else _corba_impl->SetComment(aSO->GetCORBAImpl(), (char*)theValue.c_str());
}
void SALOMEDS_StudyBuilder::SetIOR(const _PTR(SObject)& theSO, const std::string& theValue)
{
- CheckLocked();
-
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if(_isLocal) _local_impl->SetIOR(aSO->GetLocalImpl(), (char*)theValue.c_str());
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+
+ _local_impl->SetIOR(aSO->GetLocalImpl(), (char*)theValue.c_str());
+ }
else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str());
}
void SALOMEDS_StudyBuilder::init_orb()
{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 ) ;
+ _orb = init(0 , 0 );
}
#include "SALOMEDS_StudyManager.hxx"
-#include "SALOMEDSImpl_Study.hxx"
+#include "SALOMEDS.hxx"
#include "SALOMEDS_Study.hxx"
#include "SALOMEDS_SObject.hxx"
+
#include "SALOMEDS_Driver_i.hxx"
+#include "SALOMEDSImpl_Study.hxx"
+
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "OpUtil.hxx"
-using namespace std;
+using namespace std;
SALOMEDS_Driver_i* GetDriver(const Handle(SALOMEDSImpl_SObject)& theObject, CORBA::ORB_ptr orb);
SALOMEDSClient_Study* aStudy = NULL;
SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy((char*)study_name.c_str());
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
+ if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
aStudy = new SALOMEDS_Study(aStudy_impl);
return _PTR(Study)(aStudy);
SALOMEDSClient_Study* aStudy = NULL;
SALOMEDS::Study_var aStudy_impl = _corba_impl->Open((char*)theStudyUrl.c_str());
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
+ if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
aStudy = new SALOMEDS_Study(aStudy_impl.in());
_corba_impl->Close(aStudy);
}
-void SALOMEDS_StudyManager::Save(const _PTR(Study)& theStudy, bool theMultiFile)
+bool SALOMEDS_StudyManager::Save(const _PTR(Study)& theStudy, bool theMultiFile)
{
//SRN: Pure CORBA save as the save operation require CORBA in any case
SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- _corba_impl->Save(aStudy, theMultiFile);
+ return _corba_impl->Save(aStudy, theMultiFile);
}
-void SALOMEDS_StudyManager::SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile)
+bool SALOMEDS_StudyManager::SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile)
{
//SRN: Pure CORBA save as the save operation require CORBA in any case
SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- _corba_impl->SaveASCII(aStudy, theMultiFile);
+ return _corba_impl->SaveASCII(aStudy, theMultiFile);
}
-void SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile)
+bool SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile)
{
//SRN: Pure CORBA save as the save operation require CORBA in any case
SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile);
+ return _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile);
}
-void SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile)
+bool SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile)
{
//SRN: Pure CORBA save as the save operation require CORBA in any case
SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- _corba_impl->SaveAsASCII((char*)theUrl.c_str(), aStudy, theMultiFile);
+ return _corba_impl->SaveAsASCII((char*)theUrl.c_str(), aStudy, theMultiFile);
}
std::vector<std::string> SALOMEDS_StudyManager::GetOpenStudies()
std::vector<std::string> aVector;
int aLength, i;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->GetOpenStudies();
aLength = aSeq->Length();
for(i = 1; i <= aLength; i++)
}
return aVector;
}
-
+
_PTR(Study) SALOMEDS_StudyManager::GetStudyByName(const std::string& theStudyName)
{
SALOMEDSClient_Study* aStudy = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->GetStudyByName((char*)theStudyName.c_str());
if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy);
aStudy = new SALOMEDS_Study(aStudy_impl);
}
else {
SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByName((char*)theStudyName.c_str());
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
+ if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
aStudy = new SALOMEDS_Study(aStudy_impl);
}
return _PTR(Study)(aStudy);
_PTR(Study) SALOMEDS_StudyManager::GetStudyByID(int theStudyID)
{
SALOMEDSClient_Study* aStudy = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->GetStudyByID(theStudyID);
if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy);
aStudy = new SALOMEDS_Study(aStudy_impl);
}
else {
SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByID(theStudyID);
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
+ if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
aStudy = new SALOMEDS_Study(aStudy_impl);
}
- return _PTR(Study)(aStudy);
+ return _PTR(Study)(aStudy);
}
-
+
bool SALOMEDS_StudyManager::CanCopy(const _PTR(SObject)& theSO)
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
bool ret;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = aSO->GetLocalImpl();
SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
ret = _local_impl->CanCopy(aSO_impl, aDriver);
return ret;
}
-
+
bool SALOMEDS_StudyManager::Copy(const _PTR(SObject)& theSO)
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
bool ret;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = aSO->GetLocalImpl();
SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
ret = _local_impl->Copy(aSO_impl, aDriver);
}
return ret;
}
-
+
bool SALOMEDS_StudyManager::CanPaste(const _PTR(SObject)& theSO)
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
bool ret;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = aSO->GetLocalImpl();
SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
ret = _local_impl->CanPaste(aSO_impl, aDriver);
return ret;
}
-
+
_PTR(SObject) SALOMEDS_StudyManager::Paste(const _PTR(SObject)& theSO)
{
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
SALOMEDSClient_SObject* aResult = NULL;
- if(_isLocal) {
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDSImpl_SObject) aSO_impl = aSO->GetLocalImpl();
SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
Handle(SALOMEDSImpl_SObject) aNewSO = _local_impl->Paste(aSO_impl, aDriver);
void SALOMEDS_StudyManager::init_orb()
{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 ) ;
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
+ _orb = init(0 , 0 );
}
SALOMEDS_Driver_i* GetDriver(const Handle(SALOMEDSImpl_SObject)& theObject, CORBA::ORB_ptr orb)
SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
driver = new SALOMEDS_Driver_i(Engine, orb);
}
- }
+ }
return driver;
}
virtual _PTR(Study) NewStudy(const std::string& study_name);
virtual _PTR(Study) Open(const std::string& theStudyUrl);
virtual void Close(const _PTR(Study)& theStudy);
- virtual void Save(const _PTR(Study)& theStudy, bool theMultiFile);
- virtual void SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile);
- virtual void SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile);
- virtual void SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile);
+ virtual bool Save(const _PTR(Study)& theStudy, bool theMultiFile);
+ virtual bool SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile);
+ virtual bool SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile);
+ virtual bool SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile);
virtual std::vector<std::string> GetOpenStudies();
virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) ;
virtual _PTR(Study) GetStudyByID(int theStudyID) ;
* Purpose : Save a Study to it's persistent reference
*/
//============================================================================
-void SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
+CORBA::Boolean SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
if(aStudy->_is_nil()) {
MESSAGE("Save error: Study is null");
- return;
+ return false;
}
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- _impl->Save(aStudyImpl, _factory, theMultiFile);
+ return _impl->Save(aStudyImpl, _factory, theMultiFile);
}
-void SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
+CORBA::Boolean SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
if(aStudy->_is_nil()) {
MESSAGE("SaveASCII error: Study is null");
- return;
+ return false;
}
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- _impl->SaveASCII(aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveASCII(aStudyImpl, _factory, theMultiFile);
}
//=============================================================================
* Purpose : Save a study to the persistent reference aUrl
*/
//============================================================================
-void SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
+CORBA::Boolean SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
if(aStudy->_is_nil()) {
MESSAGE("SaveASCII error: Study is null");
- return;
+ return false;
}
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- _impl->SaveAs(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAs(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile);
}
-void SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
+CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
if(aStudy->_is_nil()) {
MESSAGE("SaveASCII error: Study is null");
- return;
+ return false;
}
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- _impl->SaveAsASCII(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAsASCII(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile);
}
//============================================================================
/*!
\param Study_ptr arguments
*/
- virtual void Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
+ virtual CORBA::Boolean Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
- virtual void SaveASCII( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
+ virtual CORBA::Boolean SaveASCII( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
//! method to save a Study to the persistent reference aUrl
/*!
\param char* arguments, the new URL of the study
\param Study_ptr arguments
*/
- virtual void SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
- virtual void SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
+ virtual CORBA::Boolean SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
+ virtual CORBA::Boolean SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
//! method to Get name list of open studies in the session
/*!
#include "SALOMEDS_UseCaseBuilder.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
#include "SALOMEDS_UseCaseIterator.hxx"
+
+#include "SALOMEDSImpl_SObject.hxx"
+#include "SALOMEDSImpl_UseCaseIterator.hxx"
+
#include <TCollection_AsciiString.hxx>
#include <string>
{
bool ret;
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) ret = _local_impl->Append(obj->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->Append(obj->GetLocalImpl());
+ }
else ret = _corba_impl->Append(obj->GetCORBAImpl());
return ret;
}
{
bool ret;
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) ret = _local_impl->Remove(obj->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->Remove(obj->GetLocalImpl());
+ }
else ret = _corba_impl->Remove(obj->GetCORBAImpl());
return ret;
}
bool ret;
SALOMEDS_SObject* father = dynamic_cast<SALOMEDS_SObject*>(theFather.get());
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) ret = _local_impl->AppendTo(father->GetLocalImpl(), obj->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->AppendTo(father->GetLocalImpl(), obj->GetLocalImpl());
+ }
else ret = _corba_impl->AppendTo(father->GetCORBAImpl(), obj->GetCORBAImpl());
return ret;
}
bool ret;
SALOMEDS_SObject* first = dynamic_cast<SALOMEDS_SObject*>(theFirst.get());
SALOMEDS_SObject* next = dynamic_cast<SALOMEDS_SObject*>(theNext.get());
- if(_isLocal) ret = _local_impl->InsertBefore(first->GetLocalImpl(), next->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->InsertBefore(first->GetLocalImpl(), next->GetLocalImpl());
+ }
else ret = _corba_impl->InsertBefore(first->GetCORBAImpl(), next->GetCORBAImpl());
return ret;
}
{
bool ret;
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) ret = _local_impl->SetCurrentObject(obj->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->SetCurrentObject(obj->GetLocalImpl());
+ }
else ret = _corba_impl->SetCurrentObject(obj->GetCORBAImpl());
return ret;
}
bool SALOMEDS_UseCaseBuilder::SetRootCurrent()
{
bool ret;
- if(_isLocal) ret = _local_impl->SetRootCurrent();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->SetRootCurrent();
+ }
else ret = _corba_impl->SetRootCurrent();
return ret;
}
{
bool ret;
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) ret = _local_impl->HasChildren(obj->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->HasChildren(obj->GetLocalImpl());
+ }
else ret = _corba_impl->HasChildren(obj->GetCORBAImpl());
return ret;
}
{
bool ret;
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) ret = _local_impl->IsUseCase(obj->GetLocalImpl());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->IsUseCase(obj->GetLocalImpl());
+ }
else ret = _corba_impl->IsUseCase(obj->GetCORBAImpl());
return ret;
}
bool SALOMEDS_UseCaseBuilder::SetName(const std::string& theName)
{
bool ret;
- if(_isLocal) ret = _local_impl->SetName((char*)theName.c_str());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->SetName((char*)theName.c_str());
+ }
else ret = _corba_impl->SetName((char*)theName.c_str());
return ret;
}
_PTR(SObject) SALOMEDS_UseCaseBuilder::GetCurrentObject()
{
SALOMEDS_SObject* obj = NULL;
- if(_isLocal) obj = new SALOMEDS_SObject(_local_impl->GetCurrentObject());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ obj = new SALOMEDS_SObject(_local_impl->GetCurrentObject());
+ }
else obj = new SALOMEDS_SObject(_corba_impl->GetCurrentObject());
return _PTR(SObject)(obj);
}
std::string SALOMEDS_UseCaseBuilder::GetName()
{
std::string aName;
- if(_isLocal) aName = _local_impl->GetName().ToCString();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aName = _local_impl->GetName().ToCString();
+ }
else aName = _corba_impl->GetName();
return aName;
}
_PTR(SObject) SALOMEDS_UseCaseBuilder::AddUseCase(const std::string& theName)
{
SALOMEDS_SObject* obj = NULL;
- if(_isLocal) obj = new SALOMEDS_SObject(_local_impl->AddUseCase((char*)theName.c_str()));
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ obj = new SALOMEDS_SObject(_local_impl->AddUseCase((char*)theName.c_str()));
+ }
else obj = new SALOMEDS_SObject(_corba_impl->AddUseCase((char*)theName.c_str()));
return _PTR(SObject)(obj);
}
{
SALOMEDS_UseCaseIterator* it = NULL;
SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if(_isLocal) it = new SALOMEDS_UseCaseIterator(_local_impl->GetUseCaseIterator(obj->GetLocalImpl()));
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ it = new SALOMEDS_UseCaseIterator(_local_impl->GetUseCaseIterator(obj->GetLocalImpl()));
+ }
else it = new SALOMEDS_UseCaseIterator(_corba_impl->GetUseCaseIterator(obj->GetCORBAImpl()));
return _PTR(UseCaseIterator)(it);
}
#include "SALOMEDS_UseCaseIterator.hxx"
+
+#include "SALOMEDS.hxx"
#include "SALOMEDS_SObject.hxx"
using namespace std;
void SALOMEDS_UseCaseIterator::Init(bool theAllLevels)
{
- if(_isLocal) _local_impl->Init(theAllLevels);
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Init(theAllLevels);
+ }
else _corba_impl->Init(theAllLevels);
}
bool SALOMEDS_UseCaseIterator::More()
{
bool ret;
- if(_isLocal) ret = _local_impl->More();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ ret = _local_impl->More();
+ }
else ret = _corba_impl->More();
return ret;
}
void SALOMEDS_UseCaseIterator::Next()
{
- if(_isLocal) _local_impl->Next();
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->Next();
+ }
else _corba_impl->Next();
}
_PTR(SObject) SALOMEDS_UseCaseIterator::Value()
{
SALOMEDS_SObject* aSO;
- if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->Value());
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aSO = new SALOMEDS_SObject(_local_impl->Value());
+ }
else aSO = new SALOMEDS_SObject(_corba_impl->Value());
return _PTR(SObject)(aSO);
}
virtual _PTR(Study) NewStudy(const std::string& study_name) = 0;
virtual _PTR(Study) Open(const std::string& theStudyUrl) = 0;
virtual void Close(const _PTR(Study)& theStudy) = 0;
- virtual void Save(const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual void SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual void SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual void SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0;
+ virtual bool Save(const _PTR(Study)& theStudy, bool theMultiFile) = 0;
+ virtual bool SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) = 0;
+ virtual bool SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0;
+ virtual bool SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0;
virtual std::vector<std::string> GetOpenStudies() = 0;
virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) = 0;
virtual _PTR(Study) GetStudyByID(int theStudyID) = 0;
Handle(SALOMEDSImpl_SComponent) sco = itcomponent.Value();
aCompType = sco->ComponentDataType();
//GEOM and MED are independent components
- if(aCompType == "GEOM" || aCompType == "MED") aSeq.Prepend(TCollection_ExtendedString(aCompType));
- else aSeq.Append(TCollection_ExtendedString(aCompType));
+ if (aCompType == "GEOM" || aCompType == "MED")
+ aSeq.Prepend(TCollection_ExtendedString(aCompType));
+ else
+ aSeq.Append(TCollection_ExtendedString(aCompType));
}
#ifdef WIN32
- TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("\\")+theBaseName+TCollection_AsciiString(".py");
+ TCollection_AsciiString aFileName =
+ thePath + TCollection_AsciiString("\\") + theBaseName + TCollection_AsciiString(".py");
#else
- TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("/")+theBaseName+TCollection_AsciiString(".py");
+ TCollection_AsciiString aFileName =
+ thePath + TCollection_AsciiString("/") + theBaseName + TCollection_AsciiString(".py");
#endif
//Create a file that will contain a main Study script
TCollection_AsciiString aBatchModeScript = "salome";
- //Output to the main Study script required Python modules import, set sys.path and add a creation of the study.
+ //Output to the main Study script required Python modules import,
+ //set sys.path and add a creation of the study.
fp << GetDumpStudyComment().ToCString() << endl << endl;
fp << "import sys" << endl;
fp << "import " << aBatchModeScript << "\n" << endl;
fp2.open(aFileName.ToCString(), ios::out);
#ifdef WIN32
- isOpened = fp.is_open();
+ isOpened = fp2.is_open();
#else
- isOpened = fp.rdbuf()->is_open();
+ isOpened = fp2.rdbuf()->is_open();
#endif
if(!isOpened) {
fp2 << aStream;
fp2.close();
+ if (aStream != NULL) delete [] aStream;
+
//Add to the main script a call to RebuildData of the generated by the component the Python script
fp << "import " << aScriptName << endl;
fp << aScriptName << ".RebuildData(" << aBatchModeScript << ".myStudy)" << endl;
* Purpose :
*/
//============================================================================
-bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& anSCO, SALOMEDSImpl_Driver* aDriver)
+bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& anSCO,
+ SALOMEDSImpl_Driver* aDriver)
{
_errorCode = "";
if (_doc->Main().FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID(),Att)) {
int aLocked = anSCO->GetStudy()->GetProperties()->IsLocked();
if (aLocked) anSCO->GetStudy()->GetProperties()->SetLocked(false);
-
+
TCollection_ExtendedString Res(Att->Value());
Handle(SALOMEDSImpl_AttributeComment) type;
}
DefineComponentInstance (anSCO, aDriver->GetIOR());
-
+
TCollection_AsciiString aHDFPath(Res);
-
- char* aHDFUrl;
+
+ TCollection_AsciiString aHDFUrl;
bool isASCII = false;
if (HDFascii::isASCII(aHDFPath.ToCString())) {
isASCII = true;
- char* aResultPath = HDFascii::ConvertFromASCIIToHDF(aHDFPath.ToCString());
- aHDFUrl = new char[strlen(aResultPath) + 19];
- sprintf(aHDFUrl, "%shdf_from_ascii.hdf", aResultPath);
- delete(aResultPath);
+ aHDFUrl = HDFascii::ConvertFromASCIIToHDF(aHDFPath.ToCString());
+ aHDFUrl += "hdf_from_ascii.hdf";
} else {
- aHDFUrl = aHDFPath.ToCString();
+ aHDFUrl = aHDFPath;
}
//Open the Study HDF file
- HDFfile *hdf_file = new HDFfile(aHDFUrl);
-
+ HDFfile *hdf_file = new HDFfile(aHDFUrl.ToCString());
+
char aMultifileState[2];
char ASCIIfileState[2];
try {
hdf_group->OpenOnDisk();
HDFgroup *hdf_sco_group = new HDFgroup(scoid.ToCString(), hdf_group);
hdf_sco_group->OpenOnDisk();
-
+
unsigned char* aStreamFile = NULL;
int aStreamSize = 0;
hdf_dataset->ReadFromDisk(aStreamFile);
hdf_dataset->CloseOnDisk();
hdf_dataset = 0;
- } else aStreamFile = NULL;
-
+ } else
+ aStreamFile = NULL;
+
HDFdataset *multifile_hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group);
multifile_hdf_dataset->OpenOnDisk();
multifile_hdf_dataset->ReadFromDisk(aMultifileState);
-
+
HDFdataset *ascii_hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group);
ascii_hdf_dataset->OpenOnDisk();
ascii_hdf_dataset->ReadFromDisk(ASCIIfileState);
-
+
// set path without file name from URL
int aFileNameSize = Res.Length();
char* aDir = new char[aFileNameSize];
aDir[aCounter+1] = 0;
break;
}
-
+
bool aResult = (ASCIIfileState[0]=='A')?
aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir, aMultifileState[0]=='M'):
aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir, aMultifileState[0]=='M');
_errorCode = "Can't load component";
throw HDFexception("Unable to load component");
}
-
+
if(aDir != NULL) delete []aDir;
multifile_hdf_dataset->CloseOnDisk();
multifile_hdf_dataset = 0;
ascii_hdf_dataset->CloseOnDisk();
ascii_hdf_dataset = 0;
-
+
hdf_sco_group->CloseOnDisk();
hdf_sco_group = 0;
hdf_group->CloseOnDisk();
if (isASCII) {
Handle(TColStd_HSequenceOfAsciiString) aFilesToRemove = new TColStd_HSequenceOfAsciiString;
aFilesToRemove->Append(aHDFUrl);
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
+ SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl),
+ aFilesToRemove, true);
}
-
- delete aHDFUrl;
}
catch (HDFexception) {
delete hdf_file;
aFilesToRemove->Append(aHDFUrl);
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
- delete aHDFUrl;
if (aLocked) anSCO->GetStudy()->GetProperties()->SetLocked(true);
_errorCode = "No persistent file";