Implementation of the OrderVisitor structure's supporting functions, OrderVisitor_Initialize(), OrderVisitor_Clear(), and OrderVisitor_VisitShop(), as used in the Visitor Pattern. More...
#include "Visitor_OrderVisitor.h"
Go to the source code of this file.
Functions | |
void | OrderVisitor_Initialize (OrderVisitor *visitor) |
Initialize the specified OrderVisitor object. | |
void | OrderVisitor_Clear (OrderVisitor *visitor) |
Clear the specified OrderVisitor object, freeing up any memory that it was using. The resulting object is initialized as if brand new. | |
bool | OrderVisitor_VisitShop (OrderVisitor *order, Visitor_Shop *shop) |
Represents a visit to the specified Visitor_Shop with the specified order. | |
Implementation of the OrderVisitor structure's supporting functions, OrderVisitor_Initialize(), OrderVisitor_Clear(), and OrderVisitor_VisitShop(), as used in the Visitor Pattern.
Definition in file Visitor_OrderVisitor.c.
void OrderVisitor_Clear | ( | OrderVisitor * | visitor | ) |
Clear the specified OrderVisitor object, freeing up any memory that it was using. The resulting object is initialized as if brand new.
visitor | The OrderVisitor object to clear. |
Definition at line 25 of file Visitor_OrderVisitor.c.
References ConstStringList_Clear(), OrderVisitor::ItemsReceived, OrderVisitor::ItemsToOrder, and OrderVisitor_Initialize().
Referenced by Shop_PlaceOrder(), and Visitor_Exercise().
void OrderVisitor_Initialize | ( | OrderVisitor * | visitor | ) |
Initialize the specified OrderVisitor object.
Alternatively, declare the OrderVisitor instance like this:
visitor | The OrderVisitor object to initialize. |
Definition at line 12 of file Visitor_OrderVisitor.c.
References ConstStringList_Initialize(), OrderVisitor::ItemsReceived, OrderVisitor::ItemsToOrder, and OrderVisitor::ShopNameReceivedFrom.
Referenced by OrderVisitor_Clear(), and Visitor_Exercise().
bool OrderVisitor_VisitShop | ( | OrderVisitor * | order, |
Visitor_Shop * | shop | ||
) |
Represents a visit to the specified Visitor_Shop with the specified order.
order | The OrderVisitor object representing what is being ordered from the shop. |
shop | The Visitor_Shop that is being visited and, if it carries the ingredients, receives the order. Otherwise, the shop ignores the visit. |
Definition at line 38 of file Visitor_OrderVisitor.c.
References OrderVisitor::ItemsReceived, OrderVisitor::ItemsToOrder, Visitor_Shop::Name, PlaceOrderResponse_OrderAccepted, Shop_PickupOrder(), Shop_PlaceOrder(), and OrderVisitor::ShopNameReceivedFrom.
Referenced by Village_VisitShop().