English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReLauncher: TSocketRun.h Source File
Uranie / ReLauncher  v4.10.0
/* @license-end */
TSocketRun.h
Go to the documentation of this file.
1 /* --- Ansi C --- */
3 // Copyright (C) 2013-2024 CEA/DES
4 //
5 // This program is free software: you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public License
7 // as published by the Free Software Foundation, either version 3 of
8 // the License, or any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this program.
17 // if not, see <http://www.gnu.org/licenses/>.
19 
27 #ifndef __TSOCKETRUN__
28 #define __TSOCKETRUN__
29 
30 #include "TSeparateRun.h"
31 
32 #include <queue>
33 #include <vector>
34 
35 #include "TSocket.h"
36 #include "TServerSocket.h"
37 #include "TMonitor.h"
38 
39 namespace URANIE
40 {
41 namespace Relauncher
42 {
43 
44 class TSocketRun : public TSeparateRun
45 {
46 protected:
47 
48  // server side
49  TServerSocket *_sserv;
50  TMonitor *_moni;
51  std::vector<TSocket *> _sclient;
52  // client side
53  const char *_conn;
54  int _port;
55  //TSocket *_sock;
56 
57 
58  virtual int wait_service();
59  virtual int send_header(int canal, int *head, int size);
60  virtual int send_value(int canal, double *mesg, int size);
61  virtual int receive_header(int canal, int *head, int size);
62  virtual int receive_value(int canal, double *mesg, int size);
63 
64 public:
65 
66  TSocketRun(URANIE::Relauncher::TEval *r, int p=5432);
67  virtual ~TSocketRun();
68 
69  virtual void startSlave();
70  virtual Bool_t onMaster();
71  virtual Bool_t readyToGet();
72 
73  ClassDef(URANIE::Relauncher::TSocketRun, ID_RELAUNCHER)
74 };
75 
76 
77 }} //namespace
78 #endif
Definition: TBaseEval.cxx:44
int _port
Definition: TSocketRun.h:54
std::vector< TSocket * > _sclient
Definition: TSocketRun.h:51
virtual Bool_t onMaster()
Definition: TSocketRun.cxx:151
TSocketRun(URANIE::Relauncher::TEval *r, int p=5432)
Definition: TSocketRun.cxx:48
Definition: TSeparateRun.h:44
Definition: TSocketRun.h:44
virtual void startSlave()
Definition: TSocketRun.cxx:118
virtual int send_value(int canal, double *mesg, int size)
Definition: TSocketRun.cxx:111
virtual int wait_service()
Definition: TSocketRun.cxx:87
TMonitor * _moni
Definition: TSocketRun.h:50
TServerSocket * _sserv
Definition: TSocketRun.h:49
virtual int receive_header(int canal, int *head, int size)
Definition: TSocketRun.cxx:96
virtual int send_header(int canal, int *head, int size)
Definition: TSocketRun.cxx:106
virtual int receive_value(int canal, double *mesg, int size)
Definition: TSocketRun.cxx:101
virtual ~TSocketRun()
Definition: TSocketRun.cxx:70
virtual Bool_t readyToGet()
Definition: TSocketRun.cxx:156
separate process communicating by stream
Definition: TEval.h:49
const char * _conn
Definition: TSocketRun.h:53