Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2015, 11:22:21 PM (9 years ago)
Author:
landauf
Message:

use an unordered map and type_index to store identifiers by typeid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.h

    r10769 r10988  
    3737#include "core/CorePrereqs.h"
    3838
     39#include <typeindex>
    3940#include <map>
     41#include <unordered_map>
    4042#include <set>
    4143#include <list>
     
    102104                { hierarchyCreatingCounter_s--; }
    103105
    104             std::set<Identifier*> identifiers_;                              //!< All identifiers. This is only used internally.
    105             std::map<std::string, Identifier*> identifierByString_;          //!< Map that stores all Identifiers with their names.
    106             std::map<std::string, Identifier*> identifierByLowercaseString_; //!< Map that stores all Identifiers with their names in lowercase.
    107             std::map<uint32_t, Identifier*> identifierByNetworkId_;          //!< Returns the map that stores all Identifiers with their network IDs.
     106            std::set<Identifier*> identifiers_;                                      //!< All identifiers. This is only used internally.
     107            std::unordered_map<std::type_index, Identifier*> identifierByTypeIndex_; //!< Map that stores all Identifiers with their type_index.
     108            std::map<std::string, Identifier*> identifierByString_;                  //!< Map that stores all Identifiers with their names.
     109            std::map<std::string, Identifier*> identifierByLowercaseString_;         //!< Map that stores all Identifiers with their names in lowercase.
     110            std::map<uint32_t, Identifier*> identifierByNetworkId_;                  //!< Returns the map that stores all Identifiers with their network IDs.
    108111
    109112            int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
Note: See TracChangeset for help on using the changeset viewer.