|
33 | 33 | #pragma warning(disable: 4251)
|
34 | 34 | #endif
|
35 | 35 |
|
36 |
| -namespace gz |
| 36 | +namespace gz::fuel_tools |
37 | 37 | {
|
38 |
| - namespace fuel_tools |
| 38 | + /// \brief forward declaration |
| 39 | + class ServerConfigPrivate; |
| 40 | + |
| 41 | + /// \brief Forward Declaration |
| 42 | + class ClientConfigPrivate; |
| 43 | + |
| 44 | + /// \brief Describes options needed for a server. |
| 45 | + class GZ_FUEL_TOOLS_VISIBLE ServerConfig |
39 | 46 | {
|
40 |
| - /// \brief forward declaration |
41 |
| - class ServerConfigPrivate; |
42 |
| - |
43 |
| - /// \brief Forward Declaration |
44 |
| - class ClientConfigPrivate; |
45 |
| - |
46 |
| - /// \brief Describes options needed for a server. |
47 |
| - class GZ_FUEL_TOOLS_VISIBLE ServerConfig |
48 |
| - { |
49 |
| - /// \brief Constructor. |
50 |
| - public: ServerConfig(); |
51 |
| - |
52 |
| - /// \brief Copy constructor. |
53 |
| - /// \param[in] _orig The server config to copy. |
54 |
| - public: ServerConfig(const ServerConfig &_orig); |
55 |
| - |
56 |
| - /// \brief Assignment operator overload. |
57 |
| - /// \param[in] _orig The server config to copy. |
58 |
| - public: ServerConfig &operator=(const ServerConfig &_orig); |
59 |
| - |
60 |
| - /// \brief Destructor. |
61 |
| - public: ~ServerConfig(); |
62 |
| - |
63 |
| - /// \brief Clear the server config. This will set all values to empty |
64 |
| - /// strings, except the version string which will be set to its default |
65 |
| - /// value. |
66 |
| - public: void Clear(); |
67 |
| - |
68 |
| - /// \brief Get the URL to access the server. |
69 |
| - /// \return The URL of this server. |
70 |
| - public: common::URI Url() const; |
71 |
| - |
72 |
| - /// \brief Set the URL of this server. |
73 |
| - /// \param[in] _url URL of this server. |
74 |
| - public: void SetUrl(const common::URI &_url); |
75 |
| - |
76 |
| - /// \brief Get the API key to auth with the server. |
77 |
| - /// \return The API key. |
78 |
| - public: std::string ApiKey() const; |
79 |
| - |
80 |
| - /// \brief Set the API key to auth with the server. |
81 |
| - /// \param[in] _key The API key. |
82 |
| - public: void SetApiKey(const std::string &_key); |
83 |
| - |
84 |
| - /// \brief Get the protocol version used with this server. |
85 |
| - /// \return The version. E.g.: "1.0". |
86 |
| - public: std::string Version() const; |
87 |
| - |
88 |
| - /// \brief Set the protocol version used with this server. |
89 |
| - /// \param[in] _version The version. E.g.: "1.0". |
90 |
| - public: void SetVersion(const std::string &_version); |
91 |
| - |
92 |
| - /// \brief Returns all the server information as a string. |
93 |
| - /// \param[in] _prefix Optional prefix for every line of the string. |
94 |
| - /// \return Server information string |
95 |
| - public: std::string AsString(const std::string &_prefix = "") const; |
96 |
| - |
97 |
| - /// \brief Returns all the available model information as a string using |
98 |
| - /// colors for better human parsing. |
99 |
| - /// \param[in] _prefix Optional prefix for every line of the string. |
100 |
| - /// \return Model information string |
101 |
| - public: std::string AsPrettyString(const std::string &_prefix = "") const; |
102 |
| - |
103 |
| - /// \brief PIMPL |
104 |
| - private: std::unique_ptr<ServerConfigPrivate> dataPtr; |
105 |
| - }; |
106 |
| - |
107 |
| - /// \brief High level interface to Gazebo Fuel. |
108 |
| - /// |
109 |
| - class GZ_FUEL_TOOLS_VISIBLE ClientConfig |
110 |
| - { |
111 |
| - /// \brief Constructor. |
112 |
| - public: ClientConfig(); |
113 |
| - |
114 |
| - /// \brief Copy constructor. |
115 |
| - /// \param[in] _copy ClientConfig to copy. |
116 |
| - public: ClientConfig(const ClientConfig &_copy); |
117 |
| - |
118 |
| - /// \brief Assignment operator overload. |
119 |
| - /// \param[in] _copy ClientConfig to copy. |
120 |
| - public: ClientConfig &operator=(const ClientConfig &_copy); |
121 |
| - |
122 |
| - /// \brief Destructor. |
123 |
| - public: ~ClientConfig(); |
124 |
| - |
125 |
| - /// \brief Clear the client config. This will set all values to empty |
126 |
| - /// strings, except the user agent which will be set to its default |
127 |
| - /// value. |
128 |
| - public: void Clear(); |
129 |
| - |
130 |
| - /// \brief Set the user agent name. |
131 |
| - /// \param[in] _agent User agent name. |
132 |
| - public: void SetUserAgent(const std::string &_agent); |
133 |
| - |
134 |
| - /// \brief Get the user agent name. |
135 |
| - /// \return Name of the user agent. |
136 |
| - public: const std::string &UserAgent() const; |
137 |
| - |
138 |
| - /// \brief Load a YAML configuration file. |
139 |
| - /// \param[in] _file Config file to load. |
140 |
| - /// \return True if the configuration was loaded correctly. |
141 |
| - /// \sa ConfigPath |
142 |
| - public: bool LoadConfig(const std::string &_file); |
143 |
| - |
144 |
| - /// \brief Get the location of the configuration file. |
145 |
| - /// \return Path to the configuration file, which is set via |
146 |
| - /// LoadConfig. The default return value is an empty string. |
147 |
| - /// \sa LoadConfig |
148 |
| - public: std::string ConfigPath() const; |
149 |
| - |
150 |
| - /// \brief List of servers the client will connect to. |
151 |
| - /// \return The list of servers. |
152 |
| - public: std::vector<ServerConfig> Servers() const; |
153 |
| - |
154 |
| - /// \brief List of servers the client will connect to. |
155 |
| - /// \return The list of servers. |
156 |
| - public: std::vector<ServerConfig> & MutableServers() const; |
157 |
| - |
158 |
| - /// \brief Add a server to the list. |
159 |
| - /// \param[in] _srv The server config. |
160 |
| - public: void AddServer(const ServerConfig &_srv); |
161 |
| - |
162 |
| - /// \brief Where are models and stuff stored locally? |
163 |
| - /// \return The location where assets are stored locally. |
164 |
| - public: std::string CacheLocation() const; |
165 |
| - |
166 |
| - /// \brief Set where models and stuff are saved. |
167 |
| - /// \param[in] _path path on disk where models are saved. |
168 |
| - public: void SetCacheLocation(const std::string &_path); |
169 |
| - |
170 |
| - /// \brief Returns all the client information as a string. |
171 |
| - /// \param[in] _prefix Optional prefix for every line of the string. |
172 |
| - /// \return Client information string |
173 |
| - public: std::string AsString(const std::string &_prefix = "") const; |
174 |
| - |
175 |
| - /// \brief PIMPL |
176 |
| - private: std::unique_ptr<ClientConfigPrivate> dataPtr; |
177 |
| - }; |
178 |
| - } |
179 |
| -} |
| 47 | + /// \brief Constructor. |
| 48 | + public: ServerConfig(); |
| 49 | + |
| 50 | + /// \brief Copy constructor. |
| 51 | + /// \param[in] _orig The server config to copy. |
| 52 | + public: ServerConfig(const ServerConfig &_orig); |
| 53 | + |
| 54 | + /// \brief Assignment operator overload. |
| 55 | + /// \param[in] _orig The server config to copy. |
| 56 | + public: ServerConfig &operator=(const ServerConfig &_orig); |
| 57 | + |
| 58 | + /// \brief Destructor. |
| 59 | + public: ~ServerConfig(); |
| 60 | + |
| 61 | + /// \brief Clear the server config. This will set all values to empty |
| 62 | + /// strings, except the version string which will be set to its default |
| 63 | + /// value. |
| 64 | + public: void Clear(); |
| 65 | + |
| 66 | + /// \brief Get the URL to access the server. |
| 67 | + /// \return The URL of this server. |
| 68 | + public: common::URI Url() const; |
| 69 | + |
| 70 | + /// \brief Set the URL of this server. |
| 71 | + /// \param[in] _url URL of this server. |
| 72 | + public: void SetUrl(const common::URI &_url); |
| 73 | + |
| 74 | + /// \brief Get the API key to auth with the server. |
| 75 | + /// \return The API key. |
| 76 | + public: std::string ApiKey() const; |
| 77 | + |
| 78 | + /// \brief Set the API key to auth with the server. |
| 79 | + /// \param[in] _key The API key. |
| 80 | + public: void SetApiKey(const std::string &_key); |
| 81 | + |
| 82 | + /// \brief Get the protocol version used with this server. |
| 83 | + /// \return The version. E.g.: "1.0". |
| 84 | + public: std::string Version() const; |
| 85 | + |
| 86 | + /// \brief Set the protocol version used with this server. |
| 87 | + /// \param[in] _version The version. E.g.: "1.0". |
| 88 | + public: void SetVersion(const std::string &_version); |
| 89 | + |
| 90 | + /// \brief Returns all the server information as a string. |
| 91 | + /// \param[in] _prefix Optional prefix for every line of the string. |
| 92 | + /// \return Server information string |
| 93 | + public: std::string AsString(const std::string &_prefix = "") const; |
| 94 | + |
| 95 | + /// \brief Returns all the available model information as a string using |
| 96 | + /// colors for better human parsing. |
| 97 | + /// \param[in] _prefix Optional prefix for every line of the string. |
| 98 | + /// \return Model information string |
| 99 | + public: std::string AsPrettyString(const std::string &_prefix = "") const; |
| 100 | + |
| 101 | + /// \brief PIMPL |
| 102 | + private: std::unique_ptr<ServerConfigPrivate> dataPtr; |
| 103 | + }; |
| 104 | + |
| 105 | + /// \brief High level interface to Gazebo Fuel. |
| 106 | + /// |
| 107 | + class GZ_FUEL_TOOLS_VISIBLE ClientConfig |
| 108 | + { |
| 109 | + /// \brief Constructor. |
| 110 | + public: ClientConfig(); |
| 111 | + |
| 112 | + /// \brief Copy constructor. |
| 113 | + /// \param[in] _copy ClientConfig to copy. |
| 114 | + public: ClientConfig(const ClientConfig &_copy); |
| 115 | + |
| 116 | + /// \brief Assignment operator overload. |
| 117 | + /// \param[in] _copy ClientConfig to copy. |
| 118 | + public: ClientConfig &operator=(const ClientConfig &_copy); |
| 119 | + |
| 120 | + /// \brief Destructor. |
| 121 | + public: ~ClientConfig(); |
| 122 | + |
| 123 | + /// \brief Clear the client config. This will set all values to empty |
| 124 | + /// strings, except the user agent which will be set to its default |
| 125 | + /// value. |
| 126 | + public: void Clear(); |
| 127 | + |
| 128 | + /// \brief Set the user agent name. |
| 129 | + /// \param[in] _agent User agent name. |
| 130 | + public: void SetUserAgent(const std::string &_agent); |
| 131 | + |
| 132 | + /// \brief Get the user agent name. |
| 133 | + /// \return Name of the user agent. |
| 134 | + public: const std::string &UserAgent() const; |
| 135 | + |
| 136 | + /// \brief Load a YAML configuration file. |
| 137 | + /// \param[in] _file Config file to load. |
| 138 | + /// \return True if the configuration was loaded correctly. |
| 139 | + /// \sa ConfigPath |
| 140 | + public: bool LoadConfig(const std::string &_file); |
| 141 | + |
| 142 | + /// \brief Get the location of the configuration file. |
| 143 | + /// \return Path to the configuration file, which is set via |
| 144 | + /// LoadConfig. The default return value is an empty string. |
| 145 | + /// \sa LoadConfig |
| 146 | + public: std::string ConfigPath() const; |
| 147 | + |
| 148 | + /// \brief List of servers the client will connect to. |
| 149 | + /// \return The list of servers. |
| 150 | + public: std::vector<ServerConfig> Servers() const; |
| 151 | + |
| 152 | + /// \brief List of servers the client will connect to. |
| 153 | + /// \return The list of servers. |
| 154 | + public: std::vector<ServerConfig> & MutableServers() const; |
| 155 | + |
| 156 | + /// \brief Add a server to the list. |
| 157 | + /// \param[in] _srv The server config. |
| 158 | + public: void AddServer(const ServerConfig &_srv); |
| 159 | + |
| 160 | + /// \brief Where are models and stuff stored locally? |
| 161 | + /// \return The location where assets are stored locally. |
| 162 | + public: std::string CacheLocation() const; |
| 163 | + |
| 164 | + /// \brief Set where models and stuff are saved. |
| 165 | + /// \param[in] _path path on disk where models are saved. |
| 166 | + public: void SetCacheLocation(const std::string &_path); |
| 167 | + |
| 168 | + /// \brief Returns all the client information as a string. |
| 169 | + /// \param[in] _prefix Optional prefix for every line of the string. |
| 170 | + /// \return Client information string |
| 171 | + public: std::string AsString(const std::string &_prefix = "") const; |
| 172 | + |
| 173 | + /// \brief PIMPL |
| 174 | + private: std::unique_ptr<ClientConfigPrivate> dataPtr; |
| 175 | + }; |
| 176 | +} // namespace gz::fuel_tools |
180 | 177 |
|
181 | 178 | #ifdef _MSC_VER
|
182 | 179 | #pragma warning(pop)
|
183 | 180 | #endif
|
184 | 181 |
|
185 |
| -#endif |
| 182 | +#endif // GZ_FUEL_TOOLS_CLIENTCONFIG_HH_ |
0 commit comments