LIB = libSalomeDS.la
LIB_SRC = \
+ SALOMEDS.cxx \
SALOMEDS_StudyManager_i.cxx \
SALOMEDS_UseCaseBuilder_i.cxx \
SALOMEDS_UseCaseIterator_i.cxx \
--- /dev/null
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SALOMEDS.cxx
+// Author : Sergey ANIKIN
+// Module : SALOME
+// $Header$
+
+
+#include <SALOMEDS.hxx>
+
+using namespace SALOMEDS;
+
+// PAL8065: san -- Global recursive mutex for SALOMEDS methods
+Utils_Mutex Locker::MutexDS;
+
+// PAL8065: san -- Global SALOMEDS locker
+Locker::Locker()
+: Utils_Locker( &MutexDS )
+{}
+
+Locker::~Locker()
+{}
+
+void SALOMEDS::lock()
+{
+ Locker::MutexDS.lock();
+}
+
+void SALOMEDS::unlock()
+{
+ Locker::MutexDS.unlock();
+}
--- /dev/null
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SALOMEDS.hxx
+// Author : Sergey ANIKIN
+// Module : SALOME
+// $Header$
+
+
+#ifndef SALOMEDS_HeaderFile
+#define SALOMEDS_HeaderFile
+
+#include <Utils_Mutex.hxx>
+
+namespace SALOMEDS
+{
+ // PAL8065: san -- Implementation of convenient locker based on simple recursive
+ // mutex for POSIX platforms.
+ // This class is to protect SALOMEDS CORBA methods which deal with OCC calls from
+ // parallel access by several threads
+ // To protect some method, an instance of Locker class should be created
+ // on the stack at the beginning of guarded code:
+ //
+ // Locker lock;
+ //
+ class Locker : public Utils_Locker
+ {
+ public:
+ Locker();
+ virtual ~Locker();
+
+ private:
+ static Utils_Mutex MutexDS;
+
+ friend void lock();
+ friend void unlock();
+ };
+
+ // Convenient functions to lock/unlock the global SALOMEDS mutex temporarily.
+ // In particular, "unlock-dosomething-lock" scheme should be used, when some non-SALOMEDS
+ // CORBA interface is called (component's engine), to avoid deadlocks in case of
+ // indirect recursion.
+ void lock();
+ void unlock();
+};
+
+#endif
#include <TCollection_AsciiString.hxx>
#include "SALOMEDS_AttributeComment_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
char* SALOMEDS_AttributeComment_i::Value()
{
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(TDataStd_Comment)::DownCast(_myAttr)->Get();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
void SALOMEDS_AttributeComment_i::SetValue(const char* value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
}
char* SALOMEDS_AttributeComment_i::Store() {
+ SALOMEDS::Locker lock;
+
return Value();
}
void SALOMEDS_AttributeComment_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetValue(value);
}
// $Header$
#include "SALOMEDS_AttributeDrawable_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable() {
+ SALOMEDS::Locker lock;
+
return (Handle(SALOMEDS_DrawableAttribute)::DownCast(_myAttr)->Get() == 1);
}
void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Standard_Integer val = 0;
if (value != 0) val = 1;
}
char* SALOMEDS_AttributeDrawable_i::Store() {
+ SALOMEDS::Locker lock;
+
return CORBA::string_dup(IsDrawable()?"1":"0");
}
void SALOMEDS_AttributeDrawable_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetDrawable(value[0] == '1');
}
// $Header$
#include "SALOMEDS_AttributeExpandable_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable() {
+ SALOMEDS::Locker lock;
+
return (Handle(SALOMEDS_ExpandableAttribute)::DownCast(_myAttr)->Get() == 1);
}
void SALOMEDS_AttributeExpandable_i::SetExpandable(CORBA::Boolean value) {
+ SALOMEDS::Locker lock;
+
Standard_Integer val = 0;
if (value != 0) val = 1;
Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val);
}
char* SALOMEDS_AttributeExpandable_i::Store() {
+ SALOMEDS::Locker lock;
+
return CORBA::string_dup(IsExpandable()?"1":"0");
}
void SALOMEDS_AttributeExpandable_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetExpandable(value[0] == '1');
}
// $Header$
#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>
char* SALOMEDS_AttributeExternalFileDef_i::Value()
{
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Get();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
// Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
// $Header$
#include "SALOMEDS_AttributeFileType_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>
char* SALOMEDS_AttributeFileType_i::Value()
{
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Get();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
void SALOMEDS_AttributeFileType_i::SetValue(const char* value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
// Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
// $Header$
#include "SALOMEDS_AttributeFlags_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
//=======================================================================
CORBA::Long SALOMEDS_AttributeFlags_i::GetFlags()
{
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr )->Get();
}
//=======================================================================
void SALOMEDS_AttributeFlags_i::SetFlags( CORBA::Long theFlags )
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr )->Set( theFlags );
}
//=======================================================================
CORBA::Boolean SALOMEDS_AttributeFlags_i::Get( CORBA::Long theFlag )
{
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr )->Get() & theFlag ? true : false;
}
//=======================================================================
void SALOMEDS_AttributeFlags_i::Set( CORBA::Long theFlag, CORBA::Boolean theValue )
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_FlagsAttribute) anAttr =
Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr );
if ( theValue )
// $Header$
#include "SALOMEDS_AttributeGraphic_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
void SALOMEDS_AttributeGraphic_i::SetVisibility( CORBA::Long theViewId,
CORBA::Boolean theValue )
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_GraphicAttribute) anAttr =
Handle(SALOMEDS_GraphicAttribute)::DownCast( _myAttr );
if ( !anAttr.IsNull() )
//=======================================================================
CORBA::Boolean SALOMEDS_AttributeGraphic_i::GetVisibility( CORBA::Long theViewId )
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_GraphicAttribute) anAttr =
Handle(SALOMEDS_GraphicAttribute)::DownCast( _myAttr );
return !anAttr.IsNull() ? anAttr->GetVisibility( theViewId ) : false;
// $Header$
#include "SALOMEDS_AttributeIOR_i.hxx"
+#include "SALOMEDS.hxx"
#include <TCollection_ExtendedString.hxx>
#include "SALOMEDS_SObject_i.hxx"
char* SALOMEDS_AttributeIOR_i::Value()
{
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(SALOMEDS_IORAttribute)::DownCast(_myAttr)->Get();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
void SALOMEDS_AttributeIOR_i::SetValue(const char* value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
SALOMEDS_Study_i* aStudy = _mySObject->GetStudyServant();
// $Header$
#include "SALOMEDS_AttributeInteger_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
CORBA::Long SALOMEDS_AttributeInteger_i::Value() {
+ SALOMEDS::Locker lock;
+
return Handle(TDataStd_Integer)::DownCast(_myAttr)->Get();
}
void SALOMEDS_AttributeInteger_i::SetValue(CORBA::Long value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(value);
}
char* SALOMEDS_AttributeInteger_i::Store() {
+ SALOMEDS::Locker lock;
+
char* IntVal = new char[25];
sprintf(IntVal, "%d", Value());
return IntVal;
}
void SALOMEDS_AttributeInteger_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
char *err = NULL;
CORBA::Long l = atol(value);
SetValue(l);
// $Header$
#include "SALOMEDS_AttributeLocalID_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
CORBA::Long SALOMEDS_AttributeLocalID_i::Value() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_LocalIDAttribute)::DownCast(_myAttr)->Get();
}
void SALOMEDS_AttributeLocalID_i::SetValue(CORBA::Long value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(value);
}
char* SALOMEDS_AttributeLocalID_i::Store() {
+ SALOMEDS::Locker lock;
+
char* IntVal = new char[25];
sprintf(IntVal, "%d", Value());
return IntVal;
}
void SALOMEDS_AttributeLocalID_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
char *err = NULL;
CORBA::Long l = atol(value);
SetValue(l);
// $Header$
#include "SALOMEDS_AttributeName_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>
using namespace std;
char* SALOMEDS_AttributeName_i::Value() {
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(TDataStd_Name)::DownCast(_myAttr)->Get();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
}
void SALOMEDS_AttributeName_i::SetValue(const char* theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TDataStd_Name)::DownCast(_myAttr)->Set(TCollection_ExtendedString((char*)theValue));
}
char* SALOMEDS_AttributeName_i::Store() {
+ SALOMEDS::Locker lock;
+
return Value();
}
void SALOMEDS_AttributeName_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetValue(value);
}
// $Header$
#include "SALOMEDS_AttributeOpened_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened() {
+ SALOMEDS::Locker lock;
+
return (Handle(SALOMEDS_OpenedAttribute)::DownCast(_myAttr)->Get() == 1);
}
void SALOMEDS_AttributeOpened_i::SetOpened(CORBA::Boolean value) {
+ SALOMEDS::Locker lock;
+
Standard_Integer val = 0;
if (value != 0) val = 1;
Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val);
}
char* SALOMEDS_AttributeOpened_i::Store() {
+ SALOMEDS::Locker lock;
+
return CORBA::string_dup(IsOpened()?"1":"0");
}
void SALOMEDS_AttributeOpened_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetOpened(value[0] == '1');
}
// $Header$
#include "SALOMEDS_AttributePersistentRef_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>
char* SALOMEDS_AttributePersistentRef_i::Value()
{
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(SALOMEDS_PersRefAttribute)::DownCast(_myAttr)->Get();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
void SALOMEDS_AttributePersistentRef_i::SetValue(const char* value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
}
char* SALOMEDS_AttributePersistentRef_i::Store() {
+ SALOMEDS::Locker lock;
+
return Value();
}
void SALOMEDS_AttributePersistentRef_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetValue(value);
}
// $Header$
#include "SALOMEDS_AttributePixMap_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TCollection_AsciiString.hxx>
using namespace std;
CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap() {
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(SALOMEDS_PixMapAttribute)::DownCast(_myAttr)->Get();
if (strcmp(TCollection_AsciiString(S).ToCString(), "None") == 0) return Standard_False;
return Standard_True;
}
char* SALOMEDS_AttributePixMap_i::GetPixMap() {
- CORBA::String_var S = CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDS_PixMapAttribute)::DownCast(_myAttr)->Get()).ToCString());
- return S._retn();
+ SALOMEDS::Locker lock;
+
+ CORBA::String_var S = CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDS_PixMapAttribute)::DownCast(_myAttr)->Get()).ToCString());
+ return S._retn();
}
void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
}
char* SALOMEDS_AttributePixMap_i::Store() {
+ SALOMEDS::Locker lock;
+
return GetPixMap();
}
// $Header$
#include "SALOMEDS_AttributePythonObject_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HArray1OfCharacter.hxx>
using namespace std;
void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(const_cast<char*>(theSequence), IsScript);
}
char* SALOMEDS_AttributePythonObject_i::GetObject() {
+ SALOMEDS::Locker lock;
+
char* aSeq = Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->GetObject();
CORBA::String_var aStr = CORBA::string_dup(aSeq);
return aStr._retn();
}
CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->IsScript();
}
char* SALOMEDS_AttributePythonObject_i::Store() {
+ SALOMEDS::Locker lock;
+
CORBA::String_var aString = GetObject();
char* aResult = new char[strlen(aString) + 2];
aResult[0] = IsScript()?'s':'n';
}
void SALOMEDS_AttributePythonObject_i::Restore(const char* theValue) {
+ SALOMEDS::Locker lock;
+
SetObject(&theValue[1], theValue[0]=='s');
}
// $Header$
#include "SALOMEDS_AttributeReal_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <sstream>
using namespace std;
}
CORBA::Double SALOMEDS_AttributeReal_i::Value() {
+ SALOMEDS::Locker lock;
+
return Handle(TDataStd_Real)::DownCast(_myAttr)->Get();
}
void SALOMEDS_AttributeReal_i::SetValue(CORBA::Double value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TDataStd_Real)::DownCast(_myAttr)->Set(value);
}
char* SALOMEDS_AttributeReal_i::Store() {
+ SALOMEDS::Locker lock;
+
// char* RealVal = new char[35];
// sprintf(RealVal, "%.20f", Value());
//return RealVal;
}
void SALOMEDS_AttributeReal_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
//char *err = NULL;
//CORBA::Double r = strtod(value, &err);
//if (err != value) SetValue(r);
// $Header$
#include "SALOMEDS_AttributeSelectable_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable() {
+ SALOMEDS::Locker lock;
+
return (Handle(SALOMEDS_SelectableAttribute)::DownCast(_myAttr)->Get() == 1);
}
void SALOMEDS_AttributeSelectable_i::SetSelectable(CORBA::Boolean value) {
+ SALOMEDS::Locker lock;
+
Standard_Integer val = 0;
if (value != 0) val = 1;
Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val);
}
char* SALOMEDS_AttributeSelectable_i::Store() {
+ SALOMEDS::Locker lock;
+
return CORBA::string_dup(IsSelectable()?"1":"0");
}
void SALOMEDS_AttributeSelectable_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SetSelectable(value[0] == '1');
}
// $Header$
#include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TColStd_HSequenceOfInteger.hxx>
using namespace std;
void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
for (int i = 0; i < other.length(); i++) {
SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
{
+ SALOMEDS::Locker lock;
+
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
Handle(SALOMEDS_SequenceOfIntegerAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr);
CorbaSeq->length(CasCadeSeq->Length());
void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Add(value);
}
void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Remove(index);
}
void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->ChangeValue(index, value);
}
CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index)
{
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Value(index);
}
CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length()
{
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Length();
}
char* SALOMEDS_AttributeSequenceOfInteger_i::Store() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_SequenceOfIntegerAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr);
Standard_Integer aLength = CasCadeSeq->Length();
char* aResult = new char[aLength * 25];
}
void SALOMEDS_AttributeSequenceOfInteger_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
char* aCopy = strdup(value);
// $Header$
#include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TColStd_HSequenceOfReal.hxx>
using namespace std;
void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal;
for (int i = 0; i < other.length(); i++) {
SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
{
+ SALOMEDS::Locker lock;
+
SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
Handle(SALOMEDS_SequenceOfRealAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr);
CorbaSeq->length(CasCadeSeq->Length());
void SALOMEDS_AttributeSequenceOfReal_i::Add(CORBA::Double value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Add(value);
}
void SALOMEDS_AttributeSequenceOfReal_i::Remove(CORBA::Long index)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Remove(index);
}
void SALOMEDS_AttributeSequenceOfReal_i::ChangeValue(CORBA::Long index, CORBA::Double value)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->ChangeValue(index, value);
}
CORBA::Double SALOMEDS_AttributeSequenceOfReal_i::Value(CORBA::Short index)
{
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Value(index);
}
CORBA::Long SALOMEDS_AttributeSequenceOfReal_i::Length()
{
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Length();
}
char* SALOMEDS_AttributeSequenceOfReal_i::Store() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_SequenceOfRealAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr);
Standard_Integer aLength = CasCadeSeq->Length();
char* aResult = new char[aLength * 25];
}
void SALOMEDS_AttributeSequenceOfReal_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal;
char* aCopy = strdup(value);
#include <TCollection_AsciiString.hxx>
#include "SALOMEDS_AttributeStudyProperties_i.hxx"
+#include "SALOMEDS.hxx"
#define CREATION_MODE_NOTDEFINED 0
#define CREATION_MODE_SCRATCH 1
using namespace std;
void SALOMEDS_AttributeStudyProperties_i::SetUserName(const char* theName) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr);
aProp->SetFirstName(const_cast<char*>(theName));
}
char* SALOMEDS_AttributeStudyProperties_i::GetUserName() {
+ SALOMEDS::Locker lock;
+
TCollection_ExtendedString S = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->GetCreatorName();
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString());
return c_s._retn();
CORBA::Long theDay,
CORBA::Long theMonth,
CORBA::Long theYear) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr);
int aTmp;
CORBA::Long& theDay,
CORBA::Long& theMonth,
CORBA::Long& theYear) {
+ SALOMEDS::Locker lock;
+
Standard_Integer aMinute;
Standard_Integer aHour;
Standard_Integer aDay;
}
void SALOMEDS_AttributeStudyProperties_i::SetCreationMode(const char* theMode) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr);
if (strcmp(theMode,"from scratch")==0) aProp->SetCreationMode(CREATION_MODE_SCRATCH);
}
char* SALOMEDS_AttributeStudyProperties_i::GetCreationMode() {
+ SALOMEDS::Locker lock;
+
CORBA::String_var c_s;
switch (Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->GetCreationMode()) {
case CREATION_MODE_SCRATCH: c_s = "from scratch"; break;
}
void SALOMEDS_AttributeStudyProperties_i::SetModified(CORBA::Long theModified) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->SetModified(theModified);
}
CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsModified() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->IsModified();
}
CORBA::Long SALOMEDS_AttributeStudyProperties_i::GetModified() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->GetModified();
}
void SALOMEDS_AttributeStudyProperties_i::SetLocked(CORBA::Boolean theLocked) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->SetLocked(theLocked);
}
CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsLocked() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->IsLocked();
}
CORBA::Long theDay,
CORBA::Long theMonth,
CORBA::Long theYear) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr);
aProp->SetUserName(const_cast<char*>(theName));
SALOMEDS::LongSeq_out theMonths,
SALOMEDS::LongSeq_out theYears,
CORBA::Boolean theWithCreator) {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfExtendedString) aNames;
Handle(TColStd_HSequenceOfInteger) aMinutes, aHours, aDays, aMonths, aYears;
Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr);
}
char* SALOMEDS_AttributeStudyProperties_i::Store() {
+ SALOMEDS::Locker lock;
+
Handle(TColStd_HSequenceOfExtendedString) aNames;
Handle(TColStd_HSequenceOfInteger) aMinutes, aHours, aDays, aMonths, aYears;
Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr);
}
void SALOMEDS_AttributeStudyProperties_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
char* aCopy = strdup(value);
if (aCopy[0] == 'f') SetCreationMode("from scratch");
else if (aCopy[0] == 'c') SetCreationMode("copy from");
#include <Standard_ErrorHandler.hxx>
#include "SALOMEDS_AttributeTableOfInteger_i.hxx"
+#include "SALOMEDS.hxx"
#include "Utils_ExceptHandlers.hxx"
#include <stdexcept>
}
void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
CORBA::String_var aStr = CORBA::string_dup(theTitle);
}
char* SALOMEDS_AttributeTableOfInteger_i::GetTitle() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString());
return c_s._retn();
void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATI_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
aTitles->length(aTable->GetNbRows());
void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATI_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitles() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
aTitles->length(aTable->GetNbColumns());
void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
- Unexpect aCatch (ATI_IncorrectIndex);
+ SALOMEDS::Locker lock;
+
+ Unexpect aCatch (ATI_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
aUnits->length(aTable->GetNbRows());
}
CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbRows() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr)->GetNbRows();
}
CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbColumns() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr)->GetNbColumns();
}
void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectIndex);
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theData)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectIndex);
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
}
CORBA::Boolean SALOMEDS_AttributeTableOfInteger_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr)->HasValue(theRow, theColumn);
}
CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATI_IncorrectIndex);
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::Long theRow)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
void SALOMEDS_AttributeTableOfInteger_i::SetNbColumns(CORBA::Long theNbColumns)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
aTable->SetNbColumns(theNbColumns);
}
bool SALOMEDS_AttributeTableOfInteger_i::ReadFromFile(const SALOMEDS::TMPFile& theStream)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
istrstream aStream((char*)&theStream[0], theStream.length());
SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile()
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
ostrstream ostr;
}
char* SALOMEDS_AttributeTableOfInteger_i::Store() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
ostrstream ostr;
}
void SALOMEDS_AttributeTableOfInteger_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr);
istrstream aStream(value, strlen(value));
// $Header$
#include "SALOMEDS_AttributeTableOfReal_i.hxx"
+#include "SALOMEDS.hxx"
#include <TColStd_HSequenceOfReal.hxx>
#include <TCollection_AsciiString.hxx>
}
void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
CORBA::String_var aStr = CORBA::string_dup(theTitle);
}
char* SALOMEDS_AttributeTableOfReal_i::GetTitle() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString());
return c_s._retn();
void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATR_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowTitles() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
aTitles->length(aTable->GetNbRows());
void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATR_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetColumnTitles() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
aTitles->length(aTable->GetNbColumns());
void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATR_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch (ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowUnits() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
aUnits->length(aTable->GetNbRows());
CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbRows() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr)->GetNbRows();
}
CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbColumns() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr)->GetNbColumns();
}
void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectIndex);
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theData)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData)
throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectIndex);
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
void SALOMEDS_AttributeTableOfReal_i::PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
}
CORBA::Boolean SALOMEDS_AttributeTableOfReal_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr)->HasValue(theRow, theColumn);
}
CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATR_IncorrectIndex);
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::GetRowSetIndices(CORBA::Long theRow)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
void SALOMEDS_AttributeTableOfReal_i::SetNbColumns(CORBA::Long theNbColumns)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
aTable->SetNbColumns(theNbColumns);
}
bool SALOMEDS_AttributeTableOfReal_i::ReadFromFile(const SALOMEDS::TMPFile& theStream)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
istrstream aStream((char*)&theStream[0], theStream.length());
SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfReal_i::SaveToFile()
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
ostrstream ostr;
}
char* SALOMEDS_AttributeTableOfReal_i::Store() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
ostrstream ostr;
}
void SALOMEDS_AttributeTableOfReal_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr);
istrstream aStream(value, strlen(value));
#include <string>
#include "SALOMEDS_AttributeTableOfString_i.hxx"
+#include "SALOMEDS.hxx"
#include "Utils_ExceptHandlers.hxx"
}
void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
CORBA::String_var aStr = CORBA::string_dup(theTitle);
}
char* SALOMEDS_AttributeTableOfString_i::GetTitle() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString());
return c_s._retn();
void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowTitles() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
aTitles->length(aTable->GetNbRows());
void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumnTitles() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
aTitles->length(aTable->GetNbColumns());
void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
}
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowUnits() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
aUnits->length(aTable->GetNbRows());
CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbRows() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr)->GetNbRows();
}
CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbColumns() {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr)->GetNbColumns();
}
void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theData)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRow)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& theData)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData)
throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectArgumentLength);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
void SALOMEDS_AttributeTableOfString_i::PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
CheckLocked();
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
}
CORBA::Boolean SALOMEDS_AttributeTableOfString_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) {
+ SALOMEDS::Locker lock;
+
return Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr)->HasValue(theRow, theColumn);
}
char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(ATS_IncorrectIndex);
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::GetRowSetIndices(CORBA::Long theRow)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
void SALOMEDS_AttributeTableOfString_i::SetNbColumns(CORBA::Long theNbColumns)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
aTable->SetNbColumns(theNbColumns);
}
bool SALOMEDS_AttributeTableOfString_i::ReadFromFile(const SALOMEDS::TMPFile& theStream)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
istrstream aStream((char*)&theStream[0], theStream.length());
SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfString_i::SaveToFile()
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
ostrstream ostr;
}
char* SALOMEDS_AttributeTableOfString_i::Store() {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
ostrstream ostr;
}
void SALOMEDS_AttributeTableOfString_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
istrstream aStream(value, strlen(value));
#include "SALOMEDS_AttributeTarget_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject)
{
+ SALOMEDS::Locker lock;
+
TDF_Label aLabel;
TDF_Tool::Label(_myAttr->Label().Data(),anObject->GetID(),aLabel,1);
_myAttr->Append(aLabel);
}
SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get() {
+ SALOMEDS::Locker lock;
+
TDF_LabelList aLList;
_myAttr->Get(aLList);
}
void SALOMEDS_AttributeTarget_i::Remove(SALOMEDS::SObject_ptr anObject) {
+ SALOMEDS::Locker lock;
+
TDF_Label aLabel;
CORBA::String_var anID = anObject->GetID();
TDF_Tool::Label(_myAttr->Label().Data(),anID.inout(),aLabel,1);
// $Header$
#include "SALOMEDS_AttributeTextColor_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TColStd_HArray1OfReal.hxx>
using namespace std;
SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor() {
+ SALOMEDS::Locker lock;
+
SALOMEDS::Color TextColor;
Handle(TColStd_HArray1OfReal) anArray = Handle(SALOMEDS_TextColorAttribute)::DownCast(_myAttr)->Array();
if (anArray.IsNull() || anArray->Length()!=3) {
}
void SALOMEDS_AttributeTextColor_i::SetTextColor(const SALOMEDS::Color& value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TColStd_HArray1OfReal) anArray = new TColStd_HArray1OfReal(1,3);
anArray->SetValue(1, value.R);
}
char* SALOMEDS_AttributeTextColor_i::Store() {
+ SALOMEDS::Locker lock;
+
SALOMEDS::Color aColor = TextColor();
char *Val = new char[75];
sprintf(Val, "%f %f %f", (float)aColor.R, (float)aColor.G, (float)aColor.B);
}
void SALOMEDS_AttributeTextColor_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SALOMEDS::Color aColor;
float r, g, b;
sscanf(value, "%f %f %f", &r, &g, &b);
// $Header$
#include "SALOMEDS_AttributeTextHighlightColor_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TColStd_HArray1OfReal.hxx>
using namespace std;
SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor() {
+ SALOMEDS::Locker lock;
+
SALOMEDS::Color TextHighlightColor;
Handle(TColStd_HArray1OfReal) anArray = Handle(SALOMEDS_TextHighlightColorAttribute)::DownCast(_myAttr)->Array();
if (anArray.IsNull() || anArray->Length()!=3) {
}
void SALOMEDS_AttributeTextHighlightColor_i::SetTextHighlightColor(const SALOMEDS::Color& value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
Handle(TColStd_HArray1OfReal) anArray = new TColStd_HArray1OfReal(1,3);
anArray->SetValue(1, value.R);
}
char* SALOMEDS_AttributeTextHighlightColor_i::Store() {
+ SALOMEDS::Locker lock;
+
SALOMEDS::Color aColor = TextHighlightColor();
char *Val = new char[75];
sprintf(Val, "%f %f %f", (float)aColor.R, (float)aColor.G, (float)aColor.B);
}
void SALOMEDS_AttributeTextHighlightColor_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
SALOMEDS::Color aColor;
float r, g, b;
sscanf(value, "%f %f %f", &r, &g, &b);
#include <TDF_Tool.hxx>
#include "SALOMEDS_AttributeTreeNode_i.hxx"
+#include "SALOMEDS.hxx"
#include "utilities.h"
}
void SALOMEDS_AttributeTreeNode_i::SetFather(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->SetFather(GetNode(theValue,_myAttr));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasFather() {
+ SALOMEDS::Locker lock;
+
return _myAttr->HasFather();
}
SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetFather() {
+ SALOMEDS::Locker lock;
+
SALOMEDS_AttributeTreeNode_i* aTreeNode =
new SALOMEDS_AttributeTreeNode_i(_myAttr->Father(),_mySObject);
return aTreeNode->_this();
}
void SALOMEDS_AttributeTreeNode_i::SetPrevious(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->SetPrevious(GetNode(theValue,_myAttr));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasPrevious() {
+ SALOMEDS::Locker lock;
+
return _myAttr->HasPrevious();
}
SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetPrevious() {
+ SALOMEDS::Locker lock;
+
SALOMEDS_AttributeTreeNode_i* aTreeNode =
new SALOMEDS_AttributeTreeNode_i(_myAttr->Previous(),_mySObject);
return aTreeNode->_this();
}
void SALOMEDS_AttributeTreeNode_i::SetNext(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->SetNext(GetNode(theValue,_myAttr));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasNext() {
+ SALOMEDS::Locker lock;
+
return _myAttr->HasNext();
}
SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetNext() {
+ SALOMEDS::Locker lock;
+
SALOMEDS_AttributeTreeNode_i* aTreeNode =
new SALOMEDS_AttributeTreeNode_i(_myAttr->Next(),_mySObject);
return aTreeNode->_this();
}
void SALOMEDS_AttributeTreeNode_i::SetFirst(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->SetFirst(GetNode(theValue,_myAttr));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasFirst() {
+ SALOMEDS::Locker lock;
+
return _myAttr->HasFirst();
}
SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetFirst() {
+ SALOMEDS::Locker lock;
+
SALOMEDS_AttributeTreeNode_i* aTreeNode =
new SALOMEDS_AttributeTreeNode_i(_myAttr->First(),_mySObject);
return aTreeNode->_this();
}
void SALOMEDS_AttributeTreeNode_i::SetTreeID(const char* value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->SetTreeID(Standard_GUID(_myAttr->ID()));
}
char* SALOMEDS_AttributeTreeNode_i::GetTreeID() {
+ SALOMEDS::Locker lock;
+
char aGUID[40];
_myAttr->ID().ToCString(aGUID);
return CORBA::string_dup(aGUID);
}
void SALOMEDS_AttributeTreeNode_i::Append(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->Append(GetNode(theValue,_myAttr));
}
void SALOMEDS_AttributeTreeNode_i::Prepend(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->Prepend(GetNode(theValue,_myAttr));
}
void SALOMEDS_AttributeTreeNode_i::InsertBefore(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->InsertBefore(GetNode(theValue,_myAttr));
}
void SALOMEDS_AttributeTreeNode_i::InsertAfter(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->InsertAfter(GetNode(theValue,_myAttr));
}
void SALOMEDS_AttributeTreeNode_i::Remove() {
+ SALOMEDS::Locker lock;
+
CheckLocked();
_myAttr->Remove();
}
CORBA::Long SALOMEDS_AttributeTreeNode_i::Depth() {
+ SALOMEDS::Locker lock;
+
return _myAttr->Depth();
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsRoot() {
+ SALOMEDS::Locker lock;
+
return _myAttr->IsRoot();
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsDescendant(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
return _myAttr->IsDescendant(GetNode(theValue,_myAttr));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsFather(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
return _myAttr->IsFather(GetNode(theValue,_myAttr));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsChild(SALOMEDS::AttributeTreeNode_ptr theValue) {
+ SALOMEDS::Locker lock;
+
return _myAttr->IsChild(GetNode(theValue,_myAttr));
}
}
char* SALOMEDS_AttributeTreeNode_i::Store() {
+ SALOMEDS::Locker lock;
+
char* aStr[4];
if (HasFather()) aStr[0] = GetFather()->Label(); else aStr[0] = "!";
}
void SALOMEDS_AttributeTreeNode_i::Restore(const char* value) {
+ SALOMEDS::Locker lock;
+
Handle(TDataStd_TreeNode) aNode = Handle(TDataStd_TreeNode)::DownCast(_myAttr);
Handle(TDF_Data) DF = TDocStd_Document::Get(_myAttr->Label())->GetData();
// $Header$
#include "SALOMEDS_AttributeUserID_i.hxx"
+#include "SALOMEDS.hxx"
+
#include <TCollection_ExtendedString.hxx>
using namespace std;
char* SALOMEDS_AttributeUserID_i::Value() {
+ SALOMEDS::Locker lock;
+
char aGUID[40];
Handle(TDataStd_UAttribute)::DownCast(_myAttr)->ID().ToCString(aGUID);
CORBA::String_var c_s = CORBA::string_dup(aGUID);
}
void SALOMEDS_AttributeUserID_i::SetValue(const char* value) {
+ SALOMEDS::Locker lock;
+
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
Handle(TDataStd_UAttribute)::DownCast(_myAttr)->SetID(Standard_GUID(Standard_CString(Str)));
#include <TDF_Tool.hxx>
+#include "SALOMEDS.hxx"
#include "SALOMEDS_ChildIterator_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
#include "utilities.h"
//============================================================================
void SALOMEDS_ChildIterator_i::Init()
{
+ SALOMEDS::Locker lock;
+
_it.Initialize(_lab);
}
//============================================================================
void SALOMEDS_ChildIterator_i::InitEx(CORBA::Boolean theIsAllLevels)
{
+ SALOMEDS::Locker lock;
+
_it.Initialize(_lab,theIsAllLevels);
}
//============================================================================
CORBA::Boolean SALOMEDS_ChildIterator_i::More()
{
+ SALOMEDS::Locker lock;
+
return _it.More();
}
//============================================================================
void SALOMEDS_ChildIterator_i::Next()
{
+ SALOMEDS::Locker lock;
+
_it.Next();
}
SALOMEDS::SObject_ptr SALOMEDS_ChildIterator_i::Value()
{
+ SALOMEDS::Locker lock;
+
return SALOMEDS_SObject_i::NewRef(_study,_it.Value())._retn();
}
#include "SALOMEDS_GenericAttribute_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS_Study_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
char* SALOMEDS_GenericAttribute_i::Type()
{
+ SALOMEDS::Locker lock;
+
return CORBA::string_dup(SALOMEDS::GetType(_myBasicAttr).c_str());
}
SALOMEDS::SObject_ptr SALOMEDS_GenericAttribute_i::GetSObject()
{
- return _mySObject->_this();;
+ SALOMEDS::Locker lock;
+
+ return _mySObject->_this();
}
void SALOMEDS_GenericAttribute_i::CheckLocked()
throw (SALOMEDS::GenericAttribute::LockProtection)
{
+ SALOMEDS::Locker lock;
+
_mySObject->GetStudyServant()->CheckLocked();
}
#include "SALOMEDS_SComponentIterator_i.hxx"
#include "SALOMEDS_SComponent_i.hxx"
+#include "SALOMEDS.hxx"
using namespace std;
//============================================================================
void SALOMEDS_SComponentIterator_i::Init()
{
+ SALOMEDS::Locker lock;
+
_it.Initialize (_lab);
}
//============================================================================
CORBA::Boolean SALOMEDS_SComponentIterator_i::More()
{
+ SALOMEDS::Locker lock;
+
if (!_it.More())
return false;
TDF_Label L = _it.Value();
//============================================================================
void SALOMEDS_SComponentIterator_i::Next()
{
+ SALOMEDS::Locker lock;
+
_it.Next();
}
//============================================================================
SALOMEDS::SComponent_ptr SALOMEDS_SComponentIterator_i::Value()
{
+ SALOMEDS::Locker lock;
+
return SALOMEDS_SComponent_i::NewRef(_study,_it.Value())._retn();
}
#include "SALOMEDS_SComponent_i.hxx"
#include "SALOMEDS_Study_i.hxx"
+#include "SALOMEDS.hxx"
#include "utilities.h"
//============================================================================
char* SALOMEDS_SComponent_i::ComponentDataType()
{
+ SALOMEDS::Locker lock;
+
//DEB
// MESSAGE("In SALOMEDS_SComponent_i::ComponentDataType");
// TCollection_AsciiString anEntry;
//============================================================================
CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR)
{
+ SALOMEDS::Locker lock;
+
Handle(SALOMEDS_IORAttribute) ior;
if (!_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),ior) )
return false;
#include "SALOMEDS_SObject_i.hxx"
//SALOMEDS Headers
+#include <SALOMEDS.hxx>
#include "SALOMEDS_Study_i.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOMEDS_SComponent_i.hxx"
namespace SALOMEDS{
-
const char* Str(const TCollection_ExtendedString& theString)
{
return TCollection_AsciiString(theString).ToCString();
}
}
+
+//static SALOMEDS::Mutex SObjMutex;
//============================================================================
SALOMEDS_Study_i::TSObjectHolder
//============================================================================
char* SALOMEDS_SObject_i::GetID()
{
+ Locker lock;
+
TCollection_AsciiString anEntry;
TDF_Tool::Entry(_lab,anEntry);
return CORBA::string_dup(anEntry.ToCString());
SALOMEDS::SComponent_ptr SALOMEDS_SObject_i::GetFatherComponent()
{
+ Locker lock;
+
TDF_Label aSCompLabel = GetFatherComponentLabel();
return SALOMEDS_SComponent_i::NewRef(_study,aSCompLabel)._retn();
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_SObject_i::GetFather()
{
+ Locker lock;
+
return SALOMEDS_SObject_i::NewRef(_study,_lab.Father())._retn();
}
//============================================================================
CORBA::Boolean SALOMEDS_SObject_i::ReferencedObject(SALOMEDS::SObject_out theSObject)
{
+ Locker lock;
+
Handle(TDF_Reference) aRef;
if (!_lab.FindAttribute(TDF_Reference::GetID(),aRef))
return false;
//============================================================================
CORBA::Boolean SALOMEDS_SObject_i::FindSubObject(CORBA::Long theTag, SALOMEDS::SObject_out theSObject)
{
+ Locker lock;
+
TDF_Label aLabel = _lab.FindChild(theTag,false);
if(aLabel.IsNull())
return false;
//============================================================================
char* SALOMEDS_SObject_i::Name()
{
+ Locker lock;
+
return CORBA::string_dup(_name.c_str());
}
//============================================================================
void SALOMEDS_SObject_i::Name(const char* theName)
{
+ Locker lock;
+
_name = theName;
}
//============================================================================
CORBA::Short SALOMEDS_SObject_i::Tag()
{
+ Locker lock;
+
return _lab.Tag();
}
//============================================================================
CORBA::Short SALOMEDS_SObject_i::Depth()
{
+ Locker lock;
+
return _lab.Depth();
}
//============================================================================
CORBA::Object_ptr SALOMEDS_SObject_i::GetObject()
{
+ Locker lock;
+
try {
Handle(SALOMEDS_IORAttribute) anAttr;
if(_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),anAttr)){
*/
//============================================================================
char* SALOMEDS_SObject_i::GetName() {
+ Locker lock;
+
Handle(TDataStd_Name) anAttr;
if(_lab.FindAttribute(TDataStd_Name::GetID(),anAttr))
return CORBA::string_dup(Str(anAttr->Get()));
*/
//============================================================================
char* SALOMEDS_SObject_i::GetComment() {
+ Locker lock;
+
Handle(TDataStd_Comment) anAttr;
if(_lab.FindAttribute(TDataStd_Comment::GetID(), anAttr))
return CORBA::string_dup(Str(anAttr->Get()));
*/
//============================================================================
char* SALOMEDS_SObject_i::GetIOR() {
+ Locker lock;
+
Handle(SALOMEDS_IORAttribute) anAttr;
if(_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),anAttr))
return CORBA::string_dup(Str(anAttr->Get()));
SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes()
{
+ Locker lock;
+
SALOMEDS::ListOfAttributes_var aSeqOfAttr = new SALOMEDS::ListOfAttributes;
if(_lab.NbAttributes() > 0){
Standard_Integer i = 0;
SALOMEDS_SObject_i::FindAttribute(SALOMEDS::GenericAttribute_out theAttribute,
const char* theType)
{
+ Locker lock;
+
TAttrHolder anAttr = _FindGenAttribute(theType);
SALOMEDS::GenericAttribute_var anGenAttr = anAttr.second;
if(!CORBA::is_nil(anGenAttr)){
SALOMEDS::GenericAttribute_ptr
SALOMEDS_SObject_i::FindOrCreateAttribute(const char* theType)
{
+ Locker lock;
+
TAttrHolder anAttrHolder = _FindGenAttribute(theType);
SALOMEDS::GenericAttribute_var anGenAttr = anAttrHolder.second;
if(!anGenAttr->_is_nil())
//============================================================================
void SALOMEDS_SObject_i::RemoveAttribute(const char* theType)
{
+ Locker lock;
+
_study->CheckLocked();
if(strcmp(theType, "AttributeIOR") == 0) { // postponed removing of CORBA objects
Handle(SALOMEDS_IORAttribute) anAttr;
#include "SALOMEDS_StudyPropertiesAttribute.hxx"
#include "SALOMEDS_Tool.hxx"
+#include "SALOMEDS.hxx"
#include "Utils_CorbaException.hxx"
#include "Utils_ExceptHandlers.hxx"
SALOMEDS::SComponent_ptr
SALOMEDS_StudyBuilder_i::NewComponent(const char* DataType)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
//Always create component under main label.
TDF_Label L = _doc->Main();
void SALOMEDS_StudyBuilder_i::DefineComponentInstance(SALOMEDS::SComponent_ptr theComponent,
CORBA::Object_ptr theObject)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(CORBA::is_nil(theComponent) || CORBA::is_nil(theObject))
void
SALOMEDS_StudyBuilder_i::RemoveComponent(SALOMEDS::SComponent_ptr theComponent)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
RemoveObject(theComponent);
}
SALOMEDS::SObject_ptr
SALOMEDS_StudyBuilder_i::NewObject(SALOMEDS::SObject_ptr theFatherObject)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(CORBA::is_nil(theFatherObject))
SALOMEDS_StudyBuilder_i::NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject,
CORBA::Long theTag)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(CORBA::is_nil(theFatherObject))
//============================================================================
void SALOMEDS_StudyBuilder_i::RemoveObject(SALOMEDS::SObject_ptr theSObject)
{
+ SALOMEDS::Locker lock;
+
RemoveSObject(theSObject);
}
//============================================================================
void SALOMEDS_StudyBuilder_i::RemoveObjectWithChildren(SALOMEDS::SObject_ptr theSObject)
{
+ SALOMEDS::Locker lock;
+
if(SALOMEDS_SObject_i* aSObject = RemoveSObject(theSObject,false)){
SALOMEDS_ChildIterator_i aChildIter(_study,aSObject->GetLabel(),true);
for(; aChildIter.More(); aChildIter.Next()){
TCollection_AsciiString ch(res);
SALOMEDS::SObject_var aSObject = SALOMEDS_SObject_i::NewRef(theStudy,aCurrentLabel);
-
+
+ // PAL8065: san - Translate_persistentID_to_IOR() should always be called from some CORBA method
+ // protected with a lock
+ SALOMEDS::unlock();
CORBA::String_var anIOR =
theDriver->LocalPersistentIDToIOR(aSObject,ch.ToCString(),theIsMultiFile,theIsASCII);
+ SALOMEDS::lock();
+
SALOMEDS_IORAttribute::Set(aCurrentLabel,const_cast<char*>(anIOR.in()),theStudy);
}
SALOMEDS::Driver_ptr theDriver)
throw(SALOME::SALOME_Exception)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBSalomeException);
if(CORBA::is_nil(theSComponent))
std::string aDir(aHDFPath.ToCString());
aDir = aDir.substr(0,aDir.rfind('/') + 1);
+ SALOMEDS::unlock();
CORBA::Boolean aResult = (ASCIIfileState[0]=='A')?
theDriver->LoadASCII(theSComponent, aStreamFile.in(), aDir.c_str(), aMultifileState[0]=='M'):
theDriver->Load(theSComponent, aStreamFile.in(), aDir.c_str(), aMultifileState[0]=='M');
+ SALOMEDS::lock();
+
if(!aResult) {
RemoveAttribute( theSComponent, "AttributeIOR" );
if (isASCII) {
SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SALOMEDS::SObject_ptr theObject,
const char* theTypeOfAttribute)
{
+ SALOMEDS::Locker lock;
+
if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theObject))
return aSObject->FindOrCreateAttribute(theTypeOfAttribute);
SALOMEDS::GenericAttribute_out theAttr,
const char* theTypeOfAttribute)
{
+ SALOMEDS::Locker lock;
+
if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theObject))
return aSObject->FindAttribute(theAttr,theTypeOfAttribute);
void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr theSObject,
const char* aTypeOfAttribute)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(CORBA::is_nil(theSObject))
SALOMEDS_StudyBuilder_i::Addreference(SALOMEDS::SObject_ptr me,
SALOMEDS::SObject_ptr theReferencedObject)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(CORBA::is_nil(me) || CORBA::is_nil(theReferencedObject))
return;
//============================================================================
void SALOMEDS_StudyBuilder_i::RemoveReference(SALOMEDS::SObject_ptr me)
{
+ SALOMEDS::Locker lock;
+
SALOMEDS::SObject_var theReferencedObject;
if(!me->ReferencedObject(theReferencedObject)) return; //No reference is found
//============================================================================
void SALOMEDS_StudyBuilder_i::AddDirectory(const char* thePath)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory();
//============================================================================
void SALOMEDS_StudyBuilder_i::SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
if(CORBA::is_nil(anObject))
//============================================================================
bool SALOMEDS_StudyBuilder_i::IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID)
{
+ SALOMEDS::Locker lock;
+
if(CORBA::is_nil(anObject))
return false;
//============================================================================
void SALOMEDS_StudyBuilder_i::NewCommand()
{
+ SALOMEDS::Locker lock;
+
// mpv: for SAL2114 - unset "lock changed" flag at the operation start
Handle(SALOMEDS_StudyPropertiesAttribute) anAttr;
if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) {
//============================================================================
void SALOMEDS_StudyBuilder_i::CommitCommand() throw (SALOMEDS::StudyBuilder::LockProtection)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBLockProtection);
Handle(SALOMEDS_StudyPropertiesAttribute) anAttr;
if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) {
//============================================================================
CORBA::Boolean SALOMEDS_StudyBuilder_i::HasOpenCommand()
{
+ SALOMEDS::Locker lock;
+
return _doc->HasOpenCommand();
}
//============================================================================
void SALOMEDS_StudyBuilder_i::AbortCommand()
{
+ SALOMEDS::Locker lock;
+
_study->UndoPostponed(0);
_doc->AbortCommand();
//============================================================================
void SALOMEDS_StudyBuilder_i::Undo() throw (SALOMEDS::StudyBuilder::LockProtection)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBLockProtection);
Handle(SALOMEDS_StudyPropertiesAttribute) anAttr;
if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) {
*/
//============================================================================
void SALOMEDS_StudyBuilder_i::Redo() throw (SALOMEDS::StudyBuilder::LockProtection)
-{
+{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBLockProtection);
Handle(SALOMEDS_StudyPropertiesAttribute) anAttr;
if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) {
//============================================================================
CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableUndos()
{
+ SALOMEDS::Locker lock;
+
return _doc->GetAvailableUndos();
}
//============================================================================
CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableRedos()
{
+ SALOMEDS::Locker lock;
+
return _doc->GetAvailableRedos();
}
//============================================================================
CORBA::Long SALOMEDS_StudyBuilder_i::UndoLimit()
{
+ SALOMEDS::Locker lock;
+
return _doc->GetUndoLimit();
}
//============================================================================
void SALOMEDS_StudyBuilder_i::UndoLimit(CORBA::Long n)
{
+ SALOMEDS::Locker lock;
+
CheckLocked();
_doc->SetUndoLimit (n);
}
void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* theValue)
throw(SALOMEDS::StudyBuilder::LockProtection)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBLockProtection);
CheckLocked();
void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue)
throw(SALOMEDS::StudyBuilder::LockProtection)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBLockProtection);
CheckLocked();
void SALOMEDS_StudyBuilder_i::SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue)
throw(SALOMEDS::StudyBuilder::LockProtection)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SBLockProtection);
CheckLocked();
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>
+#include "SALOMEDS.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
//============================================================================
SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::NewStudy(const char* theStudyName)
{
+ SALOMEDS::Locker lock;
+
Handle(TDocStd_Document) aDocument;
_OCAFApp->NewDocument("SALOME_STUDY",aDocument);
SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* theURL)
throw(SALOME::SALOME_Exception)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(SalomeException);
MESSAGE("Begin of SALOMEDS_StudyManager_i::Open");
//============================================================================
void SALOMEDS_StudyManager_i::Close(SALOMEDS::Study_ptr aStudy)
{
+ SALOMEDS::Locker lock;
+
if(aStudy->_is_nil()) return;
aStudy->RemovePostponed(-1);
//============================================================================
void SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile)
{
+ SALOMEDS::Locker lock;
+
CORBA::String_var anURL = theStudy->URL();
if(strcmp(anURL.in(),"") == 0){
MESSAGE( "No path specified to save the study. Nothing done");
void SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile)
{
+ SALOMEDS::Locker lock;
+
CORBA::String_var anURL = theStudy->URL();
if(strcmp(anURL.in(),"") == 0){
MESSAGE( "No path specified to save the study. Nothing done");
//============================================================================
void SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile)
{
+ SALOMEDS::Locker lock;
+
_SaveAs(aUrl,theStudy,theMultiFile, false);
}
void SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile)
{
+ SALOMEDS::Locker lock;
+
_SaveAs(aUrl,theStudy,theMultiFile, true);
}
if(!aComp->_is_nil()){
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aComp);
if (!CORBA::is_nil(aDriver)) {
+ // PAL8065: san - _SaveAs() should always be called from some CORBA method protected with a lock
+ SALOMEDS::unlock();
SB->LoadWith(sco, aDriver);
+ SALOMEDS::lock();
}
}
}
*/
//============================================================================
CORBA::Boolean SALOMEDS_StudyManager_i::CanCopy(SALOMEDS::SObject_ptr theObject) {
- SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
+ SALOMEDS::Driver_var Engine;
+ { // Guarded block of code
+ SALOMEDS::Locker lock;
- if(aComponent->_is_nil())
- return false;
+ SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
- if(aComponent == theObject)
- return false;
+ if(aComponent->_is_nil())
+ return false;
- CORBA::String_var IOREngine;
- if(!aComponent->ComponentIOR(IOREngine))
- return false;
+ if(aComponent == theObject)
+ return false;
- CORBA::Object_var obj = _orb->string_to_object(IOREngine);
- SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
- if (CORBA::is_nil(Engine))
- return false;
+ CORBA::String_var IOREngine;
+ if(!aComponent->ComponentIOR(IOREngine))
+ return false;
+ CORBA::Object_var obj = _orb->string_to_object(IOREngine);
+ Engine = SALOMEDS::Driver::_narrow(obj);
+ if (CORBA::is_nil(Engine))
+ return false;
+ } // End of guarded block of code
return Engine->CanCopy(theObject);
}
continue;
}
- if (!Handle(SALOMEDS_IORAttribute)::DownCast(anAttr).IsNull()) { // IOR => ID and TMPFile of Engine
- TCollection_AsciiString anEntry;
- TDF_Tool::Entry(theSource, anEntry);
- SALOMEDS::SObject_var aSO = theSourceStudy->FindObjectID(anEntry.ToCString());
- CORBA::Long anObjID;
- SALOMEDS::TMPFile_var aStream = theEngine->CopyFrom(aSO, anObjID);
- int aLen = aStream->length();
- TCollection_ExtendedString aResStr("");
- for(a = 0; a < aLen; a++) {
- aResStr += TCollection_ExtendedString(ToExtCharacter((Standard_Character)aStream[a]));
- }
- TDataStd_Integer::Set(aAuxTargetLabel, anObjID);
- TDataStd_Name::Set(aAuxTargetLabel, aResStr);
+ if (Handle(SALOMEDS_IORAttribute)::DownCast(anAttr).IsNull()) { // IOR => ID and TMPFile of Engine
+ Handle(TDF_Attribute) aNewAttribute = anAttr->NewEmpty();
+ aTargetLabel.AddAttribute(aNewAttribute);
+ anAttr->Paste(aNewAttribute, aRT);
continue;
}
- Handle(TDF_Attribute) aNewAttribute = anAttr->NewEmpty();
- aTargetLabel.AddAttribute(aNewAttribute);
- anAttr->Paste(aNewAttribute, aRT);
+
+ TCollection_AsciiString anEntry;
+ TDF_Tool::Entry(theSource, anEntry);
+ SALOMEDS::SObject_var aSO = theSourceStudy->FindObjectID(anEntry.ToCString());
+ CORBA::Long anObjID;
+
+ // PAL8065: san - CopyLabel() should always be called from some CORBA method protected with a lock
+ SALOMEDS::unlock();
+ SALOMEDS::TMPFile_var aStream = theEngine->CopyFrom(aSO, anObjID);
+ SALOMEDS::lock();
+
+ int aLen = aStream->length();
+ TCollection_ExtendedString aResStr("");
+ for(a = 0; a < aLen; a++) {
+ aResStr += TCollection_ExtendedString(ToExtCharacter((Standard_Character)aStream[a]));
+ }
+ TDataStd_Integer::Set(aAuxTargetLabel, anObjID);
+ TDataStd_Name::Set(aAuxTargetLabel, aResStr);
+
// aRT->SetRelocation(anAttr, aNewAttribute);
}
}
*/
//============================================================================
CORBA::Boolean SALOMEDS_StudyManager_i::Copy(SALOMEDS::SObject_ptr theObject) {
+ SALOMEDS::Locker lock;
+
// adoptation for alliances datamodel copy: without IOR attributes !!!
// copy only SObjects and attributes without component help
SALOMEDS::GenericAttribute_var anAttribute;
*/
//============================================================================
CORBA::Boolean SALOMEDS_StudyManager_i::CanPaste(SALOMEDS::SObject_ptr theObject) {
- if (_clipboard.IsNull()) return false;
+ CORBA::String_var aName;
+ Standard_Integer anID;
+ SALOMEDS::Driver_var Engine;
+ { // Guarded block of code
+ SALOMEDS::Locker lock;
- Handle(TDataStd_Comment) aCompName;
- if (!_clipboard->Main().Root().FindAttribute(TDataStd_Comment::GetID(), aCompName)) return false;
- Handle(TDataStd_Integer) anObjID;
- if (!_clipboard->Main().Father().FindChild(2).FindAttribute(TDataStd_Integer::GetID(), anObjID))
- return false;
+ if (_clipboard.IsNull()) return false;
- SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
- if(aComponent->_is_nil())
- return false;
+ Handle(TDataStd_Comment) aCompName;
+ if (!_clipboard->Main().Root().FindAttribute(TDataStd_Comment::GetID(), aCompName)) return false;
+ Handle(TDataStd_Integer) anObjID;
+ if (!_clipboard->Main().Father().FindChild(2).FindAttribute(TDataStd_Integer::GetID(), anObjID))
+ return false;
+
+ SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
+ if(aComponent->_is_nil())
+ return false;
- CORBA::String_var IOREngine;
- if(!aComponent->ComponentIOR(IOREngine))
- return false;
+ CORBA::String_var IOREngine;
+ if(!aComponent->ComponentIOR(IOREngine))
+ return false;
- CORBA::Object_var obj = _orb->string_to_object(IOREngine);
- SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
- if (CORBA::is_nil(Engine))
- return false;
+ CORBA::Object_var obj = _orb->string_to_object(IOREngine);
+ Engine = SALOMEDS::Driver::_narrow(obj) ;
+ if (CORBA::is_nil(Engine))
+ return false;
- return Engine->CanPaste(TCollection_AsciiString(aCompName->Get()).ToCString(),anObjID->Get());
+ aName = CORBA::string_dup( TCollection_AsciiString(aCompName->Get()).ToCString() );
+ anID = anObjID->Get();
+ } // End of guarded block of code
+ return Engine->CanPaste(aName.in(),anID);
}
//============================================================================
/*! Function : PasteLabel
TDF_Tool::Entry(aTargetLabel, anEntry);
SALOMEDS::SObject_var aPastedSO = theDestinationStudy->FindObjectID(anEntry.ToCString());
if(isFirstElement){
+ // PAL8065: san - PasteLabel() should always be called from some CORBA method protected with a lock
+ SALOMEDS::unlock();
SALOMEDS::SObject_var aDestSO =
theEngine->PasteInto(aTMPFil.in(),
anObjID->Get(),
aPastedSO->GetFatherComponent());
+ SALOMEDS::lock();
TDF_Tool::Label(theDestinationStart.Data(), aDestSO->GetID(), aTargetLabel);
}else
+ // PAL8065: san - PasteLabel() should always be called from some CORBA method protected with a lock
+ SALOMEDS::unlock();
theEngine->PasteInto(aTMPFil.in(),anObjID->Get(),aPastedSO);
+ SALOMEDS::lock();
}
}
SALOMEDS::SObject_ptr SALOMEDS_StudyManager_i::Paste(SALOMEDS::SObject_ptr theObject)
throw(SALOMEDS::StudyBuilder::LockProtection)
{
+ SALOMEDS::Locker lock;
+
Unexpect aCatch(LockProtection);
PortableServer::ServantBase_var aServant = GetServant(theObject,_poa);
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
+#include "SALOMEDS.hxx"
#include "SALOMEDS_Study_i.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
//============================================================================
void SALOMEDS_Study_i::CheckLocked()
{
+ SALOMEDS::Locker lock;
+
if(_doc->HasOpenCommand())
return;
//============================================================================
char* SALOMEDS_Study_i::GetPersistentReference()
{
+ SALOMEDS::Locker lock;
+
return URL();
}
//============================================================================
//============================================================================
char* SALOMEDS_Study_i::GetTransientReference()
{
+ SALOMEDS::Locker lock;
+
CORBA::String_var IOR;
Handle(SALOMEDS_IORAttribute) Att;
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsEmpty()
{
+ SALOMEDS::Locker lock;
+
if (_doc.IsNull()) return true;
return _doc->IsEmpty();
}
SALOMEDS::SComponent_ptr
SALOMEDS_Study_i::FindComponent(const char* theComponentName)
{
+ SALOMEDS::Locker lock;
+
bool anIsFound = false;
SALOMEDS::SComponent_var aSComponent;
SALOMEDS_SComponentIterator_i aComponentIter(this,_doc);
//============================================================================
SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponentID(const char* aComponentID)
{
+ SALOMEDS::Locker lock;
+
// Iterate on each components defined in the study
// Get the component ID and compare with aComponentID
bool _find = false;
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObject(const char* theObjectName)
{
+ SALOMEDS::Locker lock;
+
// Iterate to all components defined in the study
// After testing the component name, iterate in all objects defined under
// components (function _FindObject)
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectID(const char* anObjectID)
{
+ SALOMEDS::Locker lock;
+
// Convert aSO->GetID in TDF_Label.
TDF_Label Lab;
TDF_Tool::Label(_doc->GetData(), (char*)anObjectID, Lab);
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_Study_i::CreateObjectID(const char* anObjectID)
{
+ SALOMEDS::Locker lock;
+
// Convert aSO->GetID in TDF_Label.
TDF_Label Lab;
TDF_Tool::Label(_doc->GetData(), (char*)anObjectID, Lab, Standard_True);
SALOMEDS_Study_i::FindObjectByName(const char* theObjectName,
const char* theComponentName)
{
+ SALOMEDS::Locker lock;
+
SALOMEDS::Study::ListOfSObject_var aListOfSObj = new SALOMEDS::Study::ListOfSObject ;
aListOfSObj->length(0);
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectIOR(const char* theObjectIOR)
{
+ SALOMEDS::Locker lock;
+
// firstly searching in the datamap for optimization
char* anIOR = const_cast<char*>(theObjectIOR);
if(myIORLabels.IsBound(anIOR)){
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectByPath(const char* thePath)
{
+ SALOMEDS::Locker lock;
+
TCollection_AsciiString aPath(CORBA::string_dup(thePath)), aToken;
SALOMEDS::SObject_var aSO = SALOMEDS::SObject::_nil();
int i = 1, aLength = aPath.Length();
//============================================================================
char* SALOMEDS_Study_i::GetObjectPath(CORBA::Object_ptr theObject)
{
+ SALOMEDS::Locker lock;
+
TCollection_AsciiString aPath("");
if(CORBA::is_nil(theObject))
return CORBA::string_dup(aPath.ToCString());
//============================================================================
void SALOMEDS_Study_i::SetContext(const char* thePath)
{
+ SALOMEDS::Locker lock;
+
if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory();
TCollection_AsciiString aPath(CORBA::string_dup(thePath)), aContext("");
bool isInvalid = false;
//============================================================================
char* SALOMEDS_Study_i::GetContext()
{
+ SALOMEDS::Locker lock;
+
if(_current.IsNull())
throw SALOMEDS::Study::StudyInvalidContext();
*/
//============================================================================
SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetObjectNames(const char* theContext) {
+ SALOMEDS::Locker lock;
+
TColStd_SequenceOfExtendedString aResultSeq;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
TDF_Label aLabel;
*/
//============================================================================
SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetDirectoryNames(const char* theContext) {
+ SALOMEDS::Locker lock;
+
TColStd_SequenceOfExtendedString aResultSeq;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
TDF_Label aLabel;
*/
//============================================================================
SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetFileNames(const char* theContext) {
+ SALOMEDS::Locker lock;
+
TColStd_SequenceOfExtendedString aResultSeq;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
TDF_Label aLabel;
*/
//============================================================================
SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theContext) {
+ SALOMEDS::Locker lock;
+
TColStd_SequenceOfExtendedString aResultSeq;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
TDF_ChildIterator anIter(_doc->Main(), Standard_False); // iterate all subchildren at first level
SALOMEDS::ChildIterator_ptr
SALOMEDS_Study_i::NewChildIterator(SALOMEDS::SObject_ptr theSObject)
{
+ SALOMEDS::Locker lock;
+
SALOMEDS_ChildIterator_i* aServant =
new SALOMEDS_ChildIterator_i(GetChildIterator(theSObject));
SALOMEDS::SComponentIterator_ptr
SALOMEDS_Study_i::NewComponentIterator()
{
+ SALOMEDS::Locker lock;
+
SALOMEDS_SComponentIterator_i* aServant =
new SALOMEDS_SComponentIterator_i(GetComponentIterator());
//============================================================================
SALOMEDS::UseCaseBuilder_ptr SALOMEDS_Study_i::GetUseCaseBuilder()
{
+ SALOMEDS::Locker lock;
+
return _UseCaseBuilder->_this();
}
SALOMEDS::StudyBuilder_ptr SALOMEDS_Study_i::NewBuilder()
{
+ SALOMEDS::Locker lock;
+
return GetBuilder()->_this();
}
//============================================================================
char* SALOMEDS_Study_i::Name()
{
+ SALOMEDS::Locker lock;
+
return CORBA::string_dup(_name);
}
//============================================================================
void SALOMEDS_Study_i::Name(const char* name)
{
+ SALOMEDS::Locker lock;
+
_name = new char[strlen(name) +1];
strcpy(_name,name);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsSaved()
{
+ SALOMEDS::Locker lock;
+
return _isSaved;
}
//============================================================================
void SALOMEDS_Study_i::IsSaved(CORBA::Boolean save)
{
+ SALOMEDS::Locker lock;
+
_isSaved = save;
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsModified()
{
+ SALOMEDS::Locker lock;
+
// True if is modified and not saved
if (_doc->IsModified())
if (!_isSaved) return true;
//============================================================================
char* SALOMEDS_Study_i::URL()
{
+ SALOMEDS::Locker lock;
+
if(!_URL) {
_URL = new char[1];
_URL[0] = (char)0;
//============================================================================
void SALOMEDS_Study_i::URL(const char* url)
{
+ SALOMEDS::Locker lock;
+
if (_URL) delete [] _URL;
_URL = new char[strlen(url) +1];
strcpy(_URL,url);
CORBA::Short SALOMEDS_Study_i::StudyId()
{
+ SALOMEDS::Locker lock;
+
return _StudyId;
}
void SALOMEDS_Study_i::StudyId(CORBA::Short id)
{
+ SALOMEDS::Locker lock;
+
_StudyId = id;
}
void SALOMEDS_Study_i::UpdateIORLabelMap(const char* anIOR,const char* anEntry) {
+ SALOMEDS::Locker lock;
+
TDF_Label aLabel;
CORBA::String_var anEn = CORBA::string_dup(anEntry);
CORBA::String_var IOR = CORBA::string_dup(anIOR);
}
SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindDependances(SALOMEDS::SObject_ptr anObject) {
+ SALOMEDS::Locker lock;
+
SALOMEDS::GenericAttribute_ptr aTarget;
if (anObject->FindAttribute(aTarget,"AttributeTarget")) {
return SALOMEDS::AttributeTarget::_narrow(aTarget)->Get();
SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties(){
+ SALOMEDS::Locker lock;
+
SALOMEDS::SObject_var aSObject = FindObjectID("0:1");
SALOMEDS::GenericAttribute_var anAttr =
}
char* SALOMEDS_Study_i::GetLastModificationDate() {
+ SALOMEDS::Locker lock;
+
SALOMEDS::AttributeStudyProperties_var aProp = GetProperties();
SALOMEDS::StringSeq_var aNames;
SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears;
}
SALOMEDS::ListOfDates* SALOMEDS_Study_i::GetModificationsDate() {
+ SALOMEDS::Locker lock;
+
SALOMEDS::AttributeStudyProperties_var aProp = GetProperties();
SALOMEDS::StringSeq_var aNames;
SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears;
//============================================================================
void SALOMEDS_Study_i::Close()
{
+ SALOMEDS::Locker lock;
+
SALOMEDS_SComponentIterator_i itcomponent(this,_doc);
const CORBA::ORB_var& anORB = GetORB();
if (!CORBA::is_nil(obj)) {
SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ;
- if (!anEngine->_is_nil())
+ if (!anEngine->_is_nil()){
+ SALOMEDS::unlock();
anEngine->Close(sco);
+ SALOMEDS::lock();
+ }
}
}
}
*/
//============================================================================
void SALOMEDS_Study_i::AddPostponed(const char* theIOR) {
+ SALOMEDS::Locker lock;
+
if (!GetBuilder()->HasOpenCommand()) return;
try {
CORBA::Object_var obj = GetORB()->string_to_object(theIOR);
}
void SALOMEDS_Study_i::AddCreatedPostponed(const char* theIOR) {
+ SALOMEDS::Locker lock;
+
if (!GetBuilder()->HasOpenCommand()) return;
try {
CORBA::Object_var obj = GetORB()->string_to_object(theIOR);
*/
//============================================================================
void SALOMEDS_Study_i::RemovePostponed(const CORBA::Long theUndoLimit) {
+ SALOMEDS::Locker lock;
+
int anIndex;
int anOld;
*/
//============================================================================
void SALOMEDS_Study_i::UndoPostponed(const CORBA::Long theWay) {
+ SALOMEDS::Locker lock;
+
myNbUndos += theWay;
// remove current postponed
if (myNbPostponed.Last() > 0)
void QAD_Application::onActiveStudyChanged( QAD_Study* oldActiveStudy,
QAD_Study* newActiveStudy )
{
- getDesktop()->onActiveStudyChanged();
+ // san -- Check added: see comment by P.Rascle to PAL8065 about poor performance
+ if ( oldActiveStudy != newActiveStudy )
+ getDesktop()->onActiveStudyChanged();
if ( oldActiveStudy )
QAD_ASSERT( disconnect( oldActiveStudy, SIGNAL(docOperationTerminated( bool )),
Utils_SINGLETON.hxx \
Utils_DESTRUCTEUR_GENERIQUE.hxx \
Utils_ExceptHandlers.hxx \
- Utils_SignalsHandler.h
+ Utils_SignalsHandler.h \
+ Utils_Mutex.hxx
EXPORT_PYSCRIPTS = Utils_Identity.py SALOME_utilities.py
# Libraries targets
Utils_Identity.cxx Utils_ORB_INIT.cxx \
Utils_DESTRUCTEUR_GENERIQUE.cxx \
Utils_ExceptHandlers.cxx \
- Utils_SignalsHandler.cxx
+ Utils_SignalsHandler.cxx \
+ Utils_Mutex.cxx
LIB_SERVER_IDL = SALOME_Exception.idl
--- /dev/null
+// SALOME Utils : general SALOME's definitions and tools
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File: Utils_Mutex.cxx
+// Author: Sergey ANIKIN
+// Module : SALOME
+// $Header$
+
+
+#include <Utils_Mutex.hxx>
+
+Utils_Mutex::Utils_Mutex()
+: myCount( 0 )
+{
+ pthread_mutex_init( &myMutex, 0 );
+ pthread_mutex_init( &myHelperMutex, 0 );
+}
+
+Utils_Mutex::~Utils_Mutex()
+{
+ pthread_mutex_destroy( &myHelperMutex );
+ pthread_mutex_destroy( &myMutex );
+}
+
+void Utils_Mutex::lock()
+{
+ pthread_mutex_lock( &myHelperMutex );
+
+ if ( myCount > 0 && myThread == pthread_self() ) {
+ myCount++;
+ }
+ else {
+ pthread_mutex_unlock( &myHelperMutex );
+ pthread_mutex_lock( &myMutex );
+ pthread_mutex_lock( &myHelperMutex );
+ myCount = 1;
+ myThread = pthread_self();
+ }
+
+ pthread_mutex_unlock( &myHelperMutex );
+}
+
+void Utils_Mutex::unlock()
+{
+ pthread_mutex_lock( &myHelperMutex );
+
+ if ( myThread == pthread_self() ) {
+ if ( myCount && (--myCount) < 1 ) {
+ myCount = 0;
+ pthread_mutex_unlock( &myMutex );
+ }
+ }
+
+ pthread_mutex_unlock( &myHelperMutex );
+}
+
+Utils_Locker::Utils_Locker( Utils_Mutex* mutex )
+: myMutex( mutex )
+{
+ if ( myMutex ) myMutex->lock();
+}
+
+Utils_Locker::~Utils_Locker()
+{
+ if ( myMutex ) myMutex->unlock();
+}
--- /dev/null
+// SALOME Utils : general SALOME's definitions and tools
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+// File: Utils_Mutex.hxx
+// Author: Sergey ANIKIN
+// Module : SALOME
+// $Header$
+
+
+#ifndef Utils_Mutex_HeaderFile
+#define Utils_Mutex_HeaderFile
+
+#include <pthread.h>
+
+class Utils_Mutex
+{
+public:
+ Utils_Mutex();
+ ~Utils_Mutex();
+
+ void lock();
+ void unlock();
+
+private:
+ pthread_mutex_t myMutex;
+ pthread_mutex_t myHelperMutex;
+ pthread_t myThread;
+ int myCount;
+};
+
+class Utils_Locker
+{
+public:
+ Utils_Locker( Utils_Mutex* );
+ virtual ~Utils_Locker();
+
+private:
+ Utils_Mutex* myMutex;
+};
+
+#endif