Design Pattern Examples
Overview of object-oriented design patterns
OrderVisitor Class Reference

A visitor used for ordering items from various shops. The user starts with an instance of this class and a list of what they want to order. More...

Inheritance diagram for OrderVisitor:
Inheritance graph
Collaboration diagram for OrderVisitor:
Collaboration graph

Public Member Functions

 OrderVisitor (string[] itemsToOrder)
 Constructor.
 
override void VisitBaker (Visitor_Baker shop)
 Let the visitor visit a Visitor_Baker shop.
 
override void VisitButcher (Visitor_Butcher shop)
 Let the visitor visit a Visitor_Butcher shop.
 
override void VisitPickleGrocer (Visitor_PickleGrocer shop)
 Let the visitor visit a Visitor_PickleGrocer shop.
 
override void VisitCondimentGrocer (Visitor_CondimentGrocer shop)
 Let the visitor visit a Visitor_CondimentGrocer shop.
 
override void VisitVegetableGrocer (Visitor_VegetableGrocer shop)
 Let the visitor visit a Visitor_VegetableGrocer shop.
 
override void VisitMaker (Visitor_Maker shop)
 Let the visitor visit a Visitor_Maker shop.
 
override void VisitRestaurant (Visitor_Restaurant shop)
 Let the visitor visit a Visitor_Restaurant shop.
 
virtual void VisitRestaurant (Visitor_Restaurant shop)
 Let the visitor visit a Visitor_Restaurant shop.
 
virtual void VisitButcher (Visitor_Butcher shop)
 Let the visitor visit a Visitor_Butcher shop.
 
virtual void VisitBaker (Visitor_Baker shop)
 Let the visitor visit a Visitor_Baker shop.
 
virtual void VisitVegetableGrocer (Visitor_VegetableGrocer shop)
 Let the visitor visit a Visitor_VegetableGrocer shop.
 
virtual void VisitCondimentGrocer (Visitor_CondimentGrocer shop)
 Let the visitor visit a Visitor_CondimentGrocer shop.
 
virtual void VisitPickleGrocer (Visitor_PickleGrocer shop)
 Let the visitor visit a Visitor_PickleGrocer shop.
 
virtual void VisitMaker (Visitor_Maker shop)
 Let the visitor visit a Visitor_Maker shop.
 

Properties

string[] ItemsToOrder [get, set]
 Items to be ordered from any shop that sells the item.
 
List< string > ItemsReceived [get, set]
 List of items received from an order/pickup process.
 
string ShopNameReceivedFrom [get, set]
 Name of the shop that provided the item(s).
 

Detailed Description

A visitor used for ordering items from various shops. The user starts with an instance of this class and a list of what they want to order.

A shop will used this visitor to order ingredients to make a requested item.

Definition at line 200 of file Visitor_Visitor_Class.cs.

Constructor & Destructor Documentation

◆ OrderVisitor()

OrderVisitor ( string[]  itemsToOrder)
inline

Constructor.

Parameters
itemsToOrderList of items to order.

Definition at line 224 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, and OrderVisitor.ShopNameReceivedFrom.

Member Function Documentation

◆ VisitBaker()

override void VisitBaker ( Visitor_Baker  shop)
inlinevirtual

Let the visitor visit a Visitor_Baker shop.

Parameters
shopThe specific baker shop being visited.

Reimplemented from Visitor.

Definition at line 231 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

◆ VisitButcher()

override void VisitButcher ( Visitor_Butcher  shop)
inlinevirtual

Let the visitor visit a Visitor_Butcher shop.

Parameters
shopThe specific butcher shop being visited.

Reimplemented from Visitor.

Definition at line 240 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

◆ VisitCondimentGrocer()

override void VisitCondimentGrocer ( Visitor_CondimentGrocer  shop)
inlinevirtual

Let the visitor visit a Visitor_CondimentGrocer shop.

Parameters
shopThe specific condiment grocer being visited.

Reimplemented from Visitor.

Definition at line 258 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

◆ VisitMaker()

override void VisitMaker ( Visitor_Maker  shop)
inlinevirtual

Let the visitor visit a Visitor_Maker shop.

Parameters
shopThe specific maker shop being visited.

Reimplemented from Visitor.

Definition at line 276 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

◆ VisitPickleGrocer()

override void VisitPickleGrocer ( Visitor_PickleGrocer  shop)
inlinevirtual

Let the visitor visit a Visitor_PickleGrocer shop.

Parameters
shopThe specific pickle grocer being visited.

Reimplemented from Visitor.

Definition at line 249 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

◆ VisitRestaurant()

override void VisitRestaurant ( Visitor_Restaurant  shop)
inlinevirtual

Let the visitor visit a Visitor_Restaurant shop.

Parameters
shopThe specific restaurant being visited.

Reimplemented from Visitor.

Definition at line 285 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

◆ VisitVegetableGrocer()

override void VisitVegetableGrocer ( Visitor_VegetableGrocer  shop)
inlinevirtual

Let the visitor visit a Visitor_VegetableGrocer shop.

Parameters
shopThe specific vegetable grocer being visited.

Reimplemented from Visitor.

Definition at line 267 of file Visitor_Visitor_Class.cs.

References OrderVisitor.ItemsReceived, OrderVisitor.ItemsToOrder, Visitor_Shop.Name, Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), and OrderVisitor.ShopNameReceivedFrom.

Property Documentation

◆ ItemsReceived

◆ ItemsToOrder

◆ ShopNameReceivedFrom


The documentation for this class was generated from the following file: