summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/IFRService/Options.h
blob: 809326348af6547cd13edd1c45dd594e24d81809 (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
89
90
91
92
93
94
// -*- C++ -*-


//=============================================================================
/**
 *  @file    Options.h
 *
 *  $Id$
 *
 *  This class implements the Options container for the Interface
 *  Repository.
 *
 *
 *  @author Jeff Parsons
 */
//=============================================================================


#ifndef OPTIONS_H
#define OPTIONS_H

#include "ace/Singleton.h"
#include "ace/Null_Mutex.h"
#include "orbsvcs/IFRService/ifr_service_export.h"
#include "tao/Versioned_Namespace.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class Options
 *
 * @brief Maintains the global options.
 *
 * This class is converted into a Singleton by the
 * <ACE_Singleton> template.
 */
class TAO_IFRService_Export Options
{
public:
  /// Default Constructor
  Options ();

  /// dtor
  ~Options();

  /// Parse the command-line arguments and initialize the options.
  int parse_args (int argc,
                  ACE_TCHAR *argv[]);

  /// Return the file where the IOR of the server object is stored.
  const char *ior_output_file (void) const;

  /// Is the Interface Repository persistent?
  int persistent (void) const;

  /// Return the default filename for persistent IFR.
  const char *persistent_file (void) const;

  /// Are we using a WIN32 registry as the backing store?
  int using_registry (void) const;

  /// Should the repository have a real mutex or a null mutex?
  int enable_locking (void) const;

  /// should the service support discovery via multicast?
  int support_multicast_discovery (void) const;

private:
  /// File where the IOR of the server object is stored.
  char *ior_output_file_;

  /// Is the Interface Repository persistent?
  int persistent_;

  /// Default filename for persistent IFR.
  char *persistent_file_;

  /// Are we using a WIN32 registry as the backing store?
  int using_registry_;

  /// Should the repository have a real mutex or a null mutex?
  int enable_locking_;

  /// If not zero multicast is enabled.
  int support_multicast_;
};

// Typedef an Options Singleton.
typedef ACE_Singleton <Options, ACE_Null_Mutex> OPTIONS;

TAO_END_VERSIONED_NAMESPACE_DECL

#endif /* OPTIONS_H */