EUROPEAN SYNCHROTRON RADIATION FACILITY
INSTALLATION EUROPEENNE DE RAYONNEMENT SYNCHROTRON
ESRF Logo
Main Page   Namespace List   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Starter.h

Go to the documentation of this file.
00001 //=============================================================================
00002 //
00003 // file :        Starter.h
00004 //
00005 // description : Include for the Starter class.
00006 //
00007 // project :    Starter for Tango Administration
00008 //
00009 // $Author: pascal_verdier $
00010 //
00011 // $Revision: 1.2 $
00012 //
00013 // $Log: Starter_8h-source.html,v $
00013 // Revision 1.2  2003/12/08 08:53:53  pascal_verdier
00013 // Cluster (multi-host) control implemented.
00013 // Control of notify daemon implemented but not tested.
00013 //
00014 // Revision 3.0.1.1  2003/09/18 12:02:49  pascal_verdier
00015 // Problem on Windows service startup fixed.
00016 //
00017 // Revision 3.0  2003/06/17 12:06:36  pascal_verdier
00018 // TANGO 3.x server.
00019 // polling bugs fixed.
00020 //
00021 // Revision 2.0  2003/01/09 13:35:50  verdier
00022 // TANGO 2.2
00023 //
00024 // Revision 1.22  2002/12/18 08:09:19  verdier
00025 // omniORB compatibility
00026 //
00027 // Revision 1.6  2002/10/15 18:55:21  verdier
00028 // The host state is now calculated during the State polled command.
00029 //
00030 // Revision 1.5  2002/02/27 15:19:32  verdier
00031 // WinNt services implemented.
00032 //
00033 // Revision 1.4  2001/04/03 09:40:50  verdier
00034 // WInNt version is running.
00035 //
00036 // Revision 1.3  2001/02/12 09:34:21  verdier
00037 // SunOS and Linux OK.
00038 //
00039 // Revision 1.2  2000/10/12 08:54:13  verdier
00040 // Compatible with tango 2 done
00041 //  Update from database info added.
00042 //
00043 // Revision 1.1  2000/07/31 13:48:42  verdier
00044 // Initial revision
00045 //
00046 //
00047 // copyleft :    European Synchrotron Radiation Facility
00048 //               BP 220, Grenoble 38043
00049 //               FRANCE
00050 //
00051 //=============================================================================
00052 //
00053 //              This file is generated by POGO
00054 //      (Program Obviously used to Generate tango Object)
00055 //
00056 //             (c) - Pascal Verdier - ESRF
00057 //=============================================================================
00058 #ifndef _STARTER_H
00059 #define _STARTER_H
00060 
00061 #include <tango.h>
00062 #include <StarterUtil.h>
00063 #include <sstream>
00064 
00065 using namespace std;
00071  //     Add your own constants definitions here.
00072  //-----------------------------------------------
00073 
00074 
00075 namespace Starter
00076 {
00077 
00084 /*
00085  *      Device States Description:
00086  *      Tango::UNKNOWN :        This device server has NOT been correctly initialised.
00087  *      Tango::ON :     This device server has been correctly initialised.
00088  */
00089 
00090 
00091 class Starter: public Tango::Device_2Impl
00092 {
00093 public :
00094         //      Add your own data members here
00095         //-----------------------------------------
00099         void manage_PollingState_startup();
00103         StarterUtil     *util;
00107         SharedData              *shared;
00111         PollingState    *poller;
00115         omni_thread                     *polling_id;
00119         vector<ServerControled>         servers;
00123         Tango::DevBoolean       throwable;
00127         string  returned_str;
00131         Tango::DeviceProxy      *dbase;
00132 
00133         //      Here is the Start of the automatic code generation part
00134         //------------------------------------------------------------- 
00140 
00141 
00151         vector<string>  startDsPath;
00156         Tango::DevShort waitForDriverStartup;
00160         Tango::DevShort disableNotifyDaemon;
00162 
00172         Starter(Tango::DeviceClass *,string &);
00179         Starter(Tango::DeviceClass *,const char *);
00187         Starter(Tango::DeviceClass *,const char *,const char *);
00189 
00196         ~Starter() {};
00198 
00199         
00205         virtual void init_device();
00209         virtual void always_executed_hook();
00210 
00212 
00223         virtual Tango::DevState dev_state();
00229         void    dev_start_all(Tango::DevShort);
00235         void    dev_stop_all(Tango::DevShort);
00243         Tango::DevVarStringArray        *dev_get_running_servers(Tango::DevBoolean);
00251         Tango::DevVarStringArray        *dev_get_stop_servers(Tango::DevBoolean);
00257         void    dev_start(Tango::DevString);
00263         void    dev_stop(Tango::DevString);
00271         Tango::ConstDevString   dev_read_log(Tango::DevString);
00279         void    update_servers_info();
00284         void    start_polling_thread();
00285 
00289          void get_device_property();
00291 
00292         //      Here is the end of the automatic code generation part
00293         //------------------------------------------------------------- 
00294 
00295 
00296 
00297 protected :     
00298         //      Add your own data members here
00299         //-----------------------------------------
00310 const bool is_running(ServerControled *);
00318 void get_server_info(ServerControled *);
00322 void build_server_ctrl_object(void);
00323 #ifndef WIN32
00324 
00327 void signal_handler(long);
00328 #endif
00329 
00331 };
00332 
00333 #ifdef WIN32
00334 
00337 class StartWinProcess: public omni_thread
00338 {
00339         char    *server;
00340         char    *instancename;
00341         char    *log_file;
00342 public:
00346         void initialize(char *, char *, char *);
00350         void *run_undetached(void *);
00351         void start() {start_undetached();}
00352 };
00353 #endif
00354 
00355 }       //      namespace
00356 
00357 #endif  // _STARTER_H
Tango Device Server User's Guide



(c) ESRF - Software Engineering Group