-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStack_Expr_Command_Factory.h
More file actions
53 lines (38 loc) · 1.49 KB
/
Copy pathStack_Expr_Command_Factory.h
File metadata and controls
53 lines (38 loc) · 1.49 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
// -*- C++ -*-
//==============================================================================
/**
* @file Stack_Expr_Command_Factory.h
*
* Honor Pledge:
*
* I pledge that I have neither given nor received any help
* on this assignment.
*/
//==============================================================================
#ifndef _STACK_EXPR_COMMAND_FACTORY_H_
#define _STACK_EXPR_COMMAND_FACTORY_H_
#include "Expr_Command_Factory.h"
/**
* @class Stack_Expr_Command_Factory
*
* This is a pure abstract class.
* Provide the common implementation of all the products i.e. creating new commands in this abstract class.
*/
class Stack_Expr_Command_Factory: public Expr_Command_Factory
{
public:
// constructor
Stack_Expr_Command_Factory (Stack <int> & s);
// destructor
// virtual ~Stack_Expr_Command_Factory (void); // prolly don't need it because it is empty, so it calls the base destructor --> error: undefined reference
// methods to return concrete products i.e. specific commands to operate on the stack
virtual Number_Command * create_number_command (int num);
virtual Add_Command * create_add_command (void);
virtual Subtract_Command * create_subtract_command (void);
virtual Multiply_Command * create_multiply_command (void);
virtual Divide_Command * create_divide_command (void);
virtual Modulus_Command * create_modulus_command (void);
private:
Stack <int> & stack_;
};
#endif // !defined _STACK_EXPR_COMMAND_FACTORY_H_