AnimalsFactory.cpp
Go to the documentation of this file.
1 #include "Animals.h"
2 #include "AnimalsFactory.h"
3 
7 
8 static const std::string killerWhaleFactoryKey("Killer");
9 static const std::string PlatypusFactoryKey("Plat");
10 static const std::string MyrmecophagidaeFactoryKey("Myr");
11 
12 AnimalFactory::AnimalFactory(const std::string& factoryKey)
13  : te::common::AbstractFactory<Animal, std::string>(factoryKey)
14 {
15 }
16 
18 {
19  sm_factory = new KillerWhaleFactory;
20 }
22 {
23  delete sm_factory;
24  sm_factory = 0;
25 }
26 
29 {
30 }
31 
33 {
34  return new KillerWhale;
35 }
36 
38 {
40 }
42 {
43  delete sm_factory;
44  sm_factory = 0;
45 }
46 
49 {
50 }
51 
53 {
54  return new Platypus;
55 }
56 
58 {
60 }
62 {
63  delete sm_factory;
64  sm_factory = 0;
65 }
66 
69 {
70 }
71 
73 {
74  return new Myrmecophagidae;
75 }
static void initialize()
static void finalize()
static MyrmecophagidaeFactory * sm_factory
static PlatypusFactory * sm_factory
static void finalize()
AnimalFactory(const std::string &factoryKey)
Animal * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
static const std::string PlatypusFactoryKey("Plat")
URI C++ Library.
Definition: Attributes.h:37
Definition: Animals.h:6
static KillerWhaleFactory * sm_factory
Animal * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
Animal * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
static const std::string killerWhaleFactoryKey("Killer")
static const std::string MyrmecophagidaeFactoryKey("Myr")
static void initialize()