blob: 1fd71fde574ad30b01e90a70ca5c72ce00c9bc5f (
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
|
/* -*- C++ -*- */
#ifndef _OPTIONS
#define _OPTIONS
#include "ace/os_include/os_stddef.h"
#include "ace/os_include/os_limits.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
class Options
// = TITLE
// Options Singleton.
{
public:
static Options *instance ();
// Return Singleton.
void parse_args (int argc, ACE_TCHAR *argv[]);
// Parse the arguments.
// = Accessor methods.
const char *program_name ();
const char *slave_name ();
int debug ();
int exec_slave ();
size_t iteration_count ();
int use_sbrk ();
int use_shmem ();
size_t max_msg_size ();
size_t spawn_count ();
int spawn_threads ();
int use_mmap ();
int child ();
private:
Options ();
// Ensure Singleton.
static Options *instance_;
// Singleton.
void print_usage_and_die ();
// Explain usage and exit.
char program_name_[MAXPATHLEN];
// Name of the program.
char slave_name_[MAXPATHLEN];
// Name of slave process.
int debug_;
// Flag to indicate if we are debugging.
int exec_slave_;
// Flag to indicate if we should exec after forking.
size_t iteration_count_;
// Number of iterations to call malloc_recurse().
int use_sbrk_;
// Should we use sbrk(2)?
int use_shmem_;
// Should we use Shared Memory?
size_t max_msg_size_;
// Maximum number of bytes to malloc.
size_t spawn_count_;
// Number of threads.
int spawn_threads_;
// Spawn threads vs. processes.
int use_mmap_;
// Use mmap() as the backing store.
int child_;
// We're a child process.
};
#endif /* _OPTIONS */
|