gfactory
Loading...
Searching...
No Matches
FordFactory.h
Go to the documentation of this file.
1#pragma once
2
3#include "Car.h"
4
12class Ford : public Car
13{
14public:
16 using Car::Car;
17
23 Ford(const std::shared_ptr<GOptions>& gopts);
24
30 void go();
31
37 double fordVar[2]{};
38};
39
48extern "C" Car* CarFactory(const std::shared_ptr<GOptions>& g) {
49 return static_cast<Car*>(new Ford(g));
50}
Car * CarFactory(const std::shared_ptr< GOptions > &g)
Exported factory function for dynamic loading.
Definition FordFactory.h:48
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.
Definition FordFactory.h:13
double fordVar[2]
Example plugin-specific state.
Definition FordFactory.h:37
void go()
Example behavior for the Ford plugin.
Definition FordFactory.cc:8
Ford(const std::shared_ptr< GOptions > &gopts)
Construct and initialize example state.