RandomSizeShapeFactory Class Reference

#include <shapefactory.h>

List of all members.

Static Public Member Functions

static ShapecreateShape (std::string name)


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:
Generated on Fri Dec 23 11:21:39 2011 by  doxygen 1.5.2