FederatorConfig.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef FEDERATORCONFIG_H
00009 #define FEDERATORCONFIG_H
00010 
00011 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00012 #pragma once
00013 #endif /* ACE_LACKS_PRAGMA_ONCE */
00014 
00015 #include "federator_export.h"
00016 #include "FederationId.h"
00017 #include "FederatorC.h"
00018 
00019 #include <string>
00020 
00021 namespace OpenDDS {
00022 namespace Federator {
00023 
00024 typedef std::basic_string<ACE_TCHAR> tstring;
00025 
00026 class OpenDDS_Federator_Export Config  {
00027 public:
00028   /// Command line option specifying the configuration file.
00029   static const tstring FEDERATOR_CONFIG_OPTION;
00030 
00031   /// Command line option specifying the federation Id value.
00032   static const tstring FEDERATOR_ID_OPTION;
00033 
00034   /// Command line option specifying a repository to federate with.
00035   static const tstring FEDERATE_WITH_OPTION;
00036 
00037   /// Default constructor.
00038   Config(int argc, ACE_TCHAR** argv);
00039 
00040   /// Virtual destructor.
00041   virtual ~Config();
00042 
00043   /// Access the enhanced argv.
00044   int& argc();
00045   int  argc() const;
00046 
00047   /// Access the enhanced argc.
00048   ACE_TCHAR**& argv();
00049   ACE_TCHAR**  argv() const;
00050 
00051   /// Add an argument.
00052   void addArg(ACE_TCHAR* arg);
00053 
00054   /// Federation Id value.
00055   TAO_DDS_DCPSFederationId& federationId();
00056   const TAO_DDS_DCPSFederationId& federationId() const;
00057 
00058   /// Federation Id value.
00059   void federationDomain(long domain);
00060   long  federationDomain() const;
00061 
00062   /// Federation Port value.
00063   void federationPort(short port);
00064   short  federationPort() const;
00065 
00066   /// Initial federation IOR value.
00067   void federateIor(const tstring& ior);
00068   tstring  federateIor() const;
00069 
00070   /// Configuration filename.
00071   void configFile(const tstring& file);
00072   tstring  configFile() const;
00073 
00074 private:
00075   /// Process a configuration file
00076   void processFile();
00077 
00078   /// Enhanced argc.
00079   int argc_;
00080 
00081   /// Enhanced argv.
00082   ACE_TCHAR** argv_;
00083 
00084   /// Configuration filename, if any.
00085   tstring configFile_;
00086 
00087   /// Initial federation IOR, if any.
00088   tstring federateIor_;
00089 
00090   /// Configured Federation Id value.
00091   TAO_DDS_DCPSFederationId federationId_;
00092 
00093   /// Configured Federation Domain value.
00094   long federationDomain_;
00095 
00096   /// Configured Federation Port value.
00097   short federationPort_;
00098 };
00099 
00100 } // namespace Federator
00101 } // namespace OpenDDS
00102 
00103 #if defined (__ACE_INLINE__)
00104 # include "FederatorConfig.inl"
00105 #endif  /* __ACE_INLINE__ */
00106 
00107 #endif /* FEDERATORCONFIG_H */

Generated on Fri Feb 12 20:05:23 2016 for OpenDDS by  doxygen 1.4.7