-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SALOME_NamingService.hxx"
#include "Basics_Utils.hxx"
#include "utilities.h"
+#include "Qtx.h"
#include <QApplication>
#include <QWaitCondition>
*/
const int __DEFAULT__DELAY__ = 50000;
+// The exception being thrown out of a destructor,
+// that is not allowed by default in C++11.
+
+#if __cplusplus >= 201103L
+# define TYPE_NOEXCEPT noexcept(false)
+#else
+# define TYPE_NOEXCEPT
+#endif
+
/*!
\classSession_ServerCheck::Locker
\brief Automatic locker/unlocker.
/*!
\brief Destructor. Wakes the calling thread and goes sleeping.
*/
- ~Locker()
+ ~Locker() TYPE_NOEXCEPT
{
myChecker->myWC->wakeAll();
myChecker->usleep( myChecker->myDelay );
// start check servers
int current = 0;
QString error;
- int argc = QApplication::instance()->argc();
- char** argv = QApplication::instance()->argv();
-
+ Qtx::CmdLineArgs args;
+
// 1. Check naming service
for ( int i = 0; i < myAttempts; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj );
if ( !CORBA::is_nil( _root_context ) ) {
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( args.argc(), args.argv() );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
NS.init_orb( orb );