summaryrefslogtreecommitdiff
path: root/ace/Monitor_Control/BSD_Network_Interface_Monitor.h
blob: ed959acb5e5e49c0e6b169452111a37567bb8e69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// -*- C++ -*-

//=============================================================================
/**
 * @file BSD_Network_Interface_Monitor.h
 *
 * $Id$
 *
 * @author Jeff Parsons <j.parsons@vanderbilt.edu>
 */
//=============================================================================

#ifndef BSD_NETWORK_INTERFACE_MONITOR_H
#define BSD_NETWORK_INTERFACE_MONITOR_H

#include /**/ "ace/pre.h"

#include "ace/SString.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Monitor_Control/Monitor_Control_export.h"

#if defined (__NetBSD__) || defined (__OpenBSD__)

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace Monitor_Control
  {
    /**
     * @class BSD_Network_Interface_Monitor
     *
     * @brief Mixin class for network interface monitors compiled on
     *        xxxBSD machines.
     */
    class MONITOR_CONTROL_Export BSD_Network_Interface_Monitor
    {
    protected:
      BSD_Network_Interface_Monitor (const ACE_TCHAR *lookup_str);

      /// Platform-specific implementation.
      void update_i (void);

      /// Platform-specific reset.
      void clear_impl (void);

    protected:
      ACE_UINT64 value_;

    private:
      void init (void);
      void fetch (ACE_UINT64& value) const;

      ACE_UINT64 start_;
      ACE_CString lookup_str_;
    };
  }
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* defined (__NetBSD__) || defined (__OpenBSD__) */

#include /**/ "ace/post.h"

#endif // BSD_NETWORK_INTERFACE_MONITOR_H