"(preferably using an integrator)"
I think you meant iterator.
Basically, they want the ScreenManager class to store a bunch of drawable objects generically, not caring what specifically will be drawn to the screen, only caring that each shape can draw itself. In doing so, the only time the ScreenManager has to worry about each individual type of shape is when they are created... not in using them.
A basic, incomplete version of what is wanted follows.
Code:
class Shape {
public:
virtual void draw()=0;
virtual ~Shape() { }
};
class Triangle : public Shape {
public:
void draw(); // draws a triangle
private:
// whatever is needed
};
class Rectangle : public Shape {
public:
void draw(); // draws a square
private:
// whatever
};
class ScreenManager {
public:
ScreenManager(); // randomly fills shapeVec with Rects or Triangles
~ScreenManager(); // deletes stuff in shapeVec
void drawScene(); // iterates through shapeVec, drawing each shape to screen
private:
std::vector<Shape*> shapeVec; // or whatever container you are comfortable with
};