# | Line 59 | Line 59 | class ForceFieldFactory { | |
---|---|---|
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 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |