~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to apps/Gateway/Gateway/Options.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- C++ -*- */
2
 
// Options.h,v 4.14 2003/11/09 04:12:07 dhinton Exp
3
 
 
4
 
// ============================================================================
5
 
//
6
 
// = LIBRARY
7
 
//    gateway
8
 
//
9
 
// = FILENAME
10
 
//    Options.h
11
 
//
12
 
// = AUTHOR
13
 
//    Douglas C. Schmidt <schmidt@cs.wustl.edu>
14
 
//
15
 
// ============================================================================
16
 
 
17
 
#ifndef OPTIONS_H
18
 
#define OPTIONS_H
19
 
 
20
 
#include "ace/config-all.h"
21
 
 
22
 
#if !defined (ACE_LACKS_PRAGMA_ONCE)
23
 
# pragma once
24
 
#endif /* ACE_LACKS_PRAGMA_ONCE */
25
 
 
26
 
#include "ace/svc_export.h"
27
 
#include "ace/Lock_Adapter_T.h"
28
 
#include "ace/Synch_Traits.h"
29
 
#include "ace/Thread_Mutex.h"
30
 
 
31
 
class ACE_Svc_Export Options
32
 
{
33
 
  // = TITLE
34
 
  //     Singleton that consolidates all Options for a gatewayd.
35
 
public:
36
 
  // = Options that can be enabled/disabled.
37
 
  enum
38
 
  {
39
 
    // = The types of threading strategies.
40
 
    REACTIVE = 0,
41
 
    OUTPUT_MT = 1,
42
 
    INPUT_MT = 2,
43
 
 
44
 
    VERBOSE = 01,
45
 
    DEBUG = 02,
46
 
 
47
 
    SUPPLIER_ACCEPTOR = 04,
48
 
    CONSUMER_ACCEPTOR = 010,
49
 
    SUPPLIER_CONNECTOR = 020,
50
 
    CONSUMER_CONNECTOR = 040
51
 
  };
52
 
 
53
 
  static Options *instance (void);
54
 
  // Return Singleton.
55
 
 
56
 
  ~Options (void);
57
 
  // Termination.
58
 
 
59
 
  int parse_args (int argc, char *argv[]);
60
 
  // Parse the arguments and set the options.
61
 
 
62
 
  void print_usage(void);
63
 
  // Print the gateway supported parameters.
64
 
  // = Accessor methods.
65
 
  int enabled (int option) const;
66
 
  // Determine if an option is enabled.
67
 
 
68
 
  ACE_Lock_Adapter<ACE_SYNCH_MUTEX> *locking_strategy (void) const;
69
 
  // Gets the locking strategy used for serializing access to the
70
 
  // reference count in <ACE_Message_Block>.  If it's 0, then there's
71
 
  // no locking strategy and we're using a REACTIVE concurrency
72
 
  // strategy.
73
 
 
74
 
  void locking_strategy (ACE_Lock_Adapter<ACE_SYNCH_MUTEX> *);
75
 
  // Set the locking strategy used for serializing access to the
76
 
  // reference count in <ACE_Message_Block>.
77
 
 
78
 
  int performance_window (void) const;
79
 
  // Number of seconds after connection establishment to report
80
 
  // throughput.
81
 
 
82
 
  int blocking_semantics (void) const;
83
 
  // 0 == blocking connects, ACE_NONBLOCK == non-blocking connects.
84
 
 
85
 
  int socket_queue_size (void) const;
86
 
  // Size of the socket queue (0 means "use default").
87
 
 
88
 
  u_long threading_strategy (void) const;
89
 
  // i.e., REACTIVE, OUTPUT_MT, and/or INPUT_MT.
90
 
 
91
 
  u_short supplier_acceptor_port (void) const;
92
 
  // Our acceptor port number, i.e., the one that we passively listen
93
 
  // on for connections to arrive from a gatewayd and create a
94
 
  // Supplier.
95
 
 
96
 
  u_short consumer_acceptor_port (void) const;
97
 
  // Our acceptor port number, i.e., the one that we passively listen
98
 
  // on for connections to arrive from a gatewayd and create a
99
 
  // Consumer.
100
 
 
101
 
  u_short supplier_connector_port (void) const;
102
 
  // The connector port number, i.e., the one that we use to actively
103
 
  // establish connections with a gatewayd and create a Supplier.
104
 
 
105
 
  u_short consumer_connector_port (void) const;
106
 
  // The connector port number, i.e., the one that we use to actively
107
 
  // establish connections with a gatewayd and create a Consumer.
108
 
 
109
 
  const char *connector_host (void) const;
110
 
  // Our connector port host, i.e., the host running the gatewayd
111
 
  // process.
112
 
 
113
 
  const char *connection_config_file (void) const;
114
 
  // Name of the connection configuration file.
115
 
 
116
 
  const char *consumer_config_file (void) const;
117
 
  // Name of the consumer map configuration file.
118
 
 
119
 
  long max_timeout (void) const;
120
 
  // The maximum retry timeout delay.
121
 
 
122
 
  long max_queue_size (void) const;
123
 
  // The maximum size of the queue.
124
 
 
125
 
  CONNECTION_ID &connection_id (void);
126
 
  // Returns a reference to the next available connection id;
127
 
 
128
 
private:
129
 
  enum
130
 
  {
131
 
    MAX_QUEUE_SIZE = 1024 * 1024 * 16,
132
 
    // We'll allow up to 16 megabytes to be queued per-output proxy.
133
 
 
134
 
    MAX_TIMEOUT = 32
135
 
    // The maximum timeout for trying to re-establish connections.
136
 
  };
137
 
 
138
 
  Options (void);
139
 
  // Initialization.
140
 
 
141
 
  static Options *instance_;
142
 
  // Options Singleton instance.
143
 
 
144
 
  ACE_Lock_Adapter<ACE_SYNCH_MUTEX> *locking_strategy_;
145
 
  // Points to the locking strategy used for serializing access to the
146
 
  // reference count in <ACE_Message_Block>.  If it's 0, then there's
147
 
  // no locking strategy and we're using a REACTIVE concurrency
148
 
  // strategy.
149
 
 
150
 
  int performance_window_;
151
 
  // Number of seconds after connection establishment to report
152
 
  // throughput.
153
 
 
154
 
  int blocking_semantics_;
155
 
  // 0 == blocking connects, ACE_NONBLOCK == non-blocking connects.
156
 
 
157
 
  int socket_queue_size_;
158
 
  // Size of the socket queue (0 means "use default").
159
 
 
160
 
  u_long threading_strategy_;
161
 
  // i.e., REACTIVE, OUTPUT_MT, and/or INPUT_MT.
162
 
 
163
 
  u_long options_;
164
 
  // Flag to indicate if we want verbose diagnostics.
165
 
 
166
 
  u_short supplier_acceptor_port_;
167
 
  // The acceptor port number, i.e., the one that we passively listen
168
 
  // on for connections to arrive from a gatewayd and create a
169
 
  // Supplier.
170
 
 
171
 
  u_short consumer_acceptor_port_;
172
 
  // The acceptor port number, i.e., the one that we passively listen
173
 
  // on for connections to arrive from a gatewayd and create a
174
 
  // Consumer.
175
 
 
176
 
  u_short supplier_connector_port_;
177
 
  // The connector port number, i.e., the one that we use to actively
178
 
  // establish connections with a gatewayd and create a Supplier.
179
 
 
180
 
  u_short consumer_connector_port_;
181
 
  // The connector port number, i.e., the one that we use to actively
182
 
  // establish connections with a gatewayd and create a Consumer.
183
 
 
184
 
  long max_timeout_;
185
 
  // The maximum retry timeout delay.
186
 
 
187
 
  long max_queue_size_;
188
 
  // The maximum size of the queue.
189
 
 
190
 
  CONNECTION_ID connection_id_;
191
 
  // The next available connection id.
192
 
 
193
 
  char connection_config_file_[MAXPATHLEN + 1];
194
 
  // Name of the connection configuration file.
195
 
 
196
 
  char consumer_config_file_[MAXPATHLEN + 1];
197
 
  // Name of the consumer map configuration file.
198
 
};
199
 
 
200
 
#endif /* OPTIONS_H */