35 |
|
#include <map> |
36 |
|
#include <string> |
37 |
|
#include <vector> |
38 |
< |
|
38 |
> |
#include <iostream> |
39 |
|
namespace oopse { |
40 |
|
|
41 |
|
//forward declaration |
59 |
|
* Returns an instance of ForceField factory |
60 |
|
* @return an instance of ForceField factory |
61 |
|
*/ |
62 |
< |
static ForceFieldFactory* getInstance(); |
62 |
> |
static ForceFieldFactory* getInstance() { |
63 |
|
|
64 |
+ |
if (instance_ == NULL) { |
65 |
+ |
instance_ = new ForceFieldFactory(); |
66 |
+ |
} |
67 |
+ |
return instance_; |
68 |
+ |
|
69 |
+ |
} |
70 |
+ |
|
71 |
|
/** |
72 |
|
* Registers a creator with a type identifier |
73 |
|
* @return true if registration is succeed, otherwise return false |