-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStack_Expr_Command_Factory.cpp
More file actions
executable file
·56 lines (40 loc) · 1.31 KB
/
Stack_Expr_Command_Factory.cpp
File metadata and controls
executable file
·56 lines (40 loc) · 1.31 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
45
46
47
48
49
50
51
52
53
54
55
56
// -*- C++ -*-
// Honor Pledge:
//
// I pledge that I have neither given nor receieved any help
// on this assignment.
#include "Stack_Expr_Command_Factory.h"
Stack_Expr_Command_Factory::Stack_Expr_Command_Factory (Stack <int> & s)
: stack_ (s)
{
} // end constructor
/*
Stack_Expr_Command_Factory::~Stack_Expr_Command_Factory (void)
{
// nothing allocated on the heap in this class, so nothing to delete
} // end destructor
*/
Number_Command * Stack_Expr_Command_Factory::create_number_command (int num)
{
return new Number_Command (stack_, num);
} // end create_number_command
Add_Command * Stack_Expr_Command_Factory::create_add_command (void)
{
return new Add_Command (stack_);
} // end create_add_command
Subtract_Command * Stack_Expr_Command_Factory::create_subtract_command (void)
{
return new Subtract_Command (stack_);
} // end create_add_command
Multiply_Command * Stack_Expr_Command_Factory::create_multiply_command (void)
{
return new Multiply_Command (stack_);
} // end create_add_command
Divide_Command * Stack_Expr_Command_Factory::create_divide_command (void)
{
return new Divide_Command (stack_);
} // end create_add_command
Modulus_Command * Stack_Expr_Command_Factory::create_modulus_command (void)
{
return new Modulus_Command (stack_);
} // end create_modulus_command