-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlyweight_Expr_Command_Factory.cpp
More file actions
38 lines (38 loc) · 1.28 KB
/
Flyweight_Expr_Command_Factory.cpp
File metadata and controls
38 lines (38 loc) · 1.28 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
Flyweight_Expr_Command_Factory::Flyweight_Expr_Command_Factory(){
this->add_ = new Add_Command();
this->subtr_ = new Subtract_Command();
this->mult_ = new Mult_Command();
this->div_ = new Div_Command();
this->left_ = new Left_Parenth_Command();
this->right_ = new Right_Parenth_Command();
}
Flyweight_Expr_Command_Factory::~Flyweight_Expr_Command_Factory(void){
delete this->add_;
delete this->subtr_;
delete this->mult_;
delete this->div_;
delete this->left_;
delete this->right_;
}
Add_Command * Flyweight_Expr_Command_Factory::create_add_command(void){
return this->add_;
}
Subtract_Command * Flyweight_Expr_Command_Factory::create_subtract_command(void){
return this->subtr_;
}
Mult_Command * Flyweight_Expr_Command_Factory::create_mult_command(void){
return this->mult_;
}
Div_Command * Flyweight_Expr_Command_Factory::create_div_command(void){
return this->div_;
}
Left_Parenth_Command * Flyweight_Expr_Command_Factory::create_left_par_command(){
return this->left_;
}
Right_Parenth_Command * Flyweight_Expr_Command_Factory::create_right_par_command(){
return this->right_;
}
Number_Command * Flyweight_Expr_Command_Factory::create_number_command(int operand){
Number_Command * num = new Number_Command(operand);
return num;
}