Template support for singleton pattern. More...
#include <Singleton.h>
Static Public Member Functions | |
static T & | getInstance () |
It returns a reference to the singleton instance. More... | |
Protected Member Functions | |
Singleton () | |
The singleton constructor is protected. More... | |
~Singleton () | |
This will avoid clients trying to release pointers to base class. More... | |
Template support for singleton pattern.
In TerraLib, classes that manage resources like DataSourceManager and ProjectManager are singletons. The basic interface of a singleton is defined by this singleton class. If you want to get access to the singleton instance you can write a code like:
or
If you want to use this template class in order to create your singleton class, the type T must satisfy the following requirements:
You can create a singleton class as follow:
Definition at line 100 of file Singleton.h.
|
inlineprotected |
The singleton constructor is protected.
Definition at line 127 of file Singleton.h.
|
inlineprotected |
This will avoid clients trying to release pointers to base class.
Definition at line 131 of file Singleton.h.
|
inlinestatic |
It returns a reference to the singleton instance.
Definition at line 120 of file Singleton.h.
Referenced by BBOXReader(), BBOXWriter(), BetweenReader(), BetweenWriter(), BinaryComparsionOpReader(), BinaryComparsionOpWriter(), BinaryOperatorReader(), BinarySpatialOpReader(), BinarySpatialOpWriter(), te::map::AbstractLayerRenderer::buildChart(), te::map::QueryLayerRenderer::buildChart(), te::edit::SnapOptionsDialog::buildOptions(), te::layout::PropertiesOutside::changeMapVisitable(), te::layout::ItemUtils::createLegendChildItemFromLegend(), DistanceBufferOpWriter(), DistanceBufferReader(), te::sa::GetColorBar(), te::edit::Module::initialize(), te::color::Module::initialize(), te::qt::widgets::Module::initialize(), te::qt::af::GeneralConfigWidget::initialize(), te::qt::af::ApplicationController::initialize(), LikeReader(), LikeWriter(), te::qt::widgets::ColorCatalogWidget::loadDefaultColorCatalog(), NullReader(), NullWriter(), te::qt::plugins::edit::ApplicationListener::onApplicationTriggered(), te::qt::widgets::ColorCatalogWidget::onCatalogComboBoxActivated(), te::qt::widgets::ColorCatalogWidget::onGroupComboBoxActivated(), te::edit::SnapOptionsDialog::onOkPushButtonPressed(), te::qt::widgets::ColorCatalogWidget::onSchemaComboBoxActivated(), te::se::serialize::ReadGeometryPropertyHelper(), te::map::serialize::ReadGroupingItem(), te::se::serialize::ReadParameterValue(), te::se::serialize::ReadRule(), te::se::serialize::ReadSvgParameter(), te::qt::widgets::ReadSymbol(), te::se::serialize::Save(), te::color::ColorSchemeCatalog::setName(), te::qt::af::UpdateUserSettingsFile(), te::se::serialize::WriteGeometryPropertyHelper(), and te::map::serialize::WriteLayerGrouping().