A IdentifierFactory is a factory in charge of creating IdentifierData.
More...
#include <Identifier.hh>
A IdentifierFactory is a factory in charge of creating IdentifierData.
A IdentifierFactory implements the singleton pattern, that is there is only one instance of the IdentifierFactory througout the process. It gathers the pool of allocated IdentifierData througout the process. IdentifierFactory guarantees that each IdentifierData is unique (no two IdentifierData with the same string)
Definition at line 522 of file Identifier.hh.
◆ Exception
◆ IdentifierFactory()
Diades::Utils::IdentifierFactory::IdentifierFactory |
( |
| ) |
|
|
inlineprotected |
◆ ~IdentifierFactory()
Diades::Utils::IdentifierFactory::~IdentifierFactory |
( |
| ) |
|
◆ destroy()
static void Diades::Utils::IdentifierFactory::destroy |
( |
| ) |
|
|
static |
Destroy the Identifier factory.
- Note
- Should be used only at the end of the process for proper memory management. Be aware that the use of the function destroys all the allocated Identifiers.
◆ factory()
◆ getIdentifier() [1/2]
Identifier Diades::Utils::IdentifierFactory::getIdentifier |
( |
unsigned |
id | ) |
|
- Parameters
-
- Returns
- the Identifier with the corresponding internal id If such an id does not exist, returns an invalid Identifier
◆ getIdentifier() [2/2]
Identifier Diades::Utils::IdentifierFactory::getIdentifier |
( |
const std::string & |
str | ) |
|
- Parameters
-
- Returns
- the Identifier associated to the string str
- Precondition
- This method WILL fail if str is not a proper identifier (that is a alphabetic character followed by alphabetic,numeric,'_' characters)
◆ typeName()
static string Diades::Utils::IdentifierFactory::typeName |
( |
| ) |
|
|
inlinestatic |
◆ _dictionary
unordered_map<string,unsigned> Diades::Utils::IdentifierFactory::_dictionary |
|
private |
◆ _identifiers
vector<Identifier> Diades::Utils::IdentifierFactory::_identifiers |
|
private |
◆ _instance
◆ _rankings
map<double,Identifier> Diades::Utils::IdentifierFactory::_rankings |
|
private |
The documentation for this class was generated from the following file:
- /home/yannick/laas/redmine/tools/diades/include/diades/utils/Identifier.hh