![]() |
Peano
|
Singletons are classes which are instantiated once and only once.
Most object-oriented books are not in favour of singletons, as they disagree with that idea that there's a class definition with multiple instantiations of this class which are called objects. However, Peano needs singletons in several cases.
static MyType& getInstance();which returns a non-const reference.
Due to Peano's architecture, there are classes which need to poll MPI every now and then for potential messages (such as load balancing notifications). Such classes are called services. Services