Util--  1.1
Public Member Functions | List of all members
utilmm::singleton::use< Ty > Struct Template Reference

Access point to singleton. More...

#include <utilmm/singleton/use.hh>

Inheritance diagram for utilmm::singleton::use< Ty >:
Inheritance graph
[legend]

Public Member Functions

 use ()
 Constructor. More...
 
 use (use const &other)
 Copy constructor. More...
 
 ~use ()
 Destructor. More...
 
Ty & instance () const
 Access to singleton. More...
 
Ty & operator* () const
 Access to singleton. More...
 
Ty * operator-> () const
 Access to singleton. More...
 

Detailed Description

template<typename Ty>
struct utilmm::singleton::use< Ty >

Access point to singleton.

This class is the used to acces to a singleton with type Ty . It also manage the singleton life time indicating to the server that this singleton has a new client.

Author
Frédéric Py fpy@l.nosp@m.aas..nosp@m.fr

Constructor & Destructor Documentation

◆ use() [1/2]

template<typename Ty>
utilmm::singleton::use< Ty >::use ( )

Constructor.

Create a new instance and eventually create the singleton. This constructor will indicate to server that thze singleton Ty has a new client. If it is the first client then the sezrver will create the singleton Ty.

◆ use() [2/2]

template<typename Ty>
utilmm::singleton::use< Ty >::use ( use< Ty > const &  other)

Copy constructor.

This constructor only indicate to server that there's a new client to sinbgleton Ty.

◆ ~use()

template<typename Ty>
utilmm::singleton::use< Ty >::~use ( )

Destructor.

Indicate to server that singlerton Ty has lost one client if the number of client to Ty becomes null then the singleton is destroyed.

Member Function Documentation

◆ instance()

template<typename Ty>
Ty& utilmm::singleton::use< Ty >::instance ( ) const

Access to singleton.

Returns
A reference to the singleton Ty

◆ operator*()

template<typename Ty>
Ty& utilmm::singleton::use< Ty >::operator* ( ) const

Access to singleton.

See also
instance() const

◆ operator->()

template<typename Ty>
Ty* utilmm::singleton::use< Ty >::operator-> ( ) const

Access to singleton.

This operator allow client to directly access to singlton's attributes.

See also
instance() const

The documentation for this struct was generated from the following file:

Generated on Mon Oct 22 2018 18:39:28 for Util-- by doxygen 1.8.13
SourceForge.net Project Page