OpenDDS  Snapshot(2023/04/28-20:55)
FederatorConfig.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef FEDERATORCONFIG_H
9 #define FEDERATORCONFIG_H
10 
11 #if !defined (ACE_LACKS_PRAGMA_ONCE)
12 #pragma once
13 #endif /* ACE_LACKS_PRAGMA_ONCE */
14 
15 #include "federator_export.h"
16 #include "FederationId.h"
17 #include "FederatorC.h"
18 
19 #include <string>
20 
22 
23 namespace OpenDDS {
24 namespace Federator {
25 
26 typedef std::basic_string<ACE_TCHAR> tstring;
27 
29 public:
30  /// Command line option specifying the configuration file.
31  static const tstring FEDERATOR_CONFIG_OPTION;
32 
33  /// Command line option specifying the federation Id value.
34  static const tstring FEDERATOR_ID_OPTION;
35 
36  /// Command line option specifying a repository to federate with.
37  static const tstring FEDERATE_WITH_OPTION;
38 
39  /// Default constructor.
40  Config(int argc, ACE_TCHAR** argv);
41 
42  virtual ~Config();
43 
44  /// Access the enhanced argv.
45  int& argc();
46  int argc() const;
47 
48  /// Access the enhanced argc.
49  ACE_TCHAR**& argv();
50  ACE_TCHAR** argv() const;
51 
52  /// Add an argument.
53  void addArg(ACE_TCHAR* arg);
54 
55  /// Federation Id value.
56  TAO_DDS_DCPSFederationId& federationId();
57  const TAO_DDS_DCPSFederationId& federationId() const;
58 
59  /// Federation Id value.
60  void federationDomain(long domain);
61  long federationDomain() const;
62 
63  /// Federation Port value.
64  void federationPort(short port);
65  short federationPort() const;
66 
67  /// Initial federation IOR value.
68  void federateIor(const tstring& ior);
69  tstring federateIor() const;
70 
71  /// Configuration filename.
72  void configFile(const tstring& file);
73  tstring configFile() const;
74 
75 private:
76  /// Process a configuration file
77  void processFile();
78 
79  /// Enhanced argc.
80  int argc_;
81 
82  /// Enhanced argv.
84 
85  /// Configuration filename, if any.
86  tstring configFile_;
87 
88  /// Initial federation IOR, if any.
89  tstring federateIor_;
90 
91  /// Configured Federation Id value.
93 
94  /// Configured Federation Domain value.
96 
97  /// Configured Federation Port value.
99 };
100 
101 } // namespace Federator
102 } // namespace OpenDDS
103 
105 
106 #if defined (__ACE_INLINE__)
107 # include "FederatorConfig.inl"
108 #endif /* __ACE_INLINE__ */
109 
110 #endif /* FEDERATORCONFIG_H */
char ACE_TCHAR
static const tstring FEDERATOR_ID_OPTION
Command line option specifying the federation Id value.
tstring federateIor_
Initial federation IOR, if any.
tstring configFile_
Configuration filename, if any.
TAO_DDS_DCPSFederationId federationId_
Configured Federation Id value.
std::basic_string< ACE_TCHAR > tstring
static const tstring FEDERATOR_CONFIG_OPTION
Command line option specifying the configuration file.
int argc_
Enhanced argc.
long federationDomain_
Configured Federation Domain value.
#define OpenDDS_Federator_Export
ACE_TCHAR ** argv_
Enhanced argv.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
static const tstring FEDERATE_WITH_OPTION
Command line option specifying a repository to federate with.
short federationPort_
Configured Federation Port value.
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28