summaryrefslogtreecommitdiff
path: root/examples/ASX/UPIPE_Event_Server/Options.h
blob: 1acad4b9d1fee5c362df88e5c29cd3f510fcc487 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* -*- C++ -*- */
// $Id$

// Option manager for Event Server.

#ifndef DEVICE_OPTIONS_H
#define DEVICE_OPTIONS_H

#include "ace/config-all.h"

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

#include "ace/Profile_Timer.h"

#if defined (ACE_HAS_THREADS)

class Options
{
public:
  Options (void);
  ~Options (void);
  void parse_args (int argc, ACE_TCHAR *argv[]);

  void   stop_timer (void);
  void   start_timer (void);

  void   thr_count (size_t count);
  size_t thr_count (void);

  void   initial_queue_length (size_t length);
  size_t initial_queue_length (void);

  void   high_water_mark (size_t size);
  size_t high_water_mark (void);

  void   low_water_mark (size_t size);
  size_t low_water_mark (void);

  void   message_size (size_t size);
  size_t message_size (void);

  void   iterations (size_t n);
  size_t iterations (void);

  void   t_flags (long flag);
  long   t_flags (void);

  void   supplier_port (const ACE_TCHAR *port);
  const ACE_TCHAR  *supplier_port (void);

  void   consumer_port (const ACE_TCHAR *port);
  const ACE_TCHAR  *consumer_port (void);

  void   supplier_file (const ACE_TCHAR *file);
  const ACE_TCHAR  *supplier_file (void);

  void   consumer_file (const ACE_TCHAR *file);
  const ACE_TCHAR  *consumer_file (void);

  int    debug (void);
  int    verbose (void);

  void   print_results (void);

private:
  ACE_Profile_Timer itimer_;            // Time the process.
  size_t        thr_count_;             // Number of threads to spawn.
  long          t_flags_;               // Flags to thr_create().
  size_t        high_water_mark_;       // ACE_Task high water mark.
  size_t        low_water_mark_;        // ACE_Task low water mark.
  size_t        message_size_;          // Size of a message.
  size_t        initial_queue_length_;  // Initial number of items in the queue.
  size_t        iterations_;            // Number of iterations to run the test program.
  int           debugging_;             // Extra debugging info.
  int           verbosity_;             // Extra verbose messages.
  const ACE_TCHAR *consumer_port_;      // Port that the Consumer_Router is using.
  const ACE_TCHAR *supplier_port_;      // Port that the Supplier_Router is using.
  const ACE_TCHAR *consumer_file_;      // file that the Consumer_Router is using.
  const ACE_TCHAR *supplier_file_;      // file that the Supplier_Router is using.
};

extern Options options;

#include "Options.i"
#endif /* ACE_HAS_THREADS */
#endif /* DEVICE_OPTIONS_H */