summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1999-06-25 18:06:48 +0000
committerSteve Huston <shuston@riverace.com>1999-06-25 18:06:48 +0000
commit282ab3b099092f964ae8271533ca6d28de3c626d (patch)
treed7dd006d60cdcb9140f1c82b358692242bacfc15 /examples
parent1e885ac9631cc21100e184d9d777e63d6c7c49cc (diff)
downloadATCD-282ab3b099092f964ae8271533ca6d28de3c626d.tar.gz
Move the Options class to a .h file to satisfy auto-template-instantiation
with AIX C++ compiler.
Diffstat (limited to 'examples')
-rw-r--r--examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp97
-rw-r--r--examples/IPC_SAP/SOCK_SAP/CPP-inclient.h108
-rw-r--r--examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp36
-rw-r--r--examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.h43
4 files changed, 155 insertions, 129 deletions
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp
index 7b935dbb983..03a68823ee6 100644
--- a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp
+++ b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp
@@ -14,102 +14,9 @@
#include "ace/High_Res_Timer.h"
#include "ace/Synch.h"
-ACE_RCSID(SOCK_SAP, CPP_inclient, "$Id$")
-
-class Options
- // = TITLE
- // Define the options for this test.
-{
-public:
- Options (void);
- // Constructor.
-
- ~Options (void);
- // Destructor.
-
- int parse_args (int argc, char *argv[]);
- // Parse the command-line arguments.
-
- const ACE_Time_Value &sleep_time (void) const;
- // Return the amount of time to sleep in order to implement the
- // proper transmission rates.
-
- u_short port (void) const;
- // Port of the server.
-
- const char *host (void) const;
- // Host of the server.
-
- size_t threads (void) const;
- // Number of threads.
-
- const char *quit_string (void) const;
- // String that shuts down the client/server.
-
- ssize_t read (void *buf, size_t len, size_t &iterations);
- // Read from the appropriate location.
-
- size_t message_len (void) const;
- // Returns the length of the message to send.
-
- const void *message_buf (void) const;
- // Returns a pointer to the message.
-
- ACE_THR_FUNC thr_func (void);
- // Returns a pointer to the entry point into the thread that runs
- // the client test function.
-
-private:
- int init (void);
- // Initialize the message we're sending to the user and set up the
- // barrier.
+#include "CPP-inclient.h"
- char *shared_client_test (u_short port,
- ACE_SOCK_Stream &cli_stream);
- // Performs the shared behavior of the oneway and twoway client
- // tests.
-
- static void *twoway_client_test (void *);
- // Performs the twoway test.
-
- static void *oneway_client_test (void *);
- // Performs the oneway test.
-
- const char *host_;
- // Host of the server.
-
- u_short port_;
- // Port of the server.
-
- ACE_Time_Value sleep_time_;
- // Sleep_Time value.
-
- size_t threads_;
- // Number of threads.
-
- const char *quit_string_;
- // String that shuts down the client/server.
-
- size_t message_len_;
- // Size of the message we send to the server.
-
- char *message_buf_;
- // Pointer to the message we send to the server.
-
- ACE_HANDLE io_source_;
- // Are we reading I/O from ACE_STDIN or from our generator?
-
- size_t iterations_;
- // Number of iterations.
-
- char oneway_;
- // Are we running oneway or twoway?
-
- // Please leave the ; inside the parenthesis to avoid Green Hills
- // (and probably other) compiler warning about extra ;.
- ACE_MT (ACE_Barrier *barrier_;)
- // Barrier used to synchronize the start of all the threads.
-};
+ACE_RCSID(SOCK_SAP, CPP_inclient, "$Id$")
Options::Options (void)
: host_ (ACE_DEFAULT_SERVER_HOST),
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h
new file mode 100644
index 00000000000..8b3a9ee4562
--- /dev/null
+++ b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h
@@ -0,0 +1,108 @@
+// $Id$
+
+// This file defines the Options class for CPP-inclient. IBM C++ compiler'd
+// template auto-instantiator needs this in a separate file.
+
+#ifndef __CPP_INCLIENT_H
+#define __CPP_INCLIENT_H
+
+#include "ace/OS.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/Synch.h"
+
+class Options
+ // = TITLE
+ // Define the options for this test.
+{
+public:
+ Options (void);
+ // Constructor.
+
+ ~Options (void);
+ // Destructor.
+
+ int parse_args (int argc, char *argv[]);
+ // Parse the command-line arguments.
+
+ const ACE_Time_Value &sleep_time (void) const;
+ // Return the amount of time to sleep in order to implement the
+ // proper transmission rates.
+
+ u_short port (void) const;
+ // Port of the server.
+
+ const char *host (void) const;
+ // Host of the server.
+
+ size_t threads (void) const;
+ // Number of threads.
+
+ const char *quit_string (void) const;
+ // String that shuts down the client/server.
+
+ ssize_t read (void *buf, size_t len, size_t &iterations);
+ // Read from the appropriate location.
+
+ size_t message_len (void) const;
+ // Returns the length of the message to send.
+
+ const void *message_buf (void) const;
+ // Returns a pointer to the message.
+
+ ACE_THR_FUNC thr_func (void);
+ // Returns a pointer to the entry point into the thread that runs
+ // the client test function.
+
+private:
+ int init (void);
+ // Initialize the message we're sending to the user and set up the
+ // barrier.
+
+ char *shared_client_test (u_short port,
+ ACE_SOCK_Stream &cli_stream);
+ // Performs the shared behavior of the oneway and twoway client
+ // tests.
+
+ static void *twoway_client_test (void *);
+ // Performs the twoway test.
+
+ static void *oneway_client_test (void *);
+ // Performs the oneway test.
+
+ const char *host_;
+ // Host of the server.
+
+ u_short port_;
+ // Port of the server.
+
+ ACE_Time_Value sleep_time_;
+ // Sleep_Time value.
+
+ size_t threads_;
+ // Number of threads.
+
+ const char *quit_string_;
+ // String that shuts down the client/server.
+
+ size_t message_len_;
+ // Size of the message we send to the server.
+
+ char *message_buf_;
+ // Pointer to the message we send to the server.
+
+ ACE_HANDLE io_source_;
+ // Are we reading I/O from ACE_STDIN or from our generator?
+
+ size_t iterations_;
+ // Number of iterations.
+
+ char oneway_;
+ // Are we running oneway or twoway?
+
+ // Please leave the ; inside the parenthesis to avoid Green Hills
+ // (and probably other) compiler warning about extra ;.
+ ACE_MT (ACE_Barrier *barrier_;)
+ // Barrier used to synchronize the start of all the threads.
+};
+
+#endif /* __CPP_INCLIENT_H */
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp
index 57abb16864e..2324707748c 100644
--- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp
+++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp
@@ -12,6 +12,8 @@
#include "ace/Profile_Timer.h"
#include "ace/Get_Opt.h"
+#include "CPP-inserver-fancy.h"
+
ACE_RCSID(SOCK_SAP, CPP_inserver_fancy, "$Id$")
// Forward declaration.
@@ -127,40 +129,6 @@ private:
// Print the results.
};
-class Options
- // = TITLE
- // Define the options for this test.
-{
-public:
- Options (void);
- // Constructor.
-
- ~Options (void);
- // Destructor.
-
- int parse_args (int argc, char *argv[]);
- // Parse the command-line arguments.
-
- int verbose (void) const;
- // Are we running in verbose mode?
-
- u_short port (void) const;
- // Port number that we are listening at.
-
- int reply_message_len (void) const;
- // Size of the reply message.
-
-private:
- int verbose_;
- // Are we running in verbose mode?
-
- u_short port_;
- // Port number we listen at.
-
- size_t reply_message_len_;
- // Size of the reply message.
-};
-
u_short
Options::port (void) const
{
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.h b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.h
new file mode 100644
index 00000000000..9edb1d6a1d8
--- /dev/null
+++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.h
@@ -0,0 +1,43 @@
+// $Id$
+
+// This file defines the Options class for CPP-inserver-fancy.
+// IBM C++ compiler'd template auto-instantiator needs this in a separate file.
+
+#ifndef __CPP_INSERVER_FANCY_H
+#define __CPP_INSERVER_FANCY_H
+
+class Options
+ // = TITLE
+ // Define the options for this test.
+{
+public:
+ Options (void);
+ // Constructor.
+
+ ~Options (void);
+ // Destructor.
+
+ int parse_args (int argc, char *argv[]);
+ // Parse the command-line arguments.
+
+ int verbose (void) const;
+ // Are we running in verbose mode?
+
+ u_short port (void) const;
+ // Port number that we are listening at.
+
+ int reply_message_len (void) const;
+ // Size of the reply message.
+
+private:
+ int verbose_;
+ // Are we running in verbose mode?
+
+ u_short port_;
+ // Port number we listen at.
+
+ size_t reply_message_len_;
+ // Size of the reply message.
+};
+
+#endif /* __CPP_INSERVER_FANCY_H */