7#ifndef __VISITOR_VISITOR_CLASS_H__
8#define __VISITOR_VISITOR_CLASS_H__
10#include "helpers/stringlist.h"
Declaration of the Visitor base class and the various shop classes used in the Visitor Pattern.
A visitor used for ordering items from various shops. The user starts with an instance of this class ...
StringList ItemsReceived
List of items received from an order/pickup process.
void VisitVegetableGrocer(Visitor_VegetableGrocer *shop) override
Let the visitor visit a Visitor_VegetableGrocer shop.
void VisitCondimentGrocer(Visitor_CondimentGrocer *shop) override
Let the visitor visit a Visitor_CondimentGrocer shop.
StringList ItemsToOrder
Items to be ordered from any shop that sells the item.
void VisitPickleGrocer(Visitor_PickleGrocer *shop) override
Let the visitor visit a Visitor_PickleGrocer shop.
void VisitRestaurant(Visitor_Restaurant *shop) override
Let the visitor visit a Visitor_Restaurant shop.
std::string ShopNameReceivedFrom
Name of the shop that provided the item(s).
void VisitButcher(Visitor_Butcher *shop) override
Let the visitor visit a Visitor_Butcher shop.
OrderVisitor(StringList itemsToOrder)
Constructor.
void VisitBaker(Visitor_Baker *shop) override
Let the visitor visit a Visitor_Baker shop.
void VisitMaker(Visitor_Maker *shop) override
Let the visitor visit a Visitor_Maker shop.
Represent a butcher shop.
Represent a condiment grocer.
Represent a maker (of things).
Represent a pickle grocer.
Represent a restaurant shop.
void PickupOrder(StringList items, StringList &itemsToBePickedUp)
Pick up the items sold by this shop (assumes the items were ordered already). Basically,...
bool PlaceOrder(StringList items)
Place an order for the specified items. If the inventory is empty, replenish the inventory by visitin...
std::string Name()
Name of the shop.
Represent a vegetable grocer.
All visitors must implement this base class and then override one or more of the VisitXXX() methods,...
std::vector< std::string > StringList
Typedef for a vector of std::string.
The namespace containing all Design Pattern Examples implemented in C++.