Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / examples / LoadBalancing / RPS_Monitor.h
bloba51f978e87825c15c807a4544d6d473855e9b177
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file RPS_Monitor.h
7 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
8 */
9 //=============================================================================
12 #ifndef TAO_RPS_MONITOR_H
13 #define TAO_RPS_MONITOR_H
15 #include /**/ "ace/pre.h"
17 #include "orbsvcs/CosLoadBalancingS.h"
19 # if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 class ServerRequestInterceptor;
26 /**
27 * @class RPS_Monitor
29 * @brief LoadMonitor implementation that calculates the number of
30 * request arriving per second.
32 class RPS_Monitor
33 : public virtual POA_CosLoadBalancing::LoadMonitor
35 public:
36 /// Constructor
37 RPS_Monitor (ServerRequestInterceptor * interceptor);
39 /**
40 * @name CosLoadBalancing::LoadMonitor Methods
42 * Methods required by the CosLoadBalancing::LoadMonitor interface.
44 //@{
45 /// Return the location at which the LoadMonitor resides.
46 /**
47 * The returned "Location" is a sequence of length 1.
49 virtual CosLoadBalancing::Location * the_location ();
51 /// Return the average CPU load at the location which this
52 /// LoadMonitor resides.
53 /**
54 * @return A "Load" sequence of length 1 that contains a LoadId
55 * equal to CosLoadBalancing::LoadAverage, and the average CPU
56 * load.
58 virtual CosLoadBalancing::LoadList * loads ();
60 //@}
62 protected:
63 /// Destructor
64 /**
65 * Protected destructor to enforce proper memory management through
66 * reference counting.
68 ~RPS_Monitor ();
70 private:
71 /// The name of the location at which this LoadMonitor resides.
72 CosLoadBalancing::Location location_;
74 ServerRequestInterceptor * interceptor_;
76 ACE_Time_Value last_time_;
78 TAO_SYNCH_MUTEX lock_;
81 #include /**/ "ace/post.h"
83 #endif /* TAO_RPS_MONITOR_H */