csci3081/duckVisitor/Visitor.h
Michael Zhang 1ba4536588
f
2018-01-29 17:24:20 -06:00

38 lines
779 B
C++

#ifndef DUCKS_EXERCISES_VISITOR_H_
#define DUCKS_EXERCISES_VISITOR_H_
class Duck;
class RubberDuck;
class Mallard;
class DecoyDuck;
class SeaDuck;
class Visitor {
public:
Visitor();
virtual void visit(Duck* d);
virtual void visit(RubberDuck* r);
virtual void visit(Mallard* m);
virtual void visit(DecoyDuck* dd);
virtual void visit(SeaDuck* s);
};
class RealDuckReport : public Visitor {
public:
void visit(RubberDuck* r);
void visit(Mallard* m);
void visit(Duck* d);
void visit(DecoyDuck* d);
void visit(SeaDuck* s);
};
class FakeDuckReport : public Visitor {
public:
void visit(RubberDuck* r);
void visit(Mallard* m);
void visit(Duck* d);
void visit(DecoyDuck* d);
void visit(SeaDuck* s);
};
#endif