Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / ace / Monitor_Control / Num_Threads_Monitor.h
blob7a20d2d0b78bb70cf3cec1b0e3c978ee18230740
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Num_Threads_Monitor.h
7 * @author Jeff Parsons <j.parsons@vanderbilt.edu>
8 */
9 //=============================================================================
11 #ifndef NUM_THREADS_MONITOR_H
12 #define NUM_THREADS_MONITOR_H
14 #include /**/ "ace/pre.h"
16 #include "ace/Monitor_Base.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
24 #if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
25 #include "ace/Monitor_Control/Windows_Monitor.h"
26 #endif
28 #include "ace/Monitor_Control/Monitor_Control_export.h"
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
32 namespace ACE
34 namespace Monitor_Control
36 /**
37 * @class Num_Threads_Monitor
39 * @brief Monitor total number of threads in the system.
41 class MONITOR_CONTROL_Export Num_Threads_Monitor
42 : public Monitor_Base
43 #if defined (ACE_HAS_WIN32_PDH)
44 , public Windows_Monitor
45 #endif
47 public:
48 Num_Threads_Monitor (const char* name);
50 /// Implementation of the pure virtual method.
51 virtual void update ();
53 /// Stores the default name, used if none is supplied by the user.
54 static const char* default_name ();
56 private:
57 /// Overridden reset, calls platform-specific reset.
58 virtual void clear_i ();
60 private:
61 static const char* default_name_;
63 #if defined (ACE_LINUX)
64 FILE *file_ptr_;
65 char buf_[1024];
66 unsigned long nthreads_;
67 #endif
72 ACE_END_VERSIONED_NAMESPACE_DECL
74 #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
76 #include /**/ "ace/post.h"
78 #endif // NUM_THREADS_MONITOR_H