Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / protocols / ace / HTBP / HTBP_Environment.h
blob37e0ccd99105194939f16c56fe30af89d2dc6d01
1 // -*- C++ -*-
2 #ifndef ACE_HTBP_ENVIRONMENT_H
3 #define ACE_HTBP_ENVIRONMENT_H
4 #include /**/ "ace/pre.h"
6 #include "HTBP_Export.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #include "ace/Configuration.h"
13 #include "ace/Configuration_Import_Export.h"
14 #include "ace/Singleton.h"
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
18 namespace ACE
20 namespace HTBP
22 /**
23 * @class Environment
25 * @brief
27 * This class manages the storage of configuration data, either in a
28 * flat file for Unix systems, or in the Windows registry
30 class HTBP_Export Environment
32 public:
33 /// Constructor
34 Environment (ACE_Configuration *config = 0,
35 int using_registry = 0,
36 const ACE_TCHAR *persistent_file = 0);
38 /// Destructor
39 ~Environment ();
41 /// removes all htbp related values from the configuration
42 void clear ();
44 /// Accessors to HTID URL
45 /// Returns 0 on success
46 /// {@
47 int get_htid_url (ACE_TString &htid_url) const;
48 int set_htid_url (const ACE_TCHAR *htid_generator_url);
49 /// @}
51 /// Accessors to HTID via proxy - If value is true, HTID request goes
52 /// through configured proxy otherwise it uses a direct connection.
53 /// Returns 0 on success
54 /// {@
55 int get_htid_via_proxy (int &htid_via_proxy) const;
56 int set_htid_via_proxy (int htid_via_proxy);
57 /// @}
59 /// Accessors to Proxy Address
60 /// Returns 0 on success
61 /// {@
62 int get_proxy_host (ACE_TString &proxy_host) const;
63 int set_proxy_host (const ACE_TCHAR *proxy_host);
64 /// @}
66 /// Returns 0 on success
67 /// {@
68 int get_proxy_port (unsigned int &proxy_port) const;
69 int set_proxy_port (unsigned int proxy_port);
70 /// @}
72 /// Import the configuration from the filename
73 int import_config (const ACE_TCHAR *filename);
75 /// Export the configuration to the filename
76 int export_config (const ACE_TCHAR *filename);
78 private:
79 /// Open config, set sections etc
80 int initialize (int use_registry,
81 const ACE_TCHAR *persistent_file);
83 /// Open an ACE_Configuration of the appropriate type.
84 int open_registry_config ();
85 int open_persistent_config (const ACE_TCHAR *persistent_file);
87 /// Our Proxy and HTID generator URL database
88 ACE_Configuration *config_;
90 /// Flat section of HTBP related items
91 ACE_Configuration_Section_Key htbp_key_;
93 /// the wrapper used to import or export initialization values
94 ACE_Ini_ImpExp *imp_exp_;
96 /// We created the config instance, so we must clean it up
97 bool own_config_;
102 ACE_END_VERSIONED_NAMESPACE_DECL
104 #include /**/ "ace/post.h"
105 #endif /* ACE_HTBP_ENVIRONMENT_H */