for module in liste_modules:
module_root_dir=modules_root_dir[module]
add_ld_library_path(os.path.join(module_root_dir,"lib","salome"))
+
+if with_logger:
+ locdir=os.environ['PWD']
+ libtracedir=os.path.join(locdir,"libSalomeTrace")
+ libtrace = os.path.join(kernel_root_dir,"lib","salome","libSALOMELoggerClient.so.0.0.0")
+ libtraceln = os.path.join(libtracedir,"libSALOMELocalTrace.so")
+ aCommand = 'rm -rf ' + libtracedir + "; "
+ aCommand += 'mkdir ' + libtracedir + "; "
+ aCommand += 'ln -s ' + libtrace + " " + libtraceln + "; "
+ aCommand += 'ln -s ' + libtrace + " " + libtraceln + ".0; "
+ aCommand += 'ln -s ' + libtrace + " " + libtraceln + ".0.0.0; "
+ os.system(aCommand)
+ add_ld_library_path(libtracedir)
+
#print "LD_LIBRARY_PATH=",os.environ["LD_LIBRARY_PATH"]
#
import SALOME
session=clt.waitNS("/Kernel/Session",SALOME.Session)
+
+ theComputer = os.getenv("HOSTNAME")
+ computerSplitName = theComputer.split('.')
+ theComputer = computerSplitName[0]
+
#
# Lancement Container C++ local
#
# Attente de la disponibilité du Container C++ local dans le Naming Service
#
- theComputer = os.getenv("HOSTNAME")
- computerSplitName = theComputer.split('.')
- theComputer = computerSplitName[0]
-
clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
#
void SetValue(in string value);
};
+ //==========================================================================
+/*! \brief External File definition
+
+ This attribute stores a path to an External File.
+*/
+ //==========================================================================
+ interface AttributeExternalFileDef: GenericAttribute
+ {
+/*!
+ Returns the value of this attribute
+<BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
+*/
+ string Value();
+/*!
+ Sets the value of this attribute
+<BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
+*/
+ void SetValue(in string value);
+ };
+
+ //==========================================================================
+/*! \brief File Type definition
+
+ This attribute stores an external File Type (see ExternalFileDef attribute).
+*/
+ //==========================================================================
+ interface AttributeFileType: GenericAttribute
+ {
+/*!
+ Returns the value of this attribute
+<BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
+*/
+ string Value();
+/*!
+ Sets the value of this attribute
+<BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
+*/
+ void SetValue(in string value);
+ };
+
//==========================================================================
//Below the list of presentation attributes for display study tree in browser
//==========================================================================
CPPFLAGS+= $(PYTHON_INCLUDES)
-LDFLAGS+= -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSalomeLoggerServer
+LDFLAGS+= -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSALOMELocalTrace
LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
// Module : SALOME
// $Header$
-using namespace std;
-using namespace std;
#include <stdio.h>
-# include "Utils_ORB_INIT.hxx"
-# include "Utils_SINGLETON.hxx"
+#include "Utils_ORB_INIT.hxx"
+#include "Utils_SINGLETON.hxx"
#include "SALOME_NamingService.hxx"
#include "SALOME_Container_i.hxx"
#include <iostream>
#include <string>
#include "utilities.h"
+using namespace std;
-//#define CHECKTIME
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
#include <Python.h>
-static PyMethodDef MethodPyVoidMethod[] = {
- { NULL, NULL }
-};
+static PyMethodDef MethodPyVoidMethod[] =
+ {
+ { NULL, NULL }
+ };
int main(int argc, char* argv[])
{
INFOS_COMPILATION;
BEGIN_OF(argv[0])
- Py_Initialize() ;
+ Py_Initialize() ;
PySys_SetArgv( argc , argv ) ;
Py_InitModule( "InitPyRunMethod" , MethodPyVoidMethod ) ;
- try {
+ try
+ {
- // Initialise the ORB.
-// CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
+ // Initialise the ORB.
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
+ CORBA::ORB_var &orb = init( argc , argv ) ;
- // Obtain a reference to the root POA.
- // obtain the root poa manager
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var root_poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- int CONTAINER=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
-
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var pman;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- root_poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(root_poa))
- pman = root_poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- }
- catch( CORBA::COMM_FAILURE& )
+ // Obtain a reference to the root POA.
+ // obtain the root poa manager
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var root_poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int CONTAINER=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var pman;
+ for (int i = 1; i<=NumberOfTries; i++)
{
- MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ root_poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(root_poa))
+ pman = root_poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
}
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Container: Naming Service was found" )
- if(EnvL==1){
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Container: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Container: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Container: Logger Server was found" )
- log->ping();
- CONTAINER=1;
- break;
- }
- }}
- }
- if ((CONTAINER==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Container: Naming Service was found" );
+ if(EnvL==1)
+ {
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Container: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Container: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Container: Logger Server was found" );
+ CONTAINER=1;
+ break;
+ }
+ }
+ }
+ }
+ if ((CONTAINER==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
break;
- }
+ }
- //
- // define policy objects
- PortableServer::ImplicitActivationPolicy_var implicitActivation =
- root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION) ;
+ // define policy objects
+ PortableServer::ImplicitActivationPolicy_var implicitActivation =
+ root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION) ;
- // default = NO_IMPLICIT_ACTIVATION
- PortableServer::ThreadPolicy_var threadPolicy =
- root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL) ;
- // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
+ // default = NO_IMPLICIT_ACTIVATION
+ PortableServer::ThreadPolicy_var threadPolicy =
+ root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL) ;
+ // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
- // create policy list
- CORBA::PolicyList policyList;
- policyList.length(2);
- policyList[0] = PortableServer::ImplicitActivationPolicy::_duplicate(implicitActivation) ;
- policyList[1] = PortableServer::ThreadPolicy::_duplicate(threadPolicy) ;
-
- // create the child POA
- PortableServer::POAManager_var nil_mgr = PortableServer::POAManager::_nil() ;
- PortableServer::POA_var factory_poa =
- root_poa->create_POA("factory_poa", pman, policyList) ;
+ // create policy list
+ CORBA::PolicyList policyList;
+ policyList.length(2);
+ policyList[0] = PortableServer::ImplicitActivationPolicy::_duplicate(implicitActivation) ;
+ policyList[1] = PortableServer::ThreadPolicy::_duplicate(threadPolicy) ;
+
+ // create the child POA
+ PortableServer::POAManager_var nil_mgr = PortableServer::POAManager::_nil() ;
+ PortableServer::POA_var factory_poa =
+ root_poa->create_POA("factory_poa", pman, policyList) ;
//with nil_mgr instead of pman, a new POA manager is created with the new POA
- // destroy policy objects
- implicitActivation->destroy() ;
- threadPolicy->destroy() ;
+ // destroy policy objects
+ implicitActivation->destroy() ;
+ threadPolicy->destroy() ;
- char *containerName = "";
- if (argc >1)
- {
- containerName = argv[1] ;
- }
+ char *containerName = "";
+ if (argc >1)
+ {
+ containerName = argv[1] ;
+ }
- Engines_Container_i * myContainer
- = new Engines_Container_i(orb, factory_poa, containerName , argc , argv );
+ Engines_Container_i * myContainer
+ = new Engines_Container_i(orb, factory_poa, containerName , argc , argv );
-// Engines_Container_i * myContainer
-// = new Engines_Container_i(string(argv[1]),string(argv[2]), orb, factory_poa);
+ // Engines_Container_i * myContainer
+ // = new Engines_Container_i(string(argv[1]),string(argv[2]), orb, factory_poa);
- // use naming service
-// myContainer->_NS.init_orb(orb);
-// Engines::Container_ptr pCont = Engines::Container::_narrow(myContainer->_this());
-// myContainer->_NS.Register(pCont, argv[2]);
+ // use naming service
+ // myContainer->_NS.init_orb(orb);
+ // Engines::Container_ptr pCont = Engines::Container::_narrow(myContainer->_this());
+ // myContainer->_NS.Register(pCont, argv[2]);
- pman->activate();
+ pman->activate();
#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
+ Utils_Timer timer;
+ timer.Start();
+ timer.Stop();
+ MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
+ timer.ShowAbsolute();
#endif
- orb->run();
+ orb->run();
- orb->destroy();
- }
+ orb->destroy();
+ }
catch(CORBA::SystemException&)
- {
- INFOS("Caught CORBA::SystemException.")
- }
+ {
+ INFOS("Caught CORBA::SystemException.")
+ }
catch(PortableServer::POA::WrongPolicy&)
- {
- INFOS("Caught CORBA::WrongPolicyException.")
- }
+ {
+ INFOS("Caught CORBA::WrongPolicyException.")
+ }
catch(PortableServer::POA::ServantAlreadyActive&)
- {
- INFOS("Caught CORBA::ServantAlreadyActiveException")
- }
+ {
+ INFOS("Caught CORBA::ServantAlreadyActiveException")
+ }
catch(CORBA::Exception&)
- {
- INFOS("Caught CORBA::Exception.")
- }
+ {
+ INFOS("Caught CORBA::Exception.")
+ }
catch(...)
- {
- INFOS("Caught unknown exception.")
- }
+ {
+ INFOS("Caught unknown exception.")
+ }
END_OF(argv[0]);
}
CPPFLAGS+= $(QT_MT_INCLUDES)
CXXFLAGS+=
-LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
// Module : SALOME
// $Header$
-using namespace std;
#include <iostream.h>
#include "SALOME_NamingService.hxx"
#include "SALOME_DataTypeCatalog_impl.hxx"
#include "utilities.h"
-# include "Utils_SINGLETON.hxx"
+#include "Utils_SINGLETON.hxx"
+using namespace std;
+
int main(int argc,char **argv)
{
- try {
- CosNaming::NamingContext_var _rootContext, catalogContext;
- // initialize the ORB
- CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
- // initialize POA
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- int DATA_TYPE_CATALOG=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var mgr;
+ try
+ {
+ CosNaming::NamingContext_var _rootContext, catalogContext;
+ // initialize the ORB
+ CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
+ // initialize POA
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ int DATA_TYPE_CATALOG=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var mgr;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- mgr = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);}
- catch( CORBA::COMM_FAILURE& )
- {
- MESSAGE( "Data Type Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
- }
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Data Type Catalog: Naming Service was found" )
- if(EnvL==1){
- CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
- NS.init_orb( orb1 ) ;
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);}
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Data Type Catalog: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Data Type Catalog: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Data Type Catalog: Logger Server was found" )
- log->ping();
- DATA_TYPE_CATALOG=1;
- break;
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);}
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Data Type Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
}
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Data Type Catalog: Naming Service was found" );
+ if(EnvL==1)
+ {
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Data Type Catalog: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Data Type Catalog: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Data Type Catalog: Logger Server was found" );
+ DATA_TYPE_CATALOG=1;
+ break;
+ }
- }}
- }
- if ((DATA_TYPE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
+ }
+ }
}
+ if ((DATA_TYPE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
- //
- // Active catalog
+ // Active catalog
- SALOME_DataTypeCatalogImpl* Catalogue_i = new SALOME_DataTypeCatalogImpl(argc, argv);
- poa->activate_object (Catalogue_i);
+ SALOME_DataTypeCatalogImpl* Catalogue_i = new SALOME_DataTypeCatalogImpl(argc, argv);
+ poa->activate_object (Catalogue_i);
- mgr->activate();
+ mgr->activate();
- CORBA::Object_ptr myCata = Catalogue_i->_this();
+ CORBA::Object_ptr myCata = Catalogue_i->_this();
- // initialise Naming Service
- SALOME_NamingService *_NS;
- _NS = new SALOME_NamingService(orb);
- // register Catalog in Naming Service
- _NS->Register(myCata ,"/Kernel/DataTypeCatalog");
+ // initialise Naming Service
+ SALOME_NamingService *_NS;
+ _NS = new SALOME_NamingService(orb);
+ // register Catalog in Naming Service
+ _NS->Register(myCata ,"/Kernel/DataTypeCatalog");
- MESSAGE("Running DataType Catalog Server.")
+ MESSAGE("Running DataType Catalog Server.")
- orb->run();
+ orb->run();
- poa->destroy(1,1);
+ poa->destroy(1,1);
- }
- catch(CORBA::SystemException&) {
+ }
+ catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.")
- }
- catch(CORBA::Exception&) {
+ }
+ catch(CORBA::Exception&) {
INFOS("Caught CORBA::Exception.")
- }
+ }
return 0;
}
BIN_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl \
SALOME_ModuleCatalog.idl
-LDFLAGS += -lSalomeNS -lOpUtil -lSalomeLoggerServer
+LDFLAGS += -lSalomeNS -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
CPPFLAGS+=$(QT_MT_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSalomeLoggerServer
+LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Session)
+#include CORBA_CLIENT_HEADER(Logger)
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
@COMMENCE@
-SUBDIRS = MSG2QM Logger Utils PatchQt NamingService Registry ModuleCatalog DataTypeCatalog \
- RessourcesCatalog Notification NOTIFICATION_SWIG Container TestContainer LifeCycleCORBA \
- HDFPersist VTKFilter OBJECT TOOLSDS SALOMEDS SALOMEGUI Plot2d VTKViewer OCCViewer SUPERVGraph \
- Session SALOME_SWIG TOOLSGUI SALOME_PY RegistryDisplay ModuleGenerator SALOME_PYQT Loader
+SUBDIRS = MSG2QM SALOMELocalTrace Logger SALOMELogger Utils PatchQt \
+ NamingService Registry \
+ ModuleCatalog DataTypeCatalog RessourcesCatalog \
+ Notification NOTIFICATION_SWIG \
+ Container TestContainer LifeCycleCORBA HDFPersist \
+ VTKFilter OBJECT \
+ TOOLSDS SALOMEDS \
+ SALOMEGUI Plot2d VTKViewer OCCViewer \
+ SUPERVGraph \
+ Session SALOME_SWIG TOOLSGUI SALOME_PY \
+ RegistryDisplay ModuleGenerator SALOME_PYQT Loader
ifeq (@WITHMPICH@,yes)
SUBDIRS+= MPIContainer
CPPFLAGS+= $(QT_MT_INCLUDES)
CXXFLAGS+= -ftemplate-depth-42
-LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
// File : SALOME_ModuleCatalog_Server.cxx
// Module : SALOME
-using namespace std;
/* $Header$ */
+
#include <iostream.h>
#include "SALOME_NamingService.hxx"
#include "SALOME_ModuleCatalog_impl.hxx"
#include "utilities.h"
-# include "Utils_SINGLETON.hxx"
+#include "Utils_SINGLETON.hxx"
-//#define CHECKTIME
-#ifdef CHECKTIME
-#include <Utils_Timer.hxx>
-#endif
-
-//#define CHECKTIME
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
+using namespace std;
int main(int argc,char **argv)
{
- try {
- CosNaming::NamingContext_var _rootContext, catalogContext;
+ try
+ {
+ CosNaming::NamingContext_var _rootContext, catalogContext;
- // initialize the ORB
+ // initialize the ORB
- CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
+ CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
- // initialize POA
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- int MODULE_CATALOG=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var mgr;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- mgr = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- }
- catch( CORBA::COMM_FAILURE& )
- {
- MESSAGE( "Module Catalog Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
- }
- if (!CORBA::is_nil(theObj)){
- inc = CosNaming::NamingContext::_narrow(theObj);
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Module Catalog Server: Naming Service was found" )
- if(EnvL==1){
- CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
- NS.init_orb( orb1 ) ;
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);}
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Module Catalog Server: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Module Catalog Server: Logger Server was found" )
- log->ping();
- MODULE_CATALOG=1;
- break;
- }
- }}
- }}
- if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
- }
+ // initialize POA
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ int MODULE_CATALOG=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var mgr;
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Module Catalog Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
+ }
+ if (!CORBA::is_nil(theObj))
+ {
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Module Catalog Server: Naming Service was found" );
+ if(EnvL==1)
+ {
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);}
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Module Catalog Server: Unknown exception" ) ;
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Module Catalog Server: Logger Server was found" );
+ MODULE_CATALOG=1;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
- //
- // Active catalog
+ // Active catalog
- SALOME_ModuleCatalogImpl* Catalogue_i = new SALOME_ModuleCatalogImpl(argc, argv);
- poa->activate_object (Catalogue_i);
+ SALOME_ModuleCatalogImpl* Catalogue_i = new SALOME_ModuleCatalogImpl(argc, argv);
+ poa->activate_object (Catalogue_i);
- mgr->activate();
+ mgr->activate();
- CORBA::Object_ptr myCata = Catalogue_i->_this();
+ CORBA::Object_ptr myCata = Catalogue_i->_this();
- // initialise Naming Service
- SALOME_NamingService *_NS;
- _NS = new SALOME_NamingService(orb);
- // register Catalog in Naming Service
- _NS->Register(myCata ,"/Kernel/ModulCatalog");
+ // initialise Naming Service
+ SALOME_NamingService *_NS;
+ _NS = new SALOME_NamingService(orb);
+ // register Catalog in Naming Service
+ _NS->Register(myCata ,"/Kernel/ModulCatalog");
- MESSAGE("Running CatalogServer.");
+ MESSAGE("Running CatalogServer.");
#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
+ Utils_Timer timer;
+ timer.Start();
+ timer.Stop();
+ MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
+ timer.ShowAbsolute();
#endif
- orb->run();
+ orb->run();
- poa->destroy(1,1);
+ poa->destroy(1,1);
- }
- catch(CORBA::SystemException&) {
+ }
+ catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.")
- }
- catch(CORBA::Exception&) {
+ }
+ catch(CORBA::Exception&) {
INFOS("Caught CORBA::Exception.")
- }
+ }
return 0;
}
NOTIFICATION_Supplier.cxx \
NOTIFICATION_Consumer.cxx
-LDFLAGS+= -lOpUtil
+LDFLAGS+= -lOpUtil -lSALOMELocalTrace
OMNIORB_IDLCXXFLAGS+= -Wbtp
@CONCLUDE@
BIN_SRC = RegistryService.cxx
BIN_SERVER_IDL = SALOME_Registry.idl
-LDFLAGS+= -lSalomeNS -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= -lSalomeNS -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
// Module : SALOME
// $Header$
-using namespace std;
-# include <stdlib.h>
-# include <iostream.h>
-# include <fstream.h>
+#include <stdlib.h>
+#include <iostream.h>
+#include <fstream.h>
extern "C"
{
# include <stdio.h>
}
-# include "utilities.h"
-# include "Utils_ORB_INIT.hxx"
-# include "Utils_SINGLETON.hxx"
-# include "Utils_SALOME_Exception.hxx"
-# include "Utils_CommException.hxx"
-# include "ServiceUnreachable.hxx"
-# include "SALOME_NamingService.hxx"
-# include "RegistryService.hxx"
+#include "utilities.h"
+#include "Utils_ORB_INIT.hxx"
+#include "Utils_SINGLETON.hxx"
+#include "Utils_SALOME_Exception.hxx"
+#include "Utils_CommException.hxx"
+#include "ServiceUnreachable.hxx"
+#include "SALOME_NamingService.hxx"
+#include "RegistryService.hxx"
-//#define CHECKTIME
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
+using namespace std;
int main( int argc , char **argv )
{
- BEGIN_OF( argv[0] )
- INFOS_COMPILATION
- SCRUTE(argc)
- if( argc<3 )
+ BEGIN_OF( argv[0] )
+ INFOS_COMPILATION
+ SCRUTE(argc)
+ if( argc<3 )
+ {
+ MESSAGE("you must provide the Salome session name when you call SALOME_Registry_Server") ;
+ throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server") ;
+ }
+ const char *ptrSessionName=0 ;
+
+ int k=0 ;
+ for ( k=1 ; k<argc ; k++ )
+ {
+ if( strcmp(argv[k],"--salome_session")==0 )
{
- MESSAGE("you must provide the Salome session name when you call SALOME_Registry_Server") ;
- throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server") ;
+ ptrSessionName=argv[k+1] ;
+ break ;
}
- const char *ptrSessionName=0 ;
-
- int k=0 ;
- for ( k=1 ; k<argc ; k++ )
+ }
+ ASSERT(ptrSessionName) ;
+ ASSERT(strlen( ptrSessionName )>0) ;
+ const char *registryName = "Registry" ;
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ CORBA::ORB_var &orb = init( argc , argv ) ;
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ Registry::Components_var varComponents;
+ int REGISTRY=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var manager;
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ manager = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
{
- if( strcmp(argv[k],"--salome_session")==0 )
- {
- ptrSessionName=argv[k+1] ;
- break ;
- }
+ MESSAGE( "Registry Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
}
- ASSERT(ptrSessionName) ;
- ASSERT(strlen( ptrSessionName )>0) ;
- const char *registryName = "Registry" ;
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- Registry::Components_var varComponents;
- int REGISTRY=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var manager;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- manager = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- }
- catch( CORBA::COMM_FAILURE& )
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Registry Server: Naming Service was found" );
+ if(EnvL==1)
{
- MESSAGE( "Registry Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
- }
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Registry Server: Naming Service was found" )
- if(EnvL==1){
- for(int j=1; j<=NumberOfTries; j++){
+ for(int j=1; j<=NumberOfTries; j++)
+ {
if (j!=1)
a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Registry Server: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Registry Server: Unknown exception" ) }
-
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Registry Server: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Registry Server: Unknown exception" );
+ }
if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Registry Server: Logger Server was found" )
- log->ping();
- REGISTRY=1;
- break;
- }
- }}
- }
- if ((REGISTRY==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
- }
- //
- try
- {
- naming.init_orb( orb ) ;
- RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance() ;
- ptrRegistry->SessionName( ptrSessionName ) ;
- varComponents = ptrRegistry->_this() ;
- // The RegistryService must not already exist.
+ {
+ MESSAGE( "Module Catalog Server: Logger Server was found" );
+ REGISTRY=1;
+ break;
+ }
+ }
+ }
+ }
+ if ((REGISTRY==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+
+ try
+ {
+ naming.init_orb( orb ) ;
+ RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance() ;
+ ptrRegistry->SessionName( ptrSessionName ) ;
+ varComponents = ptrRegistry->_this() ;
+ // The RegistryService must not already exist.
- try
- {
- CORBA::Object_var pipo = naming.Resolve( registryName ) ;
- if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ;
- MESSAGE("RegistryService servant already existing" ) ;
- exit( EXIT_FAILURE ) ;
- }
- catch( const ServiceUnreachable &ex )
- {
- }
- catch( const CORBA::Exception &exx )
- {
- }
- string absoluteName = string("/") + registryName;
- naming.Register( varComponents , absoluteName.c_str() ) ;
- MESSAGE("On attend les requetes des clients") ;
- try
- {
- // Activation du POA
- MESSAGE("Activation du POA") ;
- manager->activate() ;
+ try
+ {
+ CORBA::Object_var pipo = naming.Resolve( registryName ) ;
+ if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ;
+ MESSAGE("RegistryService servant already existing" ) ;
+ exit( EXIT_FAILURE ) ;
+ }
+ catch( const ServiceUnreachable &ex )
+ {
+ }
+ catch( const CORBA::Exception &exx )
+ {
+ }
+ string absoluteName = string("/") + registryName;
+ naming.Register( varComponents , absoluteName.c_str() ) ;
+ MESSAGE("On attend les requetes des clients") ;
+ try
+ {
+ // Activation du POA
+ MESSAGE("Activation du POA") ;
+ manager->activate() ;
- // Lancement de l'ORB
- MESSAGE("Lancement de l'ORB") ;
+ // Lancement de l'ORB
+ MESSAGE("Lancement de l'ORB") ;
#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
+ Utils_Timer timer;
+ timer.Start();
+ timer.Stop();
+ MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
+ timer.ShowAbsolute();
#endif
- orb->run() ;
- }
- catch( const CORBA::Exception &ex )
- {
- MESSAGE("Erreur systeme") ;
- return EXIT_FAILURE ;
- }
+ orb->run() ;
+ }
+ catch( const CORBA::Exception &ex )
+ {
+ MESSAGE("Erreur systeme") ;
+ return EXIT_FAILURE ;
+ }
- }
- catch( const SALOME_Exception &ex )
- {
- MESSAGE( "Communication Error : " << ex.what() )
- return EXIT_FAILURE ;
- }
+ }
+ catch( const SALOME_Exception &ex )
+ {
+ MESSAGE( "Communication Error : " << ex.what() )
+ return EXIT_FAILURE ;
+ }
- END_OF( argv[0] ) ;
- return 0 ;
+ END_OF( argv[0] ) ;
+ return 0 ;
}
CPPFLAGS+= $(QT_MT_INCLUDES)
CXXFLAGS+=
-LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
// Module : SALOME
// $Header$
-using namespace std;
#include <iostream.h>
#include "SALOME_NamingService.hxx"
#include "SALOME_RessourcesCatalog_impl.hxx"
#include "utilities.h"
-# include "Utils_SINGLETON.hxx"
+#include "Utils_SINGLETON.hxx"
+using namespace std;
+
int main(int argc,char **argv)
{
- try {
- CosNaming::NamingContext_var _rootContext, catalogContext;
+ try
+ {
+ CosNaming::NamingContext_var _rootContext, catalogContext;
- // initialize the ORB
+ // initialize the ORB
- CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
+ CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
- // initialize POA
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- int RESSOURCES_CATALOG=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var mgr;
- for (int i = 1; i<=NumberOfTries; i++){
+ // initialize POA
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int RESSOURCES_CATALOG=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var mgr;
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
if (i!=1)
a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- mgr = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
}
catch( CORBA::COMM_FAILURE& )
{
- MESSAGE( "Ressources Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ MESSAGE( "Ressources Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
+ }
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Ressources Catalog: Naming Service was found" );
+ if(EnvL==1)
+ {
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Ressources Catalog: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Ressources Catalog: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Ressources Catalog: Loger Server was found" );
+ RESSOURCES_CATALOG=1;
+ break;
+ }
+ }
}
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Ressources Catalog: Naming Service was found" )
- if(EnvL==1){
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Ressources Catalog: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Ressources Catalog: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Ressources Catalog: Loger Server was found" )
- log->ping();
- RESSOURCES_CATALOG=1;
- break;
- }
- }}
- }
+ }
if ((RESSOURCES_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
break;
- }
- //
- // Active catalog
+ }
+
+ // Active catalog
- SALOME_RessourcesCatalogImpl* Catalogue_i = new SALOME_RessourcesCatalogImpl(argc, argv);
- poa->activate_object (Catalogue_i);
- mgr->activate();
- CORBA::Object_ptr myCata = Catalogue_i->_this();
+ SALOME_RessourcesCatalogImpl* Catalogue_i = new SALOME_RessourcesCatalogImpl(argc, argv);
+ poa->activate_object (Catalogue_i);
+ mgr->activate();
+ CORBA::Object_ptr myCata = Catalogue_i->_this();
- // initialise Naming Service
- SALOME_NamingService *_NS;
- _NS = new SALOME_NamingService(orb);
- // register Catalog in Naming Service
- _NS->Register(myCata ,"/Kernel/RessourcesCatalog");
+ // initialise Naming Service
+ SALOME_NamingService *_NS;
+ _NS = new SALOME_NamingService(orb);
+ // register Catalog in Naming Service
+ _NS->Register(myCata ,"/Kernel/RessourcesCatalog");
- MESSAGE("Running Ressources Catalog Server.")
+ MESSAGE("Running Ressources Catalog Server.")
- orb->run();
+ orb->run();
- poa->destroy(1,1);
+ poa->destroy(1,1);
- }
- catch(CORBA::SystemException&) {
+ }
+ catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.")
- }
- catch(CORBA::Exception&) {
+ }
+ catch(CORBA::Exception&) {
INFOS("Caught CORBA::Exception.")
- }
+ }
return 0;
}
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+// Copyright (C) 1991,1995 by
+//
+// MATRA DATAVISION, FRANCE
+//
+// This software is furnished in accordance with the terms and conditions
+// of the contract and with the inclusion of the above copyright notice.
+// This software or any other copy thereof may not be provided or otherwise
+// be made available to any other person. No title to an ownership of the
+// software is hereby transferred.
+//
+// At the termination of the contract, the software and all copies of this
+// software must be deleted.
+
+#ifndef _Handle_SALOMEDS_ExternalFileDef_HeaderFile
+#define _Handle_SALOMEDS_ExternalFileDef_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TDataStd_Comment_HeaderFile
+#include <Handle_TDataStd_Comment.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TDataStd_Comment);
+class SALOMEDS_ExternalFileDef;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOMEDS_ExternalFileDef);
+
+class Handle(SALOMEDS_ExternalFileDef) : public Handle(TDataStd_Comment) {
+ public:
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ Handle(SALOMEDS_ExternalFileDef)():Handle(TDataStd_Comment)() {}
+ Handle(SALOMEDS_ExternalFileDef)(const Handle(SALOMEDS_ExternalFileDef)& aHandle) : Handle(TDataStd_Comment)(aHandle)
+ {
+ }
+
+ Handle(SALOMEDS_ExternalFileDef)(const SALOMEDS_ExternalFileDef* anItem) : Handle(TDataStd_Comment)((TDataStd_Comment *)anItem)
+ {
+ }
+
+ Handle(SALOMEDS_ExternalFileDef)& operator=(const Handle(SALOMEDS_ExternalFileDef)& aHandle)
+ {
+ Assign(aHandle.Access());
+ return *this;
+ }
+
+ Handle(SALOMEDS_ExternalFileDef)& operator=(const SALOMEDS_ExternalFileDef* anItem)
+ {
+ Assign((Standard_Transient *)anItem);
+ return *this;
+ }
+
+ SALOMEDS_ExternalFileDef* operator->()
+ {
+ return (SALOMEDS_ExternalFileDef *)ControlAccess();
+ }
+
+ SALOMEDS_ExternalFileDef* operator->() const
+ {
+ return (SALOMEDS_ExternalFileDef *)ControlAccess();
+ }
+
+ Standard_EXPORT ~Handle(SALOMEDS_ExternalFileDef)();
+
+ Standard_EXPORT static const Handle(SALOMEDS_ExternalFileDef) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+// Copyright (C) 1991,1995 by
+//
+// MATRA DATAVISION, FRANCE
+//
+// This software is furnished in accordance with the terms and conditions
+// of the contract and with the inclusion of the above copyright notice.
+// This software or any other copy thereof may not be provided or otherwise
+// be made available to any other person. No title to an ownership of the
+// software is hereby transferred.
+//
+// At the termination of the contract, the software and all copies of this
+// software must be deleted.
+
+#ifndef _Handle_SALOMEDS_FileType_HeaderFile
+#define _Handle_SALOMEDS_FileType_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TDataStd_Comment_HeaderFile
+#include <Handle_TDataStd_Comment.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TDataStd_Comment);
+class SALOMEDS_FileType;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOMEDS_FileType);
+
+class Handle(SALOMEDS_FileType) : public Handle(TDataStd_Comment) {
+ public:
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ Handle(SALOMEDS_FileType)():Handle(TDataStd_Comment)() {}
+ Handle(SALOMEDS_FileType)(const Handle(SALOMEDS_FileType)& aHandle) : Handle(TDataStd_Comment)(aHandle)
+ {
+ }
+
+ Handle(SALOMEDS_FileType)(const SALOMEDS_FileType* anItem) : Handle(TDataStd_Comment)((TDataStd_Comment *)anItem)
+ {
+ }
+
+ Handle(SALOMEDS_FileType)& operator=(const Handle(SALOMEDS_FileType)& aHandle)
+ {
+ Assign(aHandle.Access());
+ return *this;
+ }
+
+ Handle(SALOMEDS_FileType)& operator=(const SALOMEDS_FileType* anItem)
+ {
+ Assign((Standard_Transient *)anItem);
+ return *this;
+ }
+
+ SALOMEDS_FileType* operator->()
+ {
+ return (SALOMEDS_FileType *)ControlAccess();
+ }
+
+ SALOMEDS_FileType* operator->() const
+ {
+ return (SALOMEDS_FileType *)ControlAccess();
+ }
+
+ Standard_EXPORT ~Handle(SALOMEDS_FileType)();
+
+ Standard_EXPORT static const Handle(SALOMEDS_FileType) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
SALOMEDS_OCAFApplication.cxx \
SALOMEDS_GenericAttribute_i.cxx \
SALOMEDS_IORAttribute.cxx \
+ SALOMEDS_ExternalFileDef.cxx \
+ SALOMEDS_FileType.cxx \
SALOMEDS_PersRefAttribute.cxx \
SALOMEDS_AttributeComment_i.cxx \
+ SALOMEDS_AttributeExternalFileDef_i.cxx \
+ SALOMEDS_AttributeFileType_i.cxx \
SALOMEDS_AttributeIOR_i.cxx \
SALOMEDS_AttributeInteger_i.cxx \
SALOMEDS_AttributeName_i.cxx \
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSalomeLoggerServer $(CAS_LDPATH) -lTKCAF
+LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF
@CONCLUDE@
--- /dev/null
+
+$Header$
+
+How to add a new attribute (without WOK):
+-----------------------------------------
+
+This works only for simple types (ex: string)
+
+example: add attribute FileType (string)
+
+# new files (copied from files specific to ExternalFileDef attribute = string):
+
+? src/SALOMEDS/Handle_SALOMEDS_FileType.hxx <--- Handle_SALOMEDS_ExternalFileDef.hxx
+? src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx <--- SALOMEDS_AttributeExternalFileDef_i.cxx
+? src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx <--- SALOMEDS_AttributeExternalFileDef_i.hxx
+? src/SALOMEDS/SALOMEDS_FileType.cdl <--- SALOMEDS_ExternalFileDef.cdl
+? src/SALOMEDS/SALOMEDS_FileType.cxx <--- SALOMEDS_ExternalFileDef.cxx
+? src/SALOMEDS/SALOMEDS_FileType.hxx <--- SALOMEDS_ExternalFileDef.hxx
+? src/SALOMEDS/SALOMEDS_FileType.ixx <--- SALOMEDS_ExternalFileDef.ixx
+? src/SALOMEDS/SALOMEDS_FileType.jxx <--- SALOMEDS_ExternalFileDef.jxx
+
+# files modified:
+
+M idl/SALOMEDS_Attributes.idl
+M src/SALOMEDS/Makefile.in
+M src/SALOMEDS/SALOMEDS_SObject_i.cxx
+M src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx
+
+# detailled modifications:
+
+- in new files,
+change ExternalFileDef in FileType everywhere
+- in SALOMEDS_FileType.cxx,
+Standard_GUID (Global Universal IDentifier) must be changed.
+To obtain a new GUID, it is possible to use guidgen.exe on windows (with visual C++).
+
+- in src/SALOMEDS/Makefile.in,
+add under LIB_SRC = \
+ SALOMEDS_FileType.cxx \
+ SALOMEDS_AttributeExternalFileDef_i.cxx \
+
+- in src/SALOMEDS/SALOMEDS_SObject_i.cxx,
+- in src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx,
+- in idl/SALOMEDS_Attributes.idl,
+find portions of code containing ExternalFileDef, duplicate and replace
+
--- /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_AttributeExternalFileDef_i.cxx
+// Author : Yves FRICAUD
+// Module : SALOME
+// $Header$
+
+using namespace std;
+#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
+
+#include <TCollection_ExtendedString.hxx>
+#include "SALOMEDS_SObject_i.hxx"
+
+char* SALOMEDS_AttributeExternalFileDef_i::Value()
+{
+ 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)
+{
+ CheckLocked();
+ CORBA::String_var Str = CORBA::string_dup(value);
+ // Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
+ Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
+}
--- /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_AttributeExternalFileDef_i.hxx
+// Author : Yves FRICAUD
+// Module : SALOME
+// $Header$
+
+#ifndef SALOMEDS_AttributeExternalFileDef_i_HeaderFile
+#define SALOMEDS_AttributeExternalFileDef_i_HeaderFile
+
+// IDL headers
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+#include "SALOMEDS_GenericAttribute_i.hxx"
+#include "SALOMEDS_ExternalFileDef.hxx"
+
+class SALOMEDS_AttributeExternalFileDef_i: public virtual POA_SALOMEDS::AttributeExternalFileDef,
+ public virtual SALOMEDS_GenericAttribute_i {
+public:
+
+ SALOMEDS_AttributeExternalFileDef_i(const Handle(SALOMEDS_ExternalFileDef)& theCommentAttr, CORBA::ORB_ptr orb)
+ {
+ _myOrb = CORBA::ORB::_duplicate(orb);
+ _myAttr = theCommentAttr;
+ }
+ ~SALOMEDS_AttributeExternalFileDef_i() {};
+
+ char* Value();
+ void SetValue(const char* value);
+
+};
+
+
+
+#endif
--- /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_AttributeFileType_i.cxx
+// Author : Yves FRICAUD
+// Module : SALOME
+// $Header$
+
+using namespace std;
+#include "SALOMEDS_AttributeFileType_i.hxx"
+
+#include <TCollection_ExtendedString.hxx>
+#include "SALOMEDS_SObject_i.hxx"
+
+char* SALOMEDS_AttributeFileType_i::Value()
+{
+ 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)
+{
+ CheckLocked();
+ CORBA::String_var Str = CORBA::string_dup(value);
+ // Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
+ Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
+}
--- /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_AttributeFileType_i.hxx
+// Author : Yves FRICAUD
+// Module : SALOME
+// $Header$
+
+#ifndef SALOMEDS_AttributeFileType_i_HeaderFile
+#define SALOMEDS_AttributeFileType_i_HeaderFile
+
+// IDL headers
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+#include "SALOMEDS_GenericAttribute_i.hxx"
+#include "SALOMEDS_FileType.hxx"
+
+class SALOMEDS_AttributeFileType_i: public virtual POA_SALOMEDS::AttributeFileType,
+ public virtual SALOMEDS_GenericAttribute_i {
+public:
+
+ SALOMEDS_AttributeFileType_i(const Handle(SALOMEDS_FileType)& theCommentAttr, CORBA::ORB_ptr orb)
+ {
+ _myOrb = CORBA::ORB::_duplicate(orb);
+ _myAttr = theCommentAttr;
+ }
+ ~SALOMEDS_AttributeFileType_i() {};
+
+ char* Value();
+ void SetValue(const char* value);
+
+};
+
+
+
+#endif
--- /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_ExternalFileDef.cdl
+-- Author : Yves FRICAUD
+-- Module : SALOME
+
+class ExternalFileDef from SALOMEDS inherits Comment from TDataStd
+
+ ---Purpose:
+
+
+uses Attribute from TDF,
+ Label from TDF,
+ GUID from Standard,
+ ExtendedString from TCollection,
+ DataSet from TDF,
+ RelocationTable from TDF,
+ AttributeSequence from TDF,
+ Data from TDF,
+ Comment from TDataStd
+
+
+is
+
+
+ ---Purpose: class methods
+ -- =============
+
+ GetID (myclass)
+ ---C++: return const &
+ returns GUID from Standard;
+
+ Set (myclass; label : Label from TDF;
+ Name : ExtendedString from TCollection)
+ returns ExternalFileDef from SALOMEDS;
+
+ ---Purpose: Comment methods
+ -- ============
+
+ Create
+ returns mutable ExternalFileDef from SALOMEDS;
+
+ ID (me)
+ ---C++: return const &
+ returns GUID from Standard;
+
+ Restore (me: mutable; with : Attribute from TDF);
+
+ NewEmpty (me)
+ returns mutable Attribute from TDF;
+
+ Paste (me; into : mutable Attribute from TDF;
+ RT : mutable RelocationTable from TDF);
+
+end ExternalFileDef;
--- /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_ExternalFileDef.cxx
+// Author : Yves FRICAUD
+// Module : SALOME
+// $Header:
+
+#include "SALOMEDS_ExternalFileDef.ixx"
+#include <TDataStd_Comment.hxx>
+#include <TCollection_ExtendedString.hxx>
+using namespace std;
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+
+const Standard_GUID& SALOMEDS_ExternalFileDef::GetID ()
+{
+ static Standard_GUID SALOMEDS_ExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
+ return SALOMEDS_ExternalFileDefID;
+}
+
+
+
+//=======================================================================
+//function : Set
+//purpose :
+//=======================================================================
+
+Handle(SALOMEDS_ExternalFileDef) SALOMEDS_ExternalFileDef::Set (const TDF_Label& L,
+ const TCollection_ExtendedString& S)
+{
+
+ Handle(SALOMEDS_ExternalFileDef) A;
+ if (!L.FindAttribute(SALOMEDS_ExternalFileDef::GetID(),A)) {
+ A = new SALOMEDS_ExternalFileDef();
+ L.AddAttribute(A);
+ }
+
+ (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
+ return A;
+}
+
+
+//=======================================================================
+//function : constructor
+//purpose :
+//=======================================================================
+SALOMEDS_ExternalFileDef::SALOMEDS_ExternalFileDef()
+{}
+
+//=======================================================================
+//function : ID
+//purpose :
+//=======================================================================
+
+const Standard_GUID& SALOMEDS_ExternalFileDef::ID () const { return GetID(); }
+
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+
+Handle(TDF_Attribute) SALOMEDS_ExternalFileDef::NewEmpty () const
+{
+ return new SALOMEDS_ExternalFileDef();
+}
+
+//=======================================================================
+//function : Restore
+//purpose :
+//=======================================================================
+
+void SALOMEDS_ExternalFileDef::Restore(const Handle(TDF_Attribute)& with)
+{
+ TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get ();
+ TDataStd_Comment::Set(s);
+ return;
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+
+void SALOMEDS_ExternalFileDef::Paste (const Handle(TDF_Attribute)& into,
+ const Handle(TDF_RelocationTable)& RT) const
+{
+ Handle(TDataStd_Comment)::DownCast (into)->Set (Get());
+}
+
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+// Copyright (C) 1991,1995 by
+//
+// MATRA DATAVISION, FRANCE
+//
+// This software is furnished in accordance with the terms and conditions
+// of the contract and with the inclusion of the above copyright notice.
+// This software or any other copy thereof may not be provided or otherwise
+// be made available to any other person. No title to an ownership of the
+// software is hereby transferred.
+//
+// At the termination of the contract, the software and all copies of this
+// software must be deleted.
+//
+#ifndef _SALOMEDS_ExternalFileDef_HeaderFile
+#define _SALOMEDS_ExternalFileDef_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_SALOMEDS_ExternalFileDef_HeaderFile
+#include <Handle_SALOMEDS_ExternalFileDef.hxx>
+#endif
+
+#ifndef _TDataStd_Comment_HeaderFile
+#include <TDataStd_Comment.hxx>
+#endif
+#ifndef _Handle_TDF_Attribute_HeaderFile
+#include <Handle_TDF_Attribute.hxx>
+#endif
+#ifndef _Handle_TDF_RelocationTable_HeaderFile
+#include <Handle_TDF_RelocationTable.hxx>
+#endif
+class Standard_GUID;
+class TDF_Label;
+class TCollection_ExtendedString;
+class TDF_Attribute;
+class TDF_RelocationTable;
+
+
+class SALOMEDS_ExternalFileDef : public TDataStd_Comment {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+Standard_EXPORT static const Standard_GUID& GetID() ;
+Standard_EXPORT static Handle_SALOMEDS_ExternalFileDef Set(const TDF_Label& label,const TCollection_ExtendedString& Name) ;
+Standard_EXPORT SALOMEDS_ExternalFileDef();
+Standard_EXPORT const Standard_GUID& ID() const;
+Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ;
+Standard_EXPORT Handle_TDF_Attribute NewEmpty() const;
+Standard_EXPORT void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
+Standard_EXPORT ~SALOMEDS_ExternalFileDef();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_ExternalFileDef_Type_();
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// File generated by CPPExt (Transient)
+// Copyright (C) 1991,1995 by
+//
+// MATRA DATAVISION, FRANCE
+//
+// This software is furnished in accordance with the terms and conditions
+// of the contract and with the inclusion of the above copyright notice.
+// This software or any other copy thereof may not be provided or otherwise
+// be made available to any other person. No title to an ownership of the
+// software is hereby transferred.
+//
+// At the termination of the contract, the software and all copies of this
+// software must be deleted.
+//
+#include <SALOMEDS_ExternalFileDef.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+SALOMEDS_ExternalFileDef::~SALOMEDS_ExternalFileDef() {}
+
+
+
+Standard_EXPORT Handle_Standard_Type& SALOMEDS_ExternalFileDef_Type_()
+{
+
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_Comment);
+ if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_Comment);
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute);
+ if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute);
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
+ if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared);
+ static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
+ if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient);
+
+
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
+ static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_ExternalFileDef",
+ sizeof(SALOMEDS_ExternalFileDef),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
+
+ return _aType;
+}
+
+
+// DownCast method
+// allow safe downcasting
+//
+const Handle(SALOMEDS_ExternalFileDef) Handle(SALOMEDS_ExternalFileDef)::DownCast(const Handle(Standard_Transient)& AnObject)
+{
+ Handle(SALOMEDS_ExternalFileDef) _anOtherObject;
+
+ if (!AnObject.IsNull()) {
+ if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_ExternalFileDef))) {
+ _anOtherObject = Handle(SALOMEDS_ExternalFileDef)((Handle(SALOMEDS_ExternalFileDef)&)AnObject);
+ }
+ }
+
+ return _anOtherObject ;
+}
+const Handle(Standard_Type)& SALOMEDS_ExternalFileDef::DynamicType() const
+{
+ return STANDARD_TYPE(SALOMEDS_ExternalFileDef) ;
+}
+Standard_Boolean SALOMEDS_ExternalFileDef::IsKind(const Handle(Standard_Type)& AType) const
+{
+ return (STANDARD_TYPE(SALOMEDS_ExternalFileDef) == AType || TDataStd_Comment::IsKind(AType));
+}
+Handle_SALOMEDS_ExternalFileDef::~Handle_SALOMEDS_ExternalFileDef() {}
+
--- /dev/null
+#ifndef _Standard_GUID_HeaderFile
+#include <Standard_GUID.hxx>
+#endif
+#ifndef _TDF_Label_HeaderFile
+#include <TDF_Label.hxx>
+#endif
+#ifndef _TCollection_ExtendedString_HeaderFile
+#include <TCollection_ExtendedString.hxx>
+#endif
+#ifndef _TDF_Attribute_HeaderFile
+#include <TDF_Attribute.hxx>
+#endif
+#ifndef _TDF_RelocationTable_HeaderFile
+#include <TDF_RelocationTable.hxx>
+#endif
+#ifndef _SALOMEDS_ExternalFileDef_HeaderFile
+#include <SALOMEDS_ExternalFileDef.hxx>
+#endif
--- /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_FileType.cdl
+-- Author : Yves FRICAUD
+-- Module : SALOME
+
+class FileType from SALOMEDS inherits Comment from TDataStd
+
+ ---Purpose:
+
+
+uses Attribute from TDF,
+ Label from TDF,
+ GUID from Standard,
+ ExtendedString from TCollection,
+ DataSet from TDF,
+ RelocationTable from TDF,
+ AttributeSequence from TDF,
+ Data from TDF,
+ Comment from TDataStd
+
+
+is
+
+
+ ---Purpose: class methods
+ -- =============
+
+ GetID (myclass)
+ ---C++: return const &
+ returns GUID from Standard;
+
+ Set (myclass; label : Label from TDF;
+ Name : ExtendedString from TCollection)
+ returns FileType from SALOMEDS;
+
+ ---Purpose: Comment methods
+ -- ============
+
+ Create
+ returns mutable FileType from SALOMEDS;
+
+ ID (me)
+ ---C++: return const &
+ returns GUID from Standard;
+
+ Restore (me: mutable; with : Attribute from TDF);
+
+ NewEmpty (me)
+ returns mutable Attribute from TDF;
+
+ Paste (me; into : mutable Attribute from TDF;
+ RT : mutable RelocationTable from TDF);
+
+end FileType;
--- /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_FileType.cxx
+// Author : Yves FRICAUD
+// Module : SALOME
+// $Header:
+
+#include "SALOMEDS_FileType.ixx"
+#include <TDataStd_Comment.hxx>
+#include <TCollection_ExtendedString.hxx>
+using namespace std;
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+
+const Standard_GUID& SALOMEDS_FileType::GetID ()
+{
+ static Standard_GUID SALOMEDS_FileTypeID ("0181B525-3F15-4ab2-9DE3-5E2F54B5F340");
+ return SALOMEDS_FileTypeID;
+}
+
+
+
+//=======================================================================
+//function : Set
+//purpose :
+//=======================================================================
+
+Handle(SALOMEDS_FileType) SALOMEDS_FileType::Set (const TDF_Label& L,
+ const TCollection_ExtendedString& S)
+{
+
+ Handle(SALOMEDS_FileType) A;
+ if (!L.FindAttribute(SALOMEDS_FileType::GetID(),A)) {
+ A = new SALOMEDS_FileType();
+ L.AddAttribute(A);
+ }
+
+ (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
+ return A;
+}
+
+
+//=======================================================================
+//function : constructor
+//purpose :
+//=======================================================================
+SALOMEDS_FileType::SALOMEDS_FileType()
+{}
+
+//=======================================================================
+//function : ID
+//purpose :
+//=======================================================================
+
+const Standard_GUID& SALOMEDS_FileType::ID () const { return GetID(); }
+
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+
+Handle(TDF_Attribute) SALOMEDS_FileType::NewEmpty () const
+{
+ return new SALOMEDS_FileType();
+}
+
+//=======================================================================
+//function : Restore
+//purpose :
+//=======================================================================
+
+void SALOMEDS_FileType::Restore(const Handle(TDF_Attribute)& with)
+{
+ TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get ();
+ TDataStd_Comment::Set(s);
+ return;
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+
+void SALOMEDS_FileType::Paste (const Handle(TDF_Attribute)& into,
+ const Handle(TDF_RelocationTable)& RT) const
+{
+ Handle(TDataStd_Comment)::DownCast (into)->Set (Get());
+}
+
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+// Copyright (C) 1991,1995 by
+//
+// MATRA DATAVISION, FRANCE
+//
+// This software is furnished in accordance with the terms and conditions
+// of the contract and with the inclusion of the above copyright notice.
+// This software or any other copy thereof may not be provided or otherwise
+// be made available to any other person. No title to an ownership of the
+// software is hereby transferred.
+//
+// At the termination of the contract, the software and all copies of this
+// software must be deleted.
+//
+#ifndef _SALOMEDS_FileType_HeaderFile
+#define _SALOMEDS_FileType_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_SALOMEDS_FileType_HeaderFile
+#include <Handle_SALOMEDS_FileType.hxx>
+#endif
+
+#ifndef _TDataStd_Comment_HeaderFile
+#include <TDataStd_Comment.hxx>
+#endif
+#ifndef _Handle_TDF_Attribute_HeaderFile
+#include <Handle_TDF_Attribute.hxx>
+#endif
+#ifndef _Handle_TDF_RelocationTable_HeaderFile
+#include <Handle_TDF_RelocationTable.hxx>
+#endif
+class Standard_GUID;
+class TDF_Label;
+class TCollection_ExtendedString;
+class TDF_Attribute;
+class TDF_RelocationTable;
+
+
+class SALOMEDS_FileType : public TDataStd_Comment {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+Standard_EXPORT static const Standard_GUID& GetID() ;
+Standard_EXPORT static Handle_SALOMEDS_FileType Set(const TDF_Label& label,const TCollection_ExtendedString& Name) ;
+Standard_EXPORT SALOMEDS_FileType();
+Standard_EXPORT const Standard_GUID& ID() const;
+Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ;
+Standard_EXPORT Handle_TDF_Attribute NewEmpty() const;
+Standard_EXPORT void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
+Standard_EXPORT ~SALOMEDS_FileType();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_FileType_Type_();
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// File generated by CPPExt (Transient)
+// Copyright (C) 1991,1995 by
+//
+// MATRA DATAVISION, FRANCE
+//
+// This software is furnished in accordance with the terms and conditions
+// of the contract and with the inclusion of the above copyright notice.
+// This software or any other copy thereof may not be provided or otherwise
+// be made available to any other person. No title to an ownership of the
+// software is hereby transferred.
+//
+// At the termination of the contract, the software and all copies of this
+// software must be deleted.
+//
+#include <SALOMEDS_FileType.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+SALOMEDS_FileType::~SALOMEDS_FileType() {}
+
+
+
+Standard_EXPORT Handle_Standard_Type& SALOMEDS_FileType_Type_()
+{
+
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_Comment);
+ if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_Comment);
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute);
+ if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute);
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
+ if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared);
+ static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
+ if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient);
+
+
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
+ static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_FileType",
+ sizeof(SALOMEDS_FileType),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
+
+ return _aType;
+}
+
+
+// DownCast method
+// allow safe downcasting
+//
+const Handle(SALOMEDS_FileType) Handle(SALOMEDS_FileType)::DownCast(const Handle(Standard_Transient)& AnObject)
+{
+ Handle(SALOMEDS_FileType) _anOtherObject;
+
+ if (!AnObject.IsNull()) {
+ if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_FileType))) {
+ _anOtherObject = Handle(SALOMEDS_FileType)((Handle(SALOMEDS_FileType)&)AnObject);
+ }
+ }
+
+ return _anOtherObject ;
+}
+const Handle(Standard_Type)& SALOMEDS_FileType::DynamicType() const
+{
+ return STANDARD_TYPE(SALOMEDS_FileType) ;
+}
+Standard_Boolean SALOMEDS_FileType::IsKind(const Handle(Standard_Type)& AType) const
+{
+ return (STANDARD_TYPE(SALOMEDS_FileType) == AType || TDataStd_Comment::IsKind(AType));
+}
+Handle_SALOMEDS_FileType::~Handle_SALOMEDS_FileType() {}
+
--- /dev/null
+#ifndef _Standard_GUID_HeaderFile
+#include <Standard_GUID.hxx>
+#endif
+#ifndef _TDF_Label_HeaderFile
+#include <TDF_Label.hxx>
+#endif
+#ifndef _TCollection_ExtendedString_HeaderFile
+#include <TCollection_ExtendedString.hxx>
+#endif
+#ifndef _TDF_Attribute_HeaderFile
+#include <TDF_Attribute.hxx>
+#endif
+#ifndef _TDF_RelocationTable_HeaderFile
+#include <TDF_RelocationTable.hxx>
+#endif
+#ifndef _SALOMEDS_FileType_HeaderFile
+#include <SALOMEDS_FileType.hxx>
+#endif
#include "SALOMEDS_AttributePersistentRef_i.hxx"
#include "SALOMEDS_AttributeIOR_i.hxx"
#include "SALOMEDS_AttributeComment_i.hxx"
+#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
+#include "SALOMEDS_AttributeFileType_i.hxx"
#include "SALOMEDS_AttributeName_i.hxx"
#include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
#include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
else if (strcmp(aTypeOfAttribute, "AttributeSequenceOfInteger") == 0 ) return SALOMEDS_SequenceOfIntegerAttribute::GetID();
else if (strcmp(aTypeOfAttribute, "AttributeName") == 0 ) return TDataStd_Name::GetID();
else if (strcmp(aTypeOfAttribute, "AttributeComment") == 0 ) return TDataStd_Comment::GetID();
+ else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) return SALOMEDS_ExternalFileDef::GetID();
+ else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) return SALOMEDS_FileType::GetID();
else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) return SALOMEDS_IORAttribute::GetID();
else if (strcmp(aTypeOfAttribute, "AttributePersistentRef") == 0 ) return SALOMEDS_PersRefAttribute::GetID();
else if (strcmp(aTypeOfAttribute, "AttributeDrawable") == 0 ) return SALOMEDS_DrawableAttribute::GetID();
{
if (ID == TDataStd_Name::GetID()) return "AttributeName";
else if (ID == TDataStd_Comment::GetID()) return "AttributeComment";
+ else if (ID == SALOMEDS_ExternalFileDef::GetID()) return "AttributeExternalFileDef";
+ else if (ID == SALOMEDS_FileType::GetID()) return "AttributeFileType";
else if (ID == SALOMEDS_IORAttribute::GetID()) return "AttributeIOR";
else if (ID == SALOMEDS_PersRefAttribute::GetID()) return "AttributePersistentRef";
else if (ID == TDataStd_Real::GetID()) return "AttributeReal";
anAttribute = Attr->AttributeComment::_this();
return Standard_True;
}
+ else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) {
+ SALOMEDS_AttributeExternalFileDef_i* Attr = new SALOMEDS_AttributeExternalFileDef_i(Handle(SALOMEDS_ExternalFileDef)::DownCast(anAttr), _orb);
+ anAttribute = Attr->AttributeExternalFileDef::_this();
+ return Standard_True;
+ }
+ else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) {
+ SALOMEDS_AttributeFileType_i* Attr = new SALOMEDS_AttributeFileType_i(Handle(SALOMEDS_FileType)::DownCast(anAttr), _orb);
+ anAttribute = Attr->AttributeFileType::_this();
+ return Standard_True;
+ }
else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) {
SALOMEDS_AttributeIOR_i* Attr = new SALOMEDS_AttributeIOR_i(Handle(SALOMEDS_IORAttribute)::DownCast(anAttr), _orb);
anAttribute = Attr->AttributeIOR::_this();
SALOMEDS_AttributeComment_i* Attr= new SALOMEDS_AttributeComment_i(Handle(TDataStd_Comment)::DownCast(anAttr), _orb);
anAttribute = Attr->AttributeComment::_this();
}
+ else if (ReturnGUIDForAttribute("AttributeExternalFileDef") == anAttr->ID()) {
+ SALOMEDS_AttributeExternalFileDef_i* Attr= new SALOMEDS_AttributeExternalFileDef_i(Handle(SALOMEDS_ExternalFileDef)::DownCast(anAttr), _orb);
+ anAttribute = Attr->AttributeExternalFileDef::_this();
+ }
+ else if (ReturnGUIDForAttribute("AttributeFileType") == anAttr->ID()) {
+ SALOMEDS_AttributeFileType_i* Attr= new SALOMEDS_AttributeFileType_i(Handle(SALOMEDS_FileType)::DownCast(anAttr), _orb);
+ anAttribute = Attr->AttributeFileType::_this();
+ }
else if (ReturnGUIDForAttribute("AttributeIOR") == anAttr->ID()) {
SALOMEDS_AttributeIOR_i* Attr= new SALOMEDS_AttributeIOR_i(Handle(SALOMEDS_IORAttribute)::DownCast(anAttr), _orb);
anAttribute = Attr->AttributeIOR::_this();
// Module : SALOME
// $Header$
-using namespace std;
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
#include "SALOMEDS_StudyManager_i.hxx"
#include "utilities.h"
-# include "Utils_SINGLETON.hxx"
+#include "Utils_SINGLETON.hxx"
#include "SALOME_NamingService.hxx"
-//#define CHECKTIME
+
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
+using namespace std;
// extern "C"
// { // for ccmalloc memory debug
//////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv)
{
-// ccmalloc_static_initialization();
+ // ccmalloc_static_initialization();
MESSAGE("SALOMEDS_Server - main");
- try {
- // Initialise the ORB.
- CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
- omniORB::MaxMessageSize(100 * 1024 * 1024);
- // Obtain a reference to the root POA.
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- int SALOMEDS=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var pman;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- pman = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj)){
- inc = CosNaming::NamingContext::_narrow(theObj);
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "SalomeDS Server: Naming Service was found" )
- if(EnvL==1){
- CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
- NS.init_orb( orb1 ) ;
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);}
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "SalomeDS Server: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "SalomeDS Server: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "SalomeDS Server: Logger Server was found" )
- log->ping();
- SALOMEDS=1;
- break;
- }
- }}
- }}
-
- }
- catch( const SALOME_Exception &ex )
+ try
+ {
+ // Initialise the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
+ omniORB::MaxMessageSize(100 * 1024 * 1024);
+ // Obtain a reference to the root POA.
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ int SALOMEDS=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var pman;
+ for (int i = 1; i<=NumberOfTries; i++)
{
- MESSAGE( "Communication Error : " << ex.what() )
- return EXIT_FAILURE ;
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ pman = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj)){
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "SalomeDS Server: Naming Service was found" );
+ if(EnvL==1)
+ {
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); }
+
+ catch(...)
+ {
+ MESSAGE( "SalomeDS Server: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "SalomeDS Server: Logger Server was found" );
+ SALOMEDS=1;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }
+ catch( const SALOME_Exception &ex )
+ {
+ MESSAGE( "Communication Error : " << ex.what() );
+ return EXIT_FAILURE ;
+ }
+ if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
}
- if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
- }
- //
- // We allocate the objects on the heap. Since these are reference
- // counted objects, they will be deleted by the POA when they are no
- // longer needed.
- SALOMEDS_StudyManager_i * myStudyManager_i = new SALOMEDS_StudyManager_i(orb);
+ // We allocate the objects on the heap. Since these are reference
+ // counted objects, they will be deleted by the POA when they are no
+ // longer needed.
+ SALOMEDS_StudyManager_i * myStudyManager_i = new SALOMEDS_StudyManager_i(orb);
- // Activate the objects. This tells the POA that the objects are
- // ready to accept requests.
- PortableServer::ObjectId_var myStudyManager_iid = poa->activate_object(myStudyManager_i);
- myStudyManager_i->register_name("/myStudyManager");
+ // Activate the objects. This tells the POA that the objects are
+ // ready to accept requests.
+ PortableServer::ObjectId_var myStudyManager_iid = poa->activate_object(myStudyManager_i);
+ myStudyManager_i->register_name("/myStudyManager");
- // Obtain a POAManager, and tell the POA to start accepting
- // requests on its objects.
- pman = poa->the_POAManager();
- pman->activate();
+ // Obtain a POAManager, and tell the POA to start accepting
+ // requests on its objects.
+ pman = poa->the_POAManager();
+ pman->activate();
#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
+ Utils_Timer timer;
+ timer.Start();
+ timer.Stop();
+ MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
+ timer.ShowAbsolute();
#endif
- orb->run();
- orb->destroy();
- }
- catch(CORBA::SystemException&) {
- MESSAGE( "Caught CORBA::SystemException." )
- }
- catch(CORBA::Exception&) {
- MESSAGE( "Caught CORBA::Exception." )
- }
- catch(omniORB::fatalException& fe) {
- MESSAGE( "Caught omniORB::fatalException:" )
- MESSAGE( " file: " << fe.file() )
- MESSAGE( " line: " << fe.line() )
- MESSAGE( " mesg: " << fe.errmsg() )
- }
- catch(...) {
- MESSAGE( "Caught unknown exception." )
- }
+ orb->run();
+ orb->destroy();
+ }
+ catch(CORBA::SystemException&)
+ {
+ MESSAGE( "Caught CORBA::SystemException." );
+ }
+ catch(CORBA::Exception&)
+ {
+ MESSAGE( "Caught CORBA::Exception." );
+ }
+ catch(omniORB::fatalException& fe)
+ {
+ MESSAGE( "Caught omniORB::fatalException:" );
+ MESSAGE( " file: " << fe.file() );
+ MESSAGE( " line: " << fe.line() );
+ MESSAGE( " mesg: " << fe.errmsg() );
+ }
+ catch(...)
+ {
+ MESSAGE( "Caught unknown exception." );
+ }
return 0;
}
#include "SALOMEDS_AttributePersistentRef_i.hxx"
#include "SALOMEDS_AttributeIOR_i.hxx"
#include "SALOMEDS_AttributeComment_i.hxx"
+#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
+#include "SALOMEDS_AttributeFileType_i.hxx"
#include "SALOMEDS_AttributeName_i.hxx"
#include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
#include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
SALOMEDS::AttributeComment_var aCA = aCommentAttr->AttributeComment::_this();
return aCA._retn();
}
+ else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) {
+ Handle(SALOMEDS_ExternalFileDef) anAttr;
+ if (!Lab.FindAttribute(SALOMEDS_ExternalFileDef::GetID(), anAttr)) {
+ anAttr = new SALOMEDS_ExternalFileDef;
+ Lab.AddAttribute(anAttr);
+ }
+ SALOMEDS_AttributeExternalFileDef_i* anExternalFileDefAttr = new SALOMEDS_AttributeExternalFileDef_i(anAttr, _orb);
+ SALOMEDS::AttributeExternalFileDef_var aCA = anExternalFileDefAttr->AttributeExternalFileDef::_this();
+ return aCA._retn();
+ }
+ else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) {
+ Handle(SALOMEDS_FileType) anAttr;
+ if (!Lab.FindAttribute(SALOMEDS_FileType::GetID(), anAttr)) {
+ anAttr = new SALOMEDS_FileType;
+ Lab.AddAttribute(anAttr);
+ }
+ SALOMEDS_AttributeFileType_i* anFileTypeAttr = new SALOMEDS_AttributeFileType_i(anAttr, _orb);
+ SALOMEDS::AttributeFileType_var aCA = anFileTypeAttr->AttributeFileType::_this();
+ return aCA._retn();
+ }
else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) {
Handle(SALOMEDS_IORAttribute) anAttr;
if (!Lab.FindAttribute(SALOMEDS_IORAttribute::GetID(), anAttr)) {
anAttribute = Attr->AttributeComment::_this();
return Standard_True;
}
+ else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) {
+ SALOMEDS_AttributeExternalFileDef_i* Attr= new SALOMEDS_AttributeExternalFileDef_i(Handle(SALOMEDS_ExternalFileDef)::DownCast(anAttr), _orb);
+ anAttribute = Attr->AttributeExternalFileDef::_this();
+ return Standard_True;
+ }
+ else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) {
+ SALOMEDS_AttributeFileType_i* Attr= new SALOMEDS_AttributeFileType_i(Handle(SALOMEDS_FileType)::DownCast(anAttr), _orb);
+ anAttribute = Attr->AttributeFileType::_this();
+ return Standard_True;
+ }
else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) {
SALOMEDS_AttributeIOR_i* Attr= new SALOMEDS_AttributeIOR_i(Handle(SALOMEDS_IORAttribute)::DownCast(anAttr), _orb);
anAttribute = Attr->AttributeIOR::_this();
--- /dev/null
+# SALOMELocalTrace : log on local machine
+#
+# 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 : Makefile.in
+# Author : Paul RASCLE (EDF)
+# Module : SALOME
+# $Header$
+
+top_srcdir=@top_srcdir@
+top_builddir=../..
+srcdir=@srcdir@
+VPATH=.:@srcdir@:@top_srcdir@/idl
+
+
+@COMMENCE@
+
+# header files
+EXPORT_HEADERS= SALOME_Log.hxx
+
+EXPORT_PYSCRIPTS =
+
+# Libraries targets
+
+LIB = libSALOMELocalTrace.la
+LIB_SRC = SALOME_Log.cxx
+
+LDFLAGS+=
+
+@CONCLUDE@
--- /dev/null
+// SALOME_LocalTrace : log on local machine
+//
+// 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_Log.hxx
+// Author : Vasily Rusyaev, Paul RASCLE, EDF
+// Module : KERNEL
+// $Header$
+
+#include <string>
+#include <iostream>
+
+using namespace std;
+
+#include "SALOME_Log.hxx"
+
+SALOME_Log::SALOME_Log()
+{
+}
+
+SALOME_Log::~SALOME_Log()
+{
+}
+
+SALOME_Log& SALOME_Log::Instance()
+{
+ static SALOME_Log instance;
+ return instance;
+}
+
+void SALOME_Log::putMessage(std::ostream& msg)
+{
+ cout << std::flush;
+ cerr <<str() << std::flush;
+ rdbuf()->freeze(false);
+ seekp(0);
+}
+
--- /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 : SALOME_Log.hxx
+// Author : Vasily Rusyaev (OCN), Paul RASCLE (EDF)
+// Module : KERNEL
+// $Header$
+
+#ifndef _SALOME_LOG_HXX_
+#define _SALOME_LOG_HXX_
+
+//these declarations for files don't using OCC includes (for example HDF)
+# ifdef WNT
+
+# ifndef Standard_EXPORT
+# define Standard_EXPORT __declspec( dllexport )
+// For global variables :
+# define Standard_EXPORTEXTERN __declspec( dllexport ) extern
+# define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
+# endif /* Standard_EXPORT */
+
+# ifndef Standard_IMPORT
+# define Standard_IMPORT __declspec( dllimport ) extern
+# define Standard_IMPORTC extern "C" __declspec( dllimport )
+# endif /* Standard_IMPORT */
+
+# else /* WNT */
+
+# ifndef Standard_EXPORT
+# define Standard_EXPORT
+// For global variables :
+# define Standard_EXPORTEXTERN extern
+# define Standard_EXPORTEXTERNC extern "C"
+# endif /* Standard_EXPORT */
+
+# ifndef Standard_IMPORT
+# define Standard_IMPORT extern
+# define Standard_IMPORTC extern "C"
+# endif /* Standard_IMPORT */
+
+# endif /* WNT */
+
+
+using namespace std;
+
+#include <iostream>
+#include <strstream>
+
+
+class SALOME_Log : public ostrstream
+{
+public:
+ virtual ~SALOME_Log();
+ static Standard_EXPORT SALOME_Log& Instance();
+ Standard_EXPORT void putMessage(std::ostream& msg);
+
+protected:
+ //disable creation of instances: force use static SALOME_Log& Instance()
+ SALOME_Log();
+};
+
+
+#define SLog SALOME_Log::Instance()
+
+#endif
--- /dev/null
+# SALOMELogger : CORBA distributed log
+#
+# 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 : Makefile.in
+# Author : Paul RASCLE (EDF)
+# Module : SALOME
+# $Header$
+
+top_srcdir=@top_srcdir@
+top_builddir=../..
+srcdir=@srcdir@
+VPATH=.:@srcdir@:@top_srcdir@/idl
+
+
+@COMMENCE@
+
+# header files
+EXPORT_HEADERS=
+
+EXPORT_PYSCRIPTS =
+
+# Libraries targets
+
+LIB = libSALOMELoggerClient.la
+LIB_SRC = SALOME_LoggerClient.cxx
+LIB_CLIENT_IDL = Logger.idl
+
+LDFLAGS+=
+
+@CONCLUDE@
--- /dev/null
+// SALOME_LoggerClient : CORBA distributed log
+//
+// 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_Loggerclient.hxx
+// Author : Vasily Rusyaev, Paul RASCLE, EDF
+// Module : KERNEL
+// $Header$
+
+#include <string>
+#include <iostream>
+
+using namespace std;
+
+#include "SALOME_Log.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(Logger)
+
+// class SALOME_LoggerClient : public SALOME_Log
+// {
+// protected:
+// SALOME_Logger::Logger_var m_pInterfaceLogger; // object reference on Logger server
+// };
+
+SALOME_Logger::Logger_ptr m_pInterfaceLogger; // object reference on Logger server
+
+SALOME_Log::SALOME_Log()
+{
+ cout << "SALOME_LoggerClient: constructor" << endl;
+ //get reference on object reference from NS
+ //and initialize m_pInterfaceLogger
+
+ int argc = 1;
+ char* argv[1] = {"application"};
+ try
+ {
+ //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro
+ //Otherwise, you will get segmentation fault.
+
+ //Initialize the ORB
+ CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id = CORBA::string_dup("Logger");
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ cout<<"SALOME_LoggerClient: CORBA::COMM_FAILURE: Unable to contact the Naming Service"<<endl;
+ }
+ catch(...)
+ {
+ cout<<"SALOME_LoggerClient: Unknown exception dealing with Naming Service"<<endl;
+ }
+
+ if(!CORBA::is_nil(inc))
+ {
+ obj = inc->resolve(name);
+ m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj);
+ if (!CORBA::is_nil(m_pInterfaceLogger))
+ cout<<"SALOME_LoggerClient: Logger Server was found"<<endl;
+ break;
+ }
+ }
+ }
+ catch (const CosNaming::NamingContext::NotFound&)
+ {
+ // cout << "Caught exception: Naming Service can't found Logger";
+ }
+ catch (CORBA::COMM_FAILURE&)
+ {
+ // cout << "Caught CORBA::SystemException CommFailure.";
+ }
+ catch (CORBA::SystemException&)
+ {
+ // cout << "Caught CORBA::SystemException.";
+ }
+ catch (CORBA::Exception&)
+ {
+ // cout << "Caught CORBA::Exception.";
+ }
+ catch (...)
+ {
+ // cout << "Caught unknown exception.";
+ }
+ //cerr << "-----SALOME_Trace::SALOME_Trace----"<<endl;
+}
+
+SALOME_Log::~SALOME_Log()
+{
+}
+
+SALOME_Log& SALOME_Log::Instance()
+{
+ static SALOME_Log instance;
+ return instance;
+}
+
+void SALOME_Log::putMessage(std::ostream& msg)
+{
+ //write resulting string into Logger CORBA server
+
+ char* adt = str();
+ CORBA::String_var LogMsg = CORBA::string_dup(adt);
+ rdbuf()->freeze(false);
+ seekp(0);
+
+ if (CORBA::is_nil(m_pInterfaceLogger))
+ cout << LogMsg << std::flush;
+ else
+ m_pInterfaceLogger-> putMessage (LogMsg) ;
+ }
+
CPPFLAGS+=$(QT_MT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lOpUtil -lSalomeLoggerServer -lPlot2d -lSalomeVTKFilter
+LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lOpUtil -lPlot2d -lSalomeVTKFilter -lSALOMELocalTrace
@CONCLUDE@
// Module : SALOME
// $Header$
-# include "Utils_ORB_INIT.hxx"
-# include "Utils_SINGLETON.hxx"
-# include "SALOME_NamingService.hxx"
+#include "Utils_ORB_INIT.hxx"
+#include "Utils_SINGLETON.hxx"
+#include "SALOME_NamingService.hxx"
#include <iostream>
#include <unistd.h>
using namespace std;
try
{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
+ CORBA::ORB_var &orb = init( argc , argv ) ;
- //
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- int SESSION=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var pman;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int SESSION=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var pman;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
obj = orb->resolve_initial_references("RootPOA");
if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
+ poa = PortableServer::POA::_narrow(obj);
if(!CORBA::is_nil(poa))
- pman = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
+ pman = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
if (!CORBA::is_nil(theObj))
inc = CosNaming::NamingContext::_narrow(theObj);
- }
- catch( CORBA::COMM_FAILURE& )
- {
- MESSAGE( "Session Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
- }
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Session Server: Naming Service was found" )
- if(EnvL==1){
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Session Server: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Session Server: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Session Server: Loger Server was found" )
- log->ping();
- SESSION=1;
- break;
- }
- }}
}
- if ((SESSION==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Session Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
+ }
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Session Server: Naming Service was found" );
+ if(EnvL==1)
+ {
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ { MESSAGE( "Session Server: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Session Server: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Session Server: Loger Server was found" );
+ SESSION=1;
+ break;
+ }
+ }
}
- //
+ }
+ if ((SESSION==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
- // servant
- SALOME_Session_i * mySALOME_Session = new SALOME_Session_i(argc, argv, orb, poa) ;
- PortableServer::ObjectId_var mySALOME_Sessionid = poa->activate_object(mySALOME_Session) ;
- MESSAGE("poa->activate_object(mySALOME_Session)")
+ // servant
+ SALOME_Session_i * mySALOME_Session = new SALOME_Session_i(argc, argv, orb, poa) ;
+ PortableServer::ObjectId_var mySALOME_Sessionid = poa->activate_object(mySALOME_Session) ;
+ MESSAGE("poa->activate_object(mySALOME_Session)")
- obj = mySALOME_Session->_this() ;
- CORBA::String_var sior(orb->object_to_string(obj)) ;
+ obj = mySALOME_Session->_this() ;
+ CORBA::String_var sior(orb->object_to_string(obj)) ;
- mySALOME_Session->NSregister();
+ mySALOME_Session->NSregister();
- mySALOME_Session->_remove_ref() ;
+ mySALOME_Session->_remove_ref() ;
- //DECOMMENT PortableServer::POAManager_var pman = poa->the_POAManager() ;
- pman->activate() ;
- MESSAGE("pman->activate()")
+ //DECOMMENT PortableServer::POAManager_var pman = poa->the_POAManager() ;
+ pman->activate() ;
+ MESSAGE("pman->activate()")
- orb->run() ;
- orb->destroy() ;
+ orb->run() ;
+ orb->destroy() ;
}
- catch (CORBA::SystemException&)
+ catch (CORBA::SystemException&)
{
- INFOS("Caught CORBA::SystemException.")
+ INFOS("Caught CORBA::SystemException.");
}
- catch (CORBA::Exception&)
+ catch (CORBA::Exception&)
{
- INFOS("Caught CORBA::Exception.")
+ INFOS("Caught CORBA::Exception.");
}
- catch (...)
+ catch (...)
{
- INFOS("Caught unknown exception.")
+ INFOS("Caught unknown exception.");
}
return 0 ;
}
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+= -lOpUtil -lSalomeLoggerServer $(CAS_LDPATH) -lTKernel
+LDFLAGS+= -lOpUtil $(CAS_LDPATH) -lTKernel
@CONCLUDE@
BIN = TestContainer TestLogger
BIN_SRC =
-LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeContainer -lRegistry -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace
@CONCLUDE@
// Module : SALOME
// $Header$
-using namespace std;
#include "utilities.h"
#include <iostream>
#include <unistd.h>
#include "SALOME_NamingService.hxx"
#include "OpUtil.hxx"
-# include "Utils_ORB_INIT.hxx"
-# include "Utils_SINGLETON.hxx"
-# include "Utils_SALOME_Exception.hxx"
-# include "Utils_CommException.hxx"
+#include "Utils_ORB_INIT.hxx"
+#include "Utils_SINGLETON.hxx"
+#include "Utils_SALOME_Exception.hxx"
+#include "Utils_CommException.hxx"
+using namespace std;
+
int main (int argc, char * argv[])
{
// Obtain a reference to the root POA
//
- long TIMESleep = 250000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- SALOME_Logger::Logger_var log;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- int TEST_CONTAINER=0;
- const char * Env = getenv("USE_LOGGER");
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int TEST_CONTAINER=0;
+ const char * Env = getenv("USE_LOGGER");
int EnvL =0;
if ((Env!=NULL) && (strlen(Env)))
EnvL=1;
CosNaming::Name name;
name.length(1);
name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var manager;
- for (int i = 1; i<=NumberOfTries; i++){
- if (i!=1)
- a=nanosleep(&ts_req,&ts_rem);
- try{
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- manager = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- }
- catch( CORBA::COMM_FAILURE& )
- {
- MESSAGE( "Test Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
- }
- if(!CORBA::is_nil(inc)) {
- MESSAGE( "Test Container: Naming Service was found" )
- if(EnvL==1){
- for(int j=1; j<=NumberOfTries; j++){
- if (j!=1)
- a=nanosleep(&ts_req, &ts_rem);
- try{
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Test Container: Logger Server wasn't found" ) }
- catch(...){ MESSAGE( "Test Container: Unknown exception" ) }
- if (!CORBA::is_nil(object))
- log = SALOME_Logger::Logger::_narrow(object);
- if (!CORBA::is_nil(log)){
- MESSAGE( "Test Container: Loger Server was found" )
- log->ping();
- TEST_CONTAINER=1;
- break;
+ PortableServer::POAManager_var manager;
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ manager = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Test Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ }
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "Test Container: Naming Service was found" )
+ if(EnvL==1)
+ {
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Test Container: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Test Container: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Test Container: Loger Server was found" );
+ TEST_CONTAINER=1;
+ break;
+ }
+ }
}
- }}
- }
+ }
if ((TEST_CONTAINER==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
break;
- }
- //
+ }
+
// Use Name Service to find container
SALOME_NamingService _NS(orb) ;
string containerName = "/Containers/" ;
Utils_Identity.cxx Utils_ORB_INIT.cxx \
Utils_DESTRUCTEUR_GENERIQUE.cxx
-LDFLAGS+= -lSalomeLoggerServer
+LDFLAGS+=
@CONCLUDE@
SALOME_Exception::SALOME_Exception( void ): exception() , _text(0)
{
- MESSAGE( "You must user the standard builder : SALOME_Exception::SALOME_Exception( const char *text )" ) ;
+ MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ;
INTERRUPTION(1) ;
}
/* --- Definition macros file to print informations if _DEBUG_ is defined --- */
-# ifndef UTILITIES_H
-# define UTILITIES_H
+#ifndef UTILITIES_H
+#define UTILITIES_H
-# include <stdlib.h>
-# include <iostream>
-
-
-
-//VRV: T2.4 - replacement macro for using special CORBA server
-#include "SALOME_Trace.hxx"
-//VRV: T2.4 - replacement macro for using special CORBA server
+#include <string>
+#include <iostream>
+#include "SALOME_Log.hxx"
/* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
-//VRV: T2.4 - replacement of these macros for using special CORBA server
-
-#define INFOS(msg) { GLogger.putMessage(GLogger << __FILE__<< " [" << __LINE__ << "] : " << msg<< endl << ends ); }
-#define PYSCRIPT(msg) { GLogger.putMessage(GLogger<<"---PYSCRIPT--- "<<msg<<endl<<ends ); }
+#define INFOS(msg) {SLog.putMessage(SLog<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<endl);}
+#define PYSCRIPT(msg) {SLog.putMessage(SLog<<"---PYSCRIPT--- "<<msg<<endl);}
-//# define HEREWEARE {cout<<flush ; cerr << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
-//# define INFOS(chain) {HEREWEARE ; cerr << chain << endl ;}
-//# define PYSCRIPT(chain) {cout<<flush ; cerr << "---PYSCRIPT--- " << chain << endl ;}
+/* --- To print date and time of compilation of current source --- */
-//VRV: T2.4 - replacement of these macros for using special CORBA server
+#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
-/* --- To print date and time of compilation of current source on stdout --- */
-
-# 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
-
-//VRV: T2.4 - replacement macro for using special CORBA server
#define INFOS_COMPILATION { \
- GLogger.putMessage(\
- GLogger << __FILE__ << " [" << __LINE__ << "] : "\
- << "COMPILED with " << COMPILER \
- << ", " << __DATE__ \
- << " at " << __TIME__ << endl << endl <<endl<<ends); }
-/* # define INFOS_COMPILATION {\ */
-/* cerr << flush;\ */
-/* cout << __FILE__ ;\ */
-/* cout << " [" << __LINE__ << "] : " ;\ */
-/* cout << "COMPILED with " << COMPILER ;\ */
-/* cout << ", " << __DATE__ ; \ */
-/* cout << " at " << __TIME__ << endl ;\ */
-/* cout << "\n\n" ;\ */
-/* cout << flush ;\ */
-/* } */
-//VRV: T2.4 - replacement macro for using special CORBA server
-
-# ifdef _DEBUG_
+ SLog.putMessage(\
+ SLog<<__FILE__<<" ["<< __LINE__<<"] : "\
+ << "COMPILED with " << COMPILER \
+ << ", " << __DATE__ \
+ << " at " << __TIME__ <<endl); }
-/* --- the following MACROS are useful at debug time --- */
+#ifdef _DEBUG_
-//VRV: T2.4 - replacement of these macros for using special CORBA server
-
-#define MYTRACE GLogger << "- Trace " << __FILE__ << " [" << __LINE__ << "] : "
-
-#define MESSAGE(msg) { GLogger.putMessage( MYTRACE <<msg<<endl<<ends); }
-#define SCRUTE(var) { GLogger.putMessage( MYTRACE << #var << "=" << var <<endl<<ends); }
-
-#define REPERE GLogger << " --------------" << endl
-#define BEGIN_OF(msg) {REPERE ; MYTRACE << "Begin of: " << msg << endl ; REPERE ; GLogger.putMessage(GLogger<<ends); }
-#define END_OF(msg) {REPERE ; MYTRACE << "Normal end of: " << msg << endl ; REPERE ; GLogger.putMessage(GLogger<<ends); }
-
-# define HERE {cout<<flush ; cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
-
-//VRV: T2.4 - replacement of these macros for using special CORBA server
-
-# define INTERRUPTION(code) {HERE ; cerr << "INTERRUPTION return code= " << code << endl ; exit(code) ;}
+/* --- the following MACROS are useful at debug time --- */
-# ifndef ASSERT
-# define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}
-# endif /* ASSERT */
+#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_*/
+#else /* ifdef _DEBUG_*/
#define HERE
#define SCRUTE(var) {}
#define BEGIN_OF(msg) {}
#define END_OF(msg) {}
-# define INTERRUPTION(code) {}
+#define INTERRUPTION(code) {}
-# ifndef ASSERT
-# define ASSERT(condition) {}
-# endif /* ASSERT */
+#ifndef ASSERT
+#define ASSERT(condition) {}
+#endif /* ASSERT */
-# endif /* ifdef _DEBUG_*/
+#endif /* ifdef _DEBUG_*/
-# endif /* ifndef UTILITIES_H */
+#endif /* ifndef UTILITIES_H */