Back to index

salome-gui  6.5.0
Session_ServerCheck.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File   : Session_ServerCheck.hxx
00024 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00025 //
00026 #if !defined(SESSION_SERVERCHECK_HXX)
00027 #define SESSION_SERVERCHECK_HXX
00028 
00029 #include "SALOME_Session.hxx"
00030 
00031 #include <QThread> 
00032 #include <QMutex>
00033 
00034 class QWaitCondition;
00035 
00036 class SESSION_EXPORT Session_ServerCheck : public QThread
00037 {
00038   class Locker;
00039 
00040 public:
00041   Session_ServerCheck( QMutex*, QWaitCondition* );
00042   virtual ~Session_ServerCheck();
00043 
00044   QString         currentMessage();
00045   QString         error();
00046 
00047   int             currentStep();
00048   int             totalSteps();
00049 
00050 protected:
00051   virtual void    run();
00052 
00053 private:
00054   void            setStep( const int );
00055   void            setError( const QString& msg );
00056 
00057 private:
00058   QMutex          myDataMutex;         
00059   QMutex*         myMutex;             
00060   QWaitCondition* myWC;                
00061 
00062   bool            myCheckCppContainer; 
00063   bool            myCheckPyContainer;  
00064   bool            myCheckSVContainer;  
00065   int             myAttempts;          
00066   int             myDelay;             
00067   int             myCurrentStep;       
00068   QString         myMessage;           
00069   QString         myError;             
00070 
00071   friend class Locker;
00072 };
00073 
00074 #endif  // SESSION_SERVERCHECK_HXX