The ColorSchemeCatalogManager is a singleton that can be used to manage all loaded color scheme catalogs. More...
#include <ColorSchemeCatalogManager.h>
Public Member Functions | |
ColorSchemeCatalogManager Accessor Method | |
Method used to access the data stored on this manager. | |
void | insert (ColorSchemeCatalog *c) |
It inserts a new catalog that will be managed by ColorSchemeCatalogManager. More... | |
void | disconnect (ColorSchemeCatalog *c) |
It removes the internal reference to the catalog. More... | |
void | erase (ColorSchemeCatalog *c) |
It removes the catalog from the manager and clears it resources. More... | |
ColorSchemeCatalog * | findByName (const std::string &name) const |
It returns the catalog identified by a given name or NULL if none is found. More... | |
std::pair< std::vector < ColorSchemeCatalog * > ::const_iterator, std::vector < ColorSchemeCatalog * > ::const_iterator > | getIterator () const |
It returns a pair of iterators over the catalogs of this manager. More... | |
const std::vector < ColorSchemeCatalog * > & | getCatalogs () const |
It returns the list of catalogs available in the system. More... | |
bool | isEmpty () const |
It returns true if the manager contains at least one catalog. If no catalog exists, it returns false. More... | |
void | clear () |
It unloads all catalogs managed by ColorSchemeCatalogManager. More... | |
Static Public Member Functions | |
static T & | getInstance () |
It returns a reference to the singleton instance. More... | |
Private Member Functions | |
Copy Constructor and Assignment Operator | |
Copy constructor and assignment operator not allowed. | |
ColorSchemeCatalogManager (const ColorSchemeCatalogManager &rhs) | |
Copy constructor not allowed. More... | |
ColorSchemeCatalogManager & | operator= (const ColorSchemeCatalogManager &rhs) |
Assignment operator not allowed. More... | |
Private Attributes | |
std::map< std::string, ColorSchemeCatalog * > | m_catalogIdxByName |
An index from catalog's name to catalog's instance (note: we can not have duplicated names). More... | |
std::vector< ColorSchemeCatalog * > | m_catalogs |
This is the list of all system's loaded catalogs. More... | |
Friends | |
class | te::common::Singleton< ColorSchemeCatalogManager > |
Initializer Methods | |
~ColorSchemeCatalogManager () | |
Destructor. More... | |
ColorSchemeCatalogManager () | |
It initializes the Singleton. More... | |
The ColorSchemeCatalogManager is a singleton that can be used to manage all loaded color scheme catalogs.
Use this class to keep the loaded catalogs and to be a point of entry for plugins that need to known what are the opened catalogs of your application. When the singleton finishes its life time it automatically clears all loaded catalogs stored on it. You can also use it only inside a given window, where a list of catalogs will be displayed and then when the window gets closed, you clear the catalogs to save memory.
Definition at line 75 of file ColorSchemeCatalogManager.h.
te::color::ColorSchemeCatalogManager::~ColorSchemeCatalogManager | ( | ) |
Destructor.
Definition at line 117 of file ColorSchemeCatalogManager.cpp.
|
protected |
It initializes the Singleton.
Definition at line 122 of file ColorSchemeCatalogManager.cpp.
|
private |
Copy constructor not allowed.
rhs | The right-hand-side copy that would be used to copy from. |
void te::color::ColorSchemeCatalogManager::clear | ( | ) |
It unloads all catalogs managed by ColorSchemeCatalogManager.
Definition at line 108 of file ColorSchemeCatalogManager.cpp.
References te::common::FreeContents().
void te::color::ColorSchemeCatalogManager::disconnect | ( | ColorSchemeCatalog * | c | ) |
It removes the internal reference to the catalog.
c | The catalog to be removed. |
Exception | If the catalog doesn't exist it will raise an exception. |
Definition at line 47 of file ColorSchemeCatalogManager.cpp.
References te::color::ColorSchemeCatalog::getName(), and TR_COLOR.
void te::color::ColorSchemeCatalogManager::erase | ( | ColorSchemeCatalog * | c | ) |
It removes the catalog from the manager and clears it resources.
c | The catalog to be removed. |
Exception | If the catalog doesn't exist it will raise an exception. |
Definition at line 73 of file ColorSchemeCatalogManager.cpp.
te::color::ColorSchemeCatalog * te::color::ColorSchemeCatalogManager::findByName | ( | const std::string & | name | ) | const |
It returns the catalog identified by a given name or NULL if none is found.
name | The name of the catalog we are looking for. |
Definition at line 81 of file ColorSchemeCatalogManager.cpp.
Referenced by insert().
const std::vector< te::color::ColorSchemeCatalog * > & te::color::ColorSchemeCatalogManager::getCatalogs | ( | ) | const |
It returns the list of catalogs available in the system.
Definition at line 98 of file ColorSchemeCatalogManager.cpp.
|
inlinestaticinherited |
It returns a reference to the singleton instance.
Definition at line 120 of file Singleton.h.
Referenced by BinaryLogicOpReader(), BinaryLogicOpWriter(), te::map::AbstractLayerRenderer::buildChart(), te::common::TaskProgress::cancel(), te::qt::widgets::SegmenterWizard::execute(), te::qt::widgets::Module::initialize(), te::qt::af::ApplicationController::initialize(), te::qt::af::ApplicationController::initializePlugins(), te::common::UserApplicationSettings::load(), te::qt::af::ApplicationPlugins::load(), te::qt::af::BaseApplication::makeDialog(), te::vp::IntersectionDialog::onOkPushButtonClicked(), te::vp::BufferDialog::onOkPushButtonClicked(), te::vp::AggregationDialog::onOkPushButtonClicked(), te::qt::af::BaseApplication::onStopDrawTriggered(), te::serialize::ReadFilter(), te::common::TaskProgress::setCurrentStep(), te::common::TaskProgress::setMessage(), te::color::ColorSchemeCatalog::setName(), te::common::TaskProgress::setTotalSteps(), te::common::TaskProgress::TaskProgress(), UnaryLogicOpReader(), UnaryLogicOpWriter(), and te::common::TaskProgress::~TaskProgress().
std::pair< std::vector< te::color::ColorSchemeCatalog * >::const_iterator, std::vector< te::color::ColorSchemeCatalog * >::const_iterator > te::color::ColorSchemeCatalogManager::getIterator | ( | ) | const |
It returns a pair of iterators over the catalogs of this manager.
Definition at line 92 of file ColorSchemeCatalogManager.cpp.
void te::color::ColorSchemeCatalogManager::insert | ( | ColorSchemeCatalog * | c | ) |
It inserts a new catalog that will be managed by ColorSchemeCatalogManager.
c | The new catalog to be managed by this manager. |
Exception | If the catalog already exists it will raise an exception. |
Definition at line 36 of file ColorSchemeCatalogManager.cpp.
References findByName(), te::color::ColorSchemeCatalog::getName(), m_catalogIdxByName, m_catalogs, and TR_COLOR.
bool te::color::ColorSchemeCatalogManager::isEmpty | ( | ) | const |
It returns true if the manager contains at least one catalog. If no catalog exists, it returns false.
Definition at line 103 of file ColorSchemeCatalogManager.cpp.
|
private |
Assignment operator not allowed.
rhs | The right-hand-side copy that would be used to copy from. |
|
friend |
Definition at line 77 of file ColorSchemeCatalogManager.h.
|
private |
An index from catalog's name to catalog's instance (note: we can not have duplicated names).
Definition at line 206 of file ColorSchemeCatalogManager.h.
Referenced by insert().
|
private |
This is the list of all system's loaded catalogs.
Definition at line 205 of file ColorSchemeCatalogManager.h.
Referenced by insert().