gfactory
Loading...
Searching...
No Matches
TeslaFactory.h
Go to the documentation of this file.
1#pragma once
2
3#include "Car.h"
4
14class Tesla : public Car
15{
16public:
18 using Car::Car;
19
25 Tesla(const std::shared_ptr<GOptions>& gopts);
26
32 void go();
33
39 double autopilot[2][2];
40};
41
50extern "C" Car* CarFactory(const std::shared_ptr<GOptions>& g) { return static_cast<Car*>(new Tesla(g)); }
Car * CarFactory(const std::shared_ptr< GOptions > &g)
Exported factory function for dynamic loading.
Example base class used to demonstrate dynamic factory loading.
Definition Car.h:22
Car(const std::shared_ptr< GOptions > &g)
Construct the base with a shared options/configuration instance.
Definition Car.h:32
Example dynamically-loadable Car implementation.
Tesla(const std::shared_ptr< GOptions > &gopts)
Construct and initialize the Tesla plugin.
void go()
Example behavior for the Tesla plugin.
double autopilot[2][2]
Example Tesla-specific state.