gfactory
Loading...
Searching...
No Matches
Tesla Class Reference

Example dynamically-loadable Car implementation. More...

#include <TeslaFactory.h>

Public Member Functions

 Tesla (const std::shared_ptr< GOptions > &gopts)
 Construct and initialize the Tesla plugin.
 
void go ()
 Example behavior for the Tesla plugin.
 
 Car (const std::shared_ptr< GOptions > &g)
 Inherit the base (const std::shared_ptr<GOptions>&) constructor.
 
- Public Member Functions inherited from Car
 ~Car () override=default
 Virtual destructor for polymorphic deletion.
 
 Car (const std::shared_ptr< GOptions > &g)
 Construct the base with a shared options/configuration instance.
 
void set_loggers (const std::shared_ptr< GOptions > &g)
 Wire loggers into the object.
 
- Public Member Functions inherited from GBase< Car >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Data Fields

double autopilot [2][2]
 Example Tesla-specific state.
 
- Data Fields inherited from Car
double generalCarVar = 44
 Example data member shared by all derived cars.
 

Additional Inherited Members

- Static Public Member Functions inherited from Car
static Carinstantiate (const dlhandle h, std::shared_ptr< GOptions > g)
 Resolve the plugin factory symbol and instantiate a derived Car.
 
- Protected Attributes inherited from GBase< Car >
std::shared_ptr< GLoggerlog
 

Detailed Description

This plugin demonstrates:

  • a derived class with additional state (autopilot),
  • construction via a shared configuration object, and
  • creation through the exported CarFactory symbol.

Definition at line 14 of file TeslaFactory.h.

Constructor & Destructor Documentation

◆ Tesla()

Tesla::Tesla ( const std::shared_ptr< GOptions > & gopts)
Parameters
goptsOptions/configuration shared with the application.

Definition at line 21 of file TeslaFactory.cc.

Member Function Documentation

◆ Car()

Car::Car ( const std::shared_ptr< GOptions > & g)
inlineexplicit

Definition at line 32 of file Car.h.

◆ go()

void Tesla::go ( )
virtual

Prints internal autopilot state and base-class state to demonstrate correctness.

Implements Car.

Definition at line 8 of file TeslaFactory.cc.

Field Documentation

◆ autopilot

double Tesla::autopilot[2][2]

Filled by the constructor and printed in go().

Definition at line 39 of file TeslaFactory.h.


The documentation for this class was generated from the following files: