Example base class used to demonstrate static factory registration.
More...
#include <ShapeFactory.h>
|
| | ~Shape () override=default |
| | Virtual destructor for polymorphic deletion.
|
| | Shape (const std::shared_ptr< GOptions > &g) |
| | Construct the base with a shared options/configuration instance.
|
| virtual void | Area ()=0 |
| | Compute or report the shape area (example API).
|
| | GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
In the example program, concrete shapes are registered directly with GManager because the application has compile-time access to both base and derived types.
Definition at line 16 of file ShapeFactory.h.
◆ ~Shape()
◆ Shape()
| Shape::Shape |
( |
const std::shared_ptr< GOptions > & | g | ) |
|
|
inlineexplicit |
- Parameters
-
| g | Shared options object used to initialize logging via GBase. |
Definition at line 27 of file ShapeFactory.h.
◆ Area()
| virtual void Shape::Area |
( |
| ) |
|
|
pure virtual |
The example implementations print to stdout.
Implemented in Box, and Triangle.
The documentation for this class was generated from the following file: