Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
|
The abstract factory class for creating objects in the Geometry family. More...
#include <geometry.h>
Public Types | |
typedef Geometry *(* | GeoCreateFunc )() |
Defines a function pointer pointing to a function which creates objects in the Geometry family. | |
Public Member Functions | |
void | registerGeometry (std::string name, GeoCreateFunc func) |
Registers (links) the geometry name name with the function func for creating objects in the Geometry family. More... | |
Static Public Member Functions | ||||
static GeometryFactory & | instance () | |||
Returns reference to a Singleton object of class GeometryFactory. More... | ||||
This function creates an object of the class linked to the
Example usage: GeometryFactory& factory = GeometryFactory::instance();
Geometry* newGeometry = factory.createGeometry(name);
| ||||
Geometry * | createGeometry (std::string name) | |||
The abstract factory class for creating objects in the Geometry family.
Created on: 2014/06/07
|
static |
Returns reference to a Singleton object of class GeometryFactory.
None |
Example usage:
void GeometryFactory::registerGeometry | ( | std::string | name, |
GeoCreateFunc | func | ||
) |
Registers (links) the geometry name name with the function func for creating objects in the Geometry family.
After registration, name can be used as an argument in the createGeometry member function for creating objects of the linked type in the Geometry family
[in] | name | the geometry name |
[in] | func | the function pointer pointing to the function that creates objects of a specific type in the Geometry family |