Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Singleton/Objeck/singleton.objeck
Normal file
18
Task/Singleton/Objeck/singleton.objeck
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class Singleton {
|
||||
@singleton : static : Singleton;
|
||||
|
||||
New : private () {
|
||||
}
|
||||
|
||||
function : GetInstance() ~ Singleton {
|
||||
if(@singleton <> Nil) {
|
||||
@singleton := Singleton->New();
|
||||
};
|
||||
|
||||
return @singleton;
|
||||
}
|
||||
|
||||
method : public : DoStuff() ~ Nil {
|
||||
...
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue