00001 /* 00002 * StatsServerAlg 00003 * 00004 * Algorithm which provides network access to StatisticsSvc 00005 * histograms, trees, etc. 00006 * 00007 * dandwyer@caltech.edu 2009/09/04 00008 */ 00009 00010 00011 #ifndef STATSSERVERALG_H 00012 #define STATSSERVERALG_H 00013 00014 00015 #include "GaudiAlg/GaudiAlgorithm.h" 00016 00017 class IStatisticsSvc; 00018 class TSocket; 00019 class TServerSocket; 00020 class TMonitor; 00021 class TList; 00022 00023 class StatsServerAlg : public GaudiAlgorithm 00024 { 00025 00026 public: 00027 StatsServerAlg(const std::string& name, ISvcLocator* pSvcLocator); 00028 virtual ~StatsServerAlg(); 00029 00030 virtual StatusCode initialize(); 00031 virtual StatusCode execute(); 00032 virtual StatusCode finalize(); 00033 00034 private: 00035 // Start Statistics Server 00036 StatusCode startServer(); 00037 // Stop Statistics Server 00038 StatusCode stopServer(); 00039 // Process requests from client 00040 StatusCode processRequests(); 00041 00042 // Property ProcessInterval - How frequently to process requests? 00043 int m_processInterval; 00044 00045 // Property PortNumber - Start Server at this Port Number 00046 int m_portNumber; 00047 00048 // Handle for statistics service 00049 IStatisticsSvc* m_statsSvc; 00050 00051 // Server handle 00052 TServerSocket* m_server; 00053 00054 // Socket Monitor handle 00055 TMonitor* m_monitor; 00056 00057 // List of clients 00058 TList* m_clients; 00059 00060 }; 00061 00062 #endif // STATSSERVERALG_H