18 lines
275 B
Text
18 lines
275 B
Text
class Singleton {
|
|
@singleton : static : Singleton;
|
|
|
|
New : private () {
|
|
}
|
|
|
|
function : GetInstance() ~ Singleton {
|
|
if(@singleton <> Nil) {
|
|
@singleton := Singleton->New();
|
|
};
|
|
|
|
return @singleton;
|
|
}
|
|
|
|
method : public : DoStuff() ~ Nil {
|
|
...
|
|
}
|
|
}
|