RandomSizeShapeFactory Class Reference
#include <shapefactory.h>
List of all members.
Detailed Description
A factory class to generate Shapes with randomly generated sizes/dimensions.
- Author:
- Brent Nash
Member Function Documentation
static Shape* RandomSizeShapeFactory::createShape |
( |
std::string |
name |
) |
[static] |
Static factory method for creating shapes. Takes in a string representation of a shape and returns a pointer to that particular shape. Only works for shapes that derive from the Shape object. Center points for returned shapes will always be (0,0).
- Precondition:
- None
- Postcondition:
- Does not change the object
- Parameters:
-
| name | The name of the shape to generate (e.g. "triangle", "rectangle", or "circle"). Input is case-sensitive. |
- Returns:
- A pointer to a Shape object dynamically allocated on the heap if "name" is a valid, recognized shape type or NULL if "name" does not specify the name of a known shape.
The documentation for this class was generated from the following files:
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees