--- /dev/null
+# Copyright (C) 2003 CEA/DEN, EDF R&D
+#
+#
+#
+# File : Makefile.in
+# Author : Alexey Petrov
+# Module : VISU
+# $Header:
+
+top_srcdir=@top_srcdir@
+top_builddir=../..
+srcdir=@srcdir@
+VPATH=.:@srcdir@:@top_srcdir@/idl
+
+
+@COMMENCE@
+
+# Libraries targets
+LIB = libSalomeGenericObj.la
+LIB_SRC = SALOME_GenericObj_i.cc
+
+LIB_SERVER_IDL = SALOME_GenericObj.idl
+LIB_CLIENT_IDL =
+
+# Executables targets
+BIN =
+BIN_SRC =
+
+BIN_CLIENT_IDL =
+BIN_SERVER_IDL =
+
+EXPORT_HEADERS = SALOME_GenericObj_i.hh
+
+# additionnal information to compil and link file
+CPPFLAGS +=
+
+LDFLAGS +=
+
+LIBS +=
+
+# additional file to be cleaned
+MOSTLYCLEAN +=
+CLEAN +=
+DISTCLEAN +=
+
+@CONCLUDE@
\ No newline at end of file
--- /dev/null
+// SALOME_GenericObj_i_CC
+//
+// 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 : SALOME_GenericObj_i.cc
+// Author : Alexey PETROV
+// Module : SALOME
+
+#include "SALOME_GenericObj_i.hh"
+#include "utilities.h"
+
+using namespace SALOME;
+
+GenericObj_i::GenericObj_i(PortableServer::POA_ptr thePOA): myRefCounter(1){
+ INFOS("GenericObj_i::GenericObj_i() - this = "<<this<<
+ "; CORBA::is_nil(thePOA) = "<<CORBA::is_nil(thePOA));
+ if(CORBA::is_nil(thePOA))
+ myPOA = PortableServer::RefCountServantBase::_default_POA();
+ else
+ myPOA = PortableServer::POA::_duplicate(thePOA);
+}
+
+
+PortableServer::POA_ptr GenericObj_i::_default_POA(){
+ //return PortableServer::RefCountServantBase::_default_POA();
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
+
+void GenericObj_i::Register(){
+ INFOS("GenericObj_i::Register "<<this<<"; myRefCounter = "<<myRefCounter)
+ ++myRefCounter;
+}
+
+
+void GenericObj_i::Destroy(){
+ INFOS("GenericObj_i::Destroy "<<this<<"; myRefCounter = "<<myRefCounter)
+ if(--myRefCounter <= 0){
+ PortableServer::ObjectId_var anObjectId = myPOA->servant_to_id(this);
+ myPOA->deactivate_object(anObjectId.in());
+ _remove_ref();
+ }
+}
--- /dev/null
+// SALOME_GenericObj_i_HH
+//
+// 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 : SALOME_GenericObj_i.hh
+// Author : Alexey PETROV
+// Module : SALOME
+
+#ifndef SALOME_GenericObj_i_HH
+#define SALOME_GenericObj_i_HH
+
+// IDL headers
+#include "SALOMEconfig.h"
+#include CORBA_SERVER_HEADER(SALOME_GenericObj)
+
+namespace SALOME{
+ class GenericObj_i :
+ public virtual POA_SALOME::GenericObj,
+ public virtual PortableServer::RefCountServantBase
+ {
+ protected:
+ PortableServer::POA_var myPOA;
+ int myRefCounter;
+ public:
+ // In the constructor you can provide default POA for the servant
+ GenericObj_i(PortableServer::POA_ptr thePOA = PortableServer::POA::_nil());
+ // The function is used implicetly in "_this" function
+ virtual PortableServer::POA_ptr _default_POA();
+ public: // Follow functions is IDL defined
+ /*! Increase the reference count (mark as used by another object).*/
+ virtual void Register();
+ /*! Decrease the reference count (release by another object).*/
+ virtual void Destroy();
+ };
+};
+
+#endif
+
@COMMENCE@
SUBDIRS = MSG2QM SALOMELocalTrace Logger SALOMELogger Utils PatchQt \
- NamingService Registry \
+ GenericObj NamingService Registry \
ModuleCatalog DataTypeCatalog RessourcesCatalog \
Notification NOTIFICATION_SWIG \
Container TestContainer LifeCycleCORBA HDFPersist \
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF
+LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF -lSalomeGenericObj -lSalomeLifeCycleCORBA
@CONCLUDE@
+++ /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 : utilities.h
-// Author : Antoine YESSAYAN, Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-
-/* --- Definition macros file to print informations if _DEBUG_ is defined --- */
-
-#ifndef UTILITIES_H
-#define UTILITIES_H
-
-#include <string>
-#include <iostream>
-#include "SALOME_Log.hxx"
-
-/* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
-
-#define INFOS(msg) {SLog.putMessage(SLog<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<endl);}
-#define PYSCRIPT(msg) {SLog.putMessage(SLog<<"---PYSCRIPT--- "<<msg<<endl);}
-
-/* --- To print date and time of compilation of current source --- */
-
-#if defined ( __GNUC__ )
-#define COMPILER "g++"
-#elif defined ( __sun )
-#define COMPILER "CC"
-#elif defined ( __KCC )
-#define COMPILER "KCC"
-#elif defined ( __PGI )
-#define COMPILER "pgCC"
-#else
-#define COMPILER "undefined"
-#endif
-
-#ifdef INFOS_COMPILATION
-#error INFOS_COMPILATION already defined
-#endif
-
-#define INFOS_COMPILATION { \
- SLog.putMessage(\
- SLog<<__FILE__<<" ["<< __LINE__<<"] : "\
- << "COMPILED with " << COMPILER \
- << ", " << __DATE__ \
- << " at " << __TIME__ <<endl); }
-
-#ifdef _DEBUG_
-
-/* --- the following MACROS are useful at debug time --- */
-
-#define MYTRACE SLog << "- Trace " << __FILE__ << " [" << __LINE__ << "] : "
-
-#define MESSAGE(msg) {SLog.putMessage( MYTRACE <<msg<<endl<<ends); }
-#define SCRUTE(var) {SLog.putMessage( MYTRACE << #var << "=" << var <<endl<<ends); }
-
-#define REPERE SLog << " --------------" << endl
-#define BEGIN_OF(msg) {REPERE;MYTRACE<<"Begin of: " <<msg<<endl;REPERE;}
-#define END_OF(msg) {REPERE;MYTRACE<<"Normal end of: "<<msg<<endl;REPERE;}
-
-#define HERE {cout<<flush ;cerr<<"- Trace "<<__FILE__<<" ["<<__LINE__<<"] : "<<flush ;}
-
-#define INTERRUPTION(code) {HERE;cerr<<"INTERRUPTION return code= "<<code<< endl;exit(code);}
-
-#ifndef ASSERT
-#define ASSERT(condition) \
- if (!(condition)){HERE;cerr<<"CONDITION "<<#condition<<" NOT VERIFIED"<<endl;INTERRUPTION(1);}
-#endif /* ASSERT */
-
-
-#else /* ifdef _DEBUG_*/
-
-#define HERE
-#define SCRUTE(var) {}
-#define MESSAGE(msg) {}
-#define REPERE
-#define BEGIN_OF(msg) {}
-#define END_OF(msg) {}
-
-#define INTERRUPTION(code) {}
-
-#ifndef ASSERT
-#define ASSERT(condition) {}
-#endif /* ASSERT */
-
-
-#endif /* ifdef _DEBUG_*/
-
-#endif /* ifndef UTILITIES_H */