QuantLib_Singleton man page

Singleton< T > — Basic support for the singleton pattern.  


#include <ql/patterns/singleton.hpp>

Inherits noncopyable.

Static Public Member Functions

static T & instance ()
access to the unique instance

Detailed Description

template<class T>

class QuantLib::Singleton< T >" Basic support for the singleton pattern.

The typical use of this class is:

class Foo : public Singleton<Foo> {
    friend class Singleton<Foo>;
    Foo() {}

which, albeit sub-optimal, frees one from the concerns of creating and managing the unique instance and can serve later as a single implemementation point should synchronization features be added.


Generated automatically by Doxygen for QuantLib from the source code.

Referenced By

The man page instance(3) is an alias of QuantLib_Singleton(3).

Mon Apr 30 2018 Version 1.12.1 QuantLib