26 #ifndef CLOE_SIMULATOR_HPP_ 27 #define CLOE_SIMULATOR_HPP_ 31 #include <type_traits> 50 #define DEFINE_SIMULATOR_FACTORY(xFactoryType, xConfigType, xName, xDescription) \ 51 class xFactoryType : public ::cloe::SimulatorFactory { \ 53 xFactoryType() : ::cloe::SimulatorFactory(xName, xDescription) {} \ 54 std::unique_ptr<::cloe::SimulatorFactory> clone() const override { \ 55 return std::make_unique<std::decay<decltype(*this)>::type>(*this); \ 57 std::unique_ptr<::cloe::Simulator> make(const ::cloe::Conf&) const override; \ 60 ::cloe::Schema schema_impl() override { return config_.schema(); } \ 63 xConfigType config_; \ 74 #define DEFINE_SIMULATOR_FACTORY_MAKE(xFactoryType, xSimulatorType) \ 75 std::unique_ptr<::cloe::Simulator> xFactoryType::make(const ::cloe::Conf& c) const { \ 76 decltype(config_) conf{config_}; \ 77 if (!c->is_null()) { \ 80 return std::make_unique<xSimulatorType>(this->name(), conf); \ 168 virtual std::shared_ptr<Vehicle>
get_vehicle(
size_t i)
const = 0;
176 virtual std::shared_ptr<Vehicle>
get_vehicle(
const std::string& key)
const = 0;
203 static constexpr
char const* PLUGIN_TYPE =
"simulator";
204 static constexpr
char const* PLUGIN_API_VERSION =
"2.0";
209 using ModelFactory::ModelFactory;
224 virtual std::unique_ptr<SimulatorFactory> clone()
const = 0;
232 virtual std::unique_ptr<Simulator> make(
const Conf& c)
const = 0;
237 #endif // CLOE_SIMULATOR_HPP_
Definition: simulator.hpp:141
virtual size_t num_vehicles() const =0
Definition: simulator.hpp:201
virtual std::shared_ptr< Vehicle > get_vehicle(size_t i) const =0
Definition: coordinator.hpp:36
std::chrono::nanoseconds Duration
Definition: duration.hpp:45
Definition: model.hpp:414
Definition: model.hpp:214
Duration process(const Sync &) override=0