Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / Shared_Malloc / Options.h
blob1fd71fde574ad30b01e90a70ca5c72ce00c9bc5f
1 /* -*- C++ -*- */
2 #ifndef _OPTIONS
3 #define _OPTIONS
5 #include "ace/os_include/os_stddef.h"
6 #include "ace/os_include/os_limits.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 class Options
13 // = TITLE
14 // Options Singleton.
16 public:
17 static Options *instance ();
18 // Return Singleton.
20 void parse_args (int argc, ACE_TCHAR *argv[]);
21 // Parse the arguments.
23 // = Accessor methods.
24 const char *program_name ();
25 const char *slave_name ();
26 int debug ();
27 int exec_slave ();
28 size_t iteration_count ();
29 int use_sbrk ();
30 int use_shmem ();
31 size_t max_msg_size ();
32 size_t spawn_count ();
33 int spawn_threads ();
34 int use_mmap ();
35 int child ();
37 private:
38 Options ();
39 // Ensure Singleton.
41 static Options *instance_;
42 // Singleton.
44 void print_usage_and_die ();
45 // Explain usage and exit.
47 char program_name_[MAXPATHLEN];
48 // Name of the program.
50 char slave_name_[MAXPATHLEN];
51 // Name of slave process.
53 int debug_;
54 // Flag to indicate if we are debugging.
56 int exec_slave_;
57 // Flag to indicate if we should exec after forking.
59 size_t iteration_count_;
60 // Number of iterations to call malloc_recurse().
62 int use_sbrk_;
63 // Should we use sbrk(2)?
65 int use_shmem_;
66 // Should we use Shared Memory?
68 size_t max_msg_size_;
69 // Maximum number of bytes to malloc.
71 size_t spawn_count_;
72 // Number of threads.
74 int spawn_threads_;
75 // Spawn threads vs. processes.
77 int use_mmap_;
78 // Use mmap() as the backing store.
80 int child_;
81 // We're a child process.
84 #endif /* _OPTIONS */