NdmcClientService.h
Go to the documentation of this file.
1 /**
2  * NdmcClientService header file
3  * $Id: NdmcClientService.h,v 1.4 2017/08/08 20:21:09 dingpf Exp $
4  */
5 #ifndef __NDMC_CLIENTSERVICE_H_
6 #define __NDMC_CLIENTSERVICE_H_
7 
8 #include "NovaDAQMonitorClient/Ndmc.h"
9 extern "C" {
10 #include "ganglia.h"
11 }
12 
14 
15 /**
16  * NdmcClientService
17  *
18  * This class implements the NdmcClientService singleton interface to the Ganglia
19  * global environment for initiating the Ganglia global context, udp send channels,
20  * and gmond configuration. An NdmcClient would use this service for access
21  * this Ganglia data, which should be common for all clients on this node.
22  *
23  * @author Susan Kasahara
24  * @author <a href="mailto:schubert@physics.umn.edu">schubert@physics.umn.edu</a>
25  * @date May 5 2010
26  */
27 
29 
30  private:
31 
32  // Constructor/Destructor private. Access via static instance() method
34  virtual ~NdmcClientService();
35 
36  public:
37 
38  static NdmcClientService& instance();
39  static std::string getCONFIGFILE() { return _CONFIGFILE; }
40  static void setCONFIGFILE(std::string configfile) { _CONFIGFILE = configfile; }
41 
42  // State changing methods
43 
44  // State testing methods
45  bool isEnabled() const { return _enabled; }
46  Ganglia_pool_t getGlobalContext() const { return _globalContext; }
47  Ganglia_udp_send_channels_t getSendChannels() const { return _sendChannels; }
48 
49  private:
50 
51  bool _enabled; /**< NdmcClientService has been initialized */
52  Ganglia_pool_t _globalContext; /**< Ganglia global context */
53  Ganglia_gmond_config_t _gmondConfig; /**< Ganglia gmond configuration */
54  Ganglia_udp_send_channels_t _sendChannels; /**< Ganglia send channels */
55 
56  bool _initGanglia();
57 
58  // Disable copy and assignment ctor by making them private and w/no imp
59  NdmcClientService(const NdmcClientService&); /**< Disabled */
60  NdmcClientService& operator=(const NdmcClientService&); /**< Disabled */
61 
63 
64 };
65 
67 
68 #endif
69 
Ganglia_pool_t getGlobalContext() const
Ganglia_udp_send_channels_t _sendChannels
Ganglia_udp_send_channels_t getSendChannels() const
#define NDMC_NAMESPACE_BEGIN
Definition: Ndmc.h:23
static std::string getCONFIGFILE()
static std::string _CONFIGFILE
static void setCONFIGFILE(std::string configfile)
#define NDMC_NAMESPACE_END
Definition: Ndmc.h:26
bool isEnabled() const
static NdmcClientService & instance()
NdmcClientService & operator=(const NdmcClientService &)
Ganglia_gmond_config_t _gmondConfig
Ganglia_pool_t _globalContext
enum BeamMode string