Poco

template < class S >

class SingletonHolder

File Information

Library: Foundation
Package: Core
Header: Poco/SingletonHolder.h

Description

This is a helper template class for managing singleton objects allocated on the heap. The class ensures proper deletion (including calling of the destructor) of singleton objects when the application that created them terminates.

Member Summary

Member Functions: get, reset

Constructors

SingletonHolder inline

SingletonHolder();

Creates the SingletonHolder.

Destructor

~SingletonHolder inline

~SingletonHolder();

Destroys the SingletonHolder and the singleton object that it holds.

Member Functions

get inline

S * get();

Returns a pointer to the singleton object hold by the SingletonHolder. The first call to get will create the singleton.

reset inline

void reset();

Deletes the singleton object.

Securely control IoT edge devices from anywhere   Connect a Device