-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToyFactory.hxx
More file actions
42 lines (35 loc) · 1011 Bytes
/
ToyFactory.hxx
File metadata and controls
42 lines (35 loc) · 1011 Bytes
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: ToyFactory.hxx
// Author: Enhope
// Date: 31-05-2019
//-----------------------------------------------------------------------------
#ifndef TOYFACTORY_HXX_
#define TOYFACTORY_HXX_
#include <factory_method_pattern/Toy.hxx>
//-----------------------------------------------------------------------------
// \brief Factory class.
class Factory
{
public:
//! \brief Virtual destructor for subclasses.
virtual ~Factory();
typedef enum
{
BIKE,
CAR,
PLANE
} ToyType;
virtual Toy::ToyPtr createToy(Factory::ToyType type) = 0;
};
//-----------------------------------------------------------------------------
// \brief Toy Factory class.
class ToyFactory
{
public:
//! \brief Constructor.
ToyFactory();
//! \brief Virtual destructor for subclasses.
virtual ~ToyFactory();
Toy::ToyPtr createToy(Factory::ToyType type);
};
#endif /* TOYFACTORY_HXX_ */