-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargoFactory.h
42 lines (39 loc) · 967 Bytes
/
CargoFactory.h
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
/**
* @file CargoFactory.h
* @class CargoFactory
* @author Xander Coetzer
* @brief Design Pattern: Factory Method, Participant: Abstract Factory
*/
#ifndef CARGOFACTORY_H
#define CARGOFACTORY_H
#include "Cargo.h"
class CargoFactory
{
public:
/**
* @brief Construct a new Cargo Factory object
*
*/
CargoFactory();
/**
* @brief Destroy the Cargo Factory object
*
*/
virtual ~CargoFactory();
/**
* @brief Calls the protected getCargo function and returns the result. Resembles the anOperation().
*
* @param n String that describes the cargo
* @return Cargo* which is either Human or Equipment.
*/
Cargo *startFactory(string n);
protected:
/**
* @brief Creates the Cargo object and returns the result. Resembles the factoryMethod().
*
* @param n String that describes the cargo
* @return Cargo*
*/
virtual Cargo *getCargo(string n) = 0;
};
#endif