-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpr_Command_Factory.h
More file actions
executable file
·54 lines (40 loc) · 1.5 KB
/
Copy pathExpr_Command_Factory.h
File metadata and controls
executable file
·54 lines (40 loc) · 1.5 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
// -*- C++ -*-
//==============================================================================
/**
* @file Expr_Command_Factory.h
*
* Honor Pledge:
*
* I pledge that I have neither given nor received any help
* on this assignment.
*/
//==============================================================================
#ifndef _EXPR_COMMAND_FACTORY_H_
#define _EXPR_COMMAND_FACTORY_H_
#include "Number_Command.h"
#include "Add_Command.h"
#include "Subtract_Command.h"
#include "Multiply_Command.h"
#include "Divide_Command.h"
#include "Modulus_Command.h"
/**
* @class 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 Expr_Command_Factory
{
public:
// destructor
// virtual ~Expr_Command_Factory (void) = 0; prolly don't need it because if I define one here, I have to define one for the subclass (which will be empty, so it calls this --> error: undefined reference)
// methods to return products i.e. specific commands
virtual Number_Command * create_number_command (int num) = 0;
virtual Add_Command * create_add_command (void) = 0;
virtual Subtract_Command * create_subtract_command (void) = 0;
virtual Multiply_Command * create_multiply_command (void) = 0;
virtual Divide_Command * create_divide_command (void) = 0;
virtual Modulus_Command * create_modulus_command (void) = 0;
private:
};
#endif // !defined _EXPR_COMMAND_FACTORY_H_