|
29 | 29 | #include <string> // for string
|
30 | 30 | #include <utility> // for move
|
31 | 31 | #include <vector> // for vector<>
|
| 32 | +#include <optional> // for optional<> |
32 | 33 |
|
33 | 34 | #include <boost/filesystem/path.hpp> // for path
|
34 |
| -#include <boost/optional.hpp> // for optional<> |
35 | 35 | #include <fable/schema/boost_optional.hpp> // for Optional<>
|
36 | 36 | #include <fable/schema/boost_path.hpp> // for Path
|
37 | 37 | #include <fable/schema/custom.hpp> // for CustomDeserializer
|
@@ -140,8 +140,8 @@ using IncludesSchema = schema::Vector<IncludeConf, IncludeSchema>;
|
140 | 140 | */
|
141 | 141 | struct LoggingConf : public Confable {
|
142 | 142 | std::string name;
|
143 |
| - boost::optional<std::string> pattern; |
144 |
| - boost::optional<LogLevel> level; |
| 143 | + std::optional<std::string> pattern; |
| 144 | + std::optional<LogLevel> level; |
145 | 145 |
|
146 | 146 | public: // Special
|
147 | 147 | void apply() const;
|
@@ -205,28 +205,28 @@ struct PluginConf : public PersistentConfable {
|
205 | 205 | boost::filesystem::path plugin_path{};
|
206 | 206 |
|
207 | 207 | /** Name to give plugin if path is to a single file. */
|
208 |
| - boost::optional<std::string> plugin_name{}; |
| 208 | + std::optional<std::string> plugin_name{}; |
209 | 209 |
|
210 | 210 | /** Prefix for plugin name(s). */
|
211 |
| - boost::optional<std::string> plugin_prefix{}; |
| 211 | + std::optional<std::string> plugin_prefix{}; |
212 | 212 |
|
213 | 213 | /** Do not fail if path does not exist. */
|
214 |
| - boost::optional<bool> ignore_missing{}; |
| 214 | + std::optional<bool> ignore_missing{}; |
215 | 215 |
|
216 | 216 | /**
|
217 | 217 | * Do not fail if path exists but plugin cannot be loaded.
|
218 | 218 | * This is especially useful if trying to load from several directories,
|
219 | 219 | * such as /usr/lib/cloe/plugins.
|
220 | 220 | */
|
221 |
| - boost::optional<bool> ignore_failure{}; |
| 221 | + std::optional<bool> ignore_failure{}; |
222 | 222 |
|
223 | 223 | /**
|
224 | 224 | * If a plugin with the same name exists, replace it with this one.
|
225 | 225 | *
|
226 | 226 | * This is dependent on the order of plugin loading, which is determined by
|
227 | 227 | * the order of configuration files.
|
228 | 228 | */
|
229 |
| - boost::optional<bool> allow_clobber{}; |
| 229 | + std::optional<bool> allow_clobber{}; |
230 | 230 |
|
231 | 231 | public: // Constructors
|
232 | 232 | PluginConf() = default;
|
@@ -309,14 +309,14 @@ struct EngineConf : public Confable {
|
309 | 309 | bool triggers_ignore_source{false};
|
310 | 310 |
|
311 | 311 | // Output:
|
312 |
| - boost::optional<boost::filesystem::path> registry_path{CLOE_DATA_HOME "/registry"}; |
313 |
| - boost::optional<boost::filesystem::path> output_path{"${CLOE_SIMULATION_UUID}"}; |
314 |
| - boost::optional<boost::filesystem::path> output_file_config{"config.json"}; |
315 |
| - boost::optional<boost::filesystem::path> output_file_result{"result.json"}; |
316 |
| - boost::optional<boost::filesystem::path> output_file_triggers{"triggers.json"}; |
317 |
| - boost::optional<boost::filesystem::path> output_file_signals{"signals.json"}; |
318 |
| - boost::optional<boost::filesystem::path> output_file_signals_autocompletion; |
319 |
| - boost::optional<boost::filesystem::path> output_file_data_stream; |
| 312 | + std::optional<boost::filesystem::path> registry_path{CLOE_DATA_HOME "/registry"}; |
| 313 | + std::optional<boost::filesystem::path> output_path{"${CLOE_SIMULATION_UUID}"}; |
| 314 | + std::optional<boost::filesystem::path> output_file_config{"config.json"}; |
| 315 | + std::optional<boost::filesystem::path> output_file_result{"result.json"}; |
| 316 | + std::optional<boost::filesystem::path> output_file_triggers{"triggers.json"}; |
| 317 | + std::optional<boost::filesystem::path> output_file_signals{"signals.json"}; |
| 318 | + std::optional<boost::filesystem::path> output_file_signals_autocompletion; |
| 319 | + std::optional<boost::filesystem::path> output_file_data_stream; |
320 | 320 | bool output_clobber_files{true};
|
321 | 321 |
|
322 | 322 | /**
|
@@ -371,7 +371,7 @@ struct EngineConf : public Confable {
|
371 | 371 | * The states with an asterisk are given defaults that are not affected by
|
372 | 372 | * the default timeout as these typically take longer due to I/O operations.
|
373 | 373 | */
|
374 |
| - std::map<std::string, boost::optional<std::chrono::milliseconds>> watchdog_state_timeouts{ |
| 374 | + std::map<std::string, std::optional<std::chrono::milliseconds>> watchdog_state_timeouts{ |
375 | 375 | {"CONNECT", std::chrono::milliseconds{300'000}},
|
376 | 376 | {"ABORT", std::chrono::milliseconds{90'000}},
|
377 | 377 | {"STOP", std::chrono::milliseconds{300'000}},
|
@@ -453,8 +453,8 @@ using EngineSchema = schema_type<EngineConf>::type;
|
453 | 453 | * good idea!
|
454 | 454 | */
|
455 | 455 | struct DefaultConf : public Confable {
|
456 |
| - boost::optional<std::string> name; |
457 |
| - boost::optional<std::string> binding; |
| 456 | + std::optional<std::string> name; |
| 457 | + std::optional<std::string> binding; |
458 | 458 | Conf args;
|
459 | 459 |
|
460 | 460 | public: // Confable Overrides
|
@@ -495,7 +495,7 @@ class FactoryPlugin : public fable::schema::FactoryPointerless<C> {
|
495 | 495 | */
|
496 | 496 | struct SimulatorConf : public Confable {
|
497 | 497 | const std::string binding;
|
498 |
| - boost::optional<std::string> name; |
| 498 | + std::optional<std::string> name; |
499 | 499 | std::shared_ptr<SimulatorFactory> factory;
|
500 | 500 | Conf args;
|
501 | 501 |
|
@@ -529,7 +529,7 @@ class SimulatorSchema : public FactoryPlugin<SimulatorConf, SimulatorFactory> {
|
529 | 529 | */
|
530 | 530 | struct ControllerConf : public Confable {
|
531 | 531 | const std::string binding;
|
532 |
| - boost::optional<std::string> name; |
| 532 | + std::optional<std::string> name; |
533 | 533 | std::string vehicle;
|
534 | 534 | std::shared_ptr<ControllerFactory> factory;
|
535 | 535 | Conf args;
|
@@ -615,7 +615,7 @@ struct FromSimulator : public Confable {
|
615 | 615 |
|
616 | 616 | struct ComponentConf : public Confable {
|
617 | 617 | const std::string binding;
|
618 |
| - boost::optional<std::string> name; |
| 618 | + std::optional<std::string> name; |
619 | 619 | std::vector<std::string> from;
|
620 | 620 | std::shared_ptr<ComponentFactory> factory;
|
621 | 621 | Conf args;
|
@@ -780,7 +780,7 @@ class VehicleSchema : public fable::schema::Base<VehicleSchema> {
|
780 | 780 | // --------------------------------------------------------------------------------------------- //
|
781 | 781 |
|
782 | 782 | struct TriggerConf : public PersistentConfable {
|
783 |
| - boost::optional<std::string> label{boost::none}; |
| 783 | + std::optional<std::string> label{}; |
784 | 784 | Source source{Source::FILESYSTEM};
|
785 | 785 | Conf action{};
|
786 | 786 | Conf event{};
|
@@ -823,7 +823,7 @@ struct SimulationConf : public Confable {
|
823 | 823 | /**
|
824 | 824 | * Optional namespace for simulation events and actions.
|
825 | 825 | */
|
826 |
| - boost::optional<std::string> name{boost::none}; |
| 826 | + std::optional<std::string> name{}; |
827 | 827 |
|
828 | 828 | /**
|
829 | 829 | * Nominal model time step.
|
@@ -887,7 +887,7 @@ using ConfReader = std::function<Conf(const std::string&)>;
|
887 | 887 | class Stack : public Confable {
|
888 | 888 | private: // Constants (1)
|
889 | 889 | std::vector<std::string> reserved_ids_;
|
890 |
| - boost::optional<std::string> schema_ref_; |
| 890 | + std::optional<std::string> schema_ref_; |
891 | 891 |
|
892 | 892 | public: // Configuration (13)
|
893 | 893 | std::string version;
|
|
0 commit comments