29 #include <type_traits>
48 #define DEFINE_SIMULATOR_FACTORY(xFactoryType, xConfigType, xName, xDescription) \
49 class xFactoryType : public ::cloe::SimulatorFactory { \
51 xFactoryType() : ::cloe::SimulatorFactory(xName, xDescription) {} \
52 std::unique_ptr<::cloe::SimulatorFactory> clone() const override { \
53 return std::make_unique<std::decay<decltype(*this)>::type>(*this); \
55 std::unique_ptr<::cloe::Simulator> make(const ::fable::Conf&) const override; \
58 ::cloe::Schema schema_impl() override { return config_.schema(); } \
61 xConfigType config_; \
72 #define DEFINE_SIMULATOR_FACTORY_MAKE(xFactoryType, xSimulatorType) \
73 std::unique_ptr<::cloe::Simulator> xFactoryType::make(const ::fable::Conf& c) const { \
74 decltype(config_) conf{config_}; \
75 if (!c->is_null()) { \
78 return std::make_unique<xSimulatorType>(this->name(), conf); \
174 virtual std::shared_ptr<Vehicle>
get_vehicle(
const std::string& key)
const = 0;
201 static constexpr
char const* PLUGIN_TYPE =
"simulator";
202 static constexpr
char const* PLUGIN_API_VERSION =
"2.0";
207 using ModelFactory::ModelFactory;
222 virtual std::unique_ptr<SimulatorFactory>
clone()
const = 0;
Definition: model.hpp:403
Definition: model.hpp:203
Definition: simulator.hpp:199
virtual std::unique_ptr< Simulator > make(const fable::Conf &c) const =0
virtual std::unique_ptr< SimulatorFactory > clone() const =0
Definition: simulator.hpp:139
virtual size_t num_vehicles() const =0
virtual std::shared_ptr< Vehicle > get_vehicle(size_t i) const =0
virtual std::shared_ptr< Vehicle > get_vehicle(const std::string &key) const =0
Duration process(const Sync &) override=0
std::chrono::nanoseconds Duration
Definition: cloe_fwd.hpp:36