Hello, I am not familiar with the following assignment:
Manager &m = Manager::self();
Could any one clarify me ?
Thanks in advance.
Hello, I am not familiar with the following assignment:
Manager &m = Manager::self();
Could any one clarify me ?
Thanks in advance.
It's a call to static member function in class Manager called self which returns a Manager or Manager&.
Looks like it's a singleton.
EDIT: Manager is a terrible name for a class though, what does it manage?
Can't quite tell; not enough code. I am going to go out on a limb here and say it is a Singleton pattern implementation -- especially if it returns a manager (pointer) or reference. Singleton is a pattern that states that there is one instance of an object that is shared by the entire program. In which case, the manager class contains a static instance to that class, a private constructor, and an overloaded assignment operator. In this case, you would be fetching the shared instance.