-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandHistory.cpp
More file actions
44 lines (38 loc) · 1.63 KB
/
CommandHistory.cpp
File metadata and controls
44 lines (38 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Blake Berry
// 03/08/2022
// Homework 4
// This file is an implimentation for the CommandHistory class. The
// CommandHistory class inherits from the command interface. The CommandHistory
// class is responsible for the end - to - end execution of displaying the
// stores entire customer transaction history
//-----------------------------------------------------------------------------
#include "CommandHistory.h"
//-------------------------- constructor -----------------------------------
// creates a CommandHistroy with a given string Indicator
// Postconditions: A CommandHistory is created
CommandHistory::CommandHistory(std::string type) :
Command(type)
{
}
//-------------------------- destructor -----------------------------------
// Frees any dynamic memory associated with the Command object
// Postconditions: The command is freed of any dynamic memory
CommandHistory::~CommandHistory()
{
}
//-------------------------- Execute -----------------------------------
// Facilitates the display of the entire store transaction history.
// If there is no such customers or transaction history an exception
// is thrown
// Postconditions: The entire transaction history for a given customer is
// displayed in chronolgoical order.
//
// If there is no such customers or transaction history an
// exception is thrown
void CommandHistory::execute(TransactionManager*& tManager,
ItemsManager*& iManager,
CustomerManager*& cManager,
std::string& command) const
{
tManager->displayTransactionHistory();
}