Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9641


Ignore:
Timestamp:
Aug 11, 2013, 9:33:11 PM (11 years ago)
Author:
landauf
Message:

removed mutual friend declarations between Identifier and IdentifierManager

Location:
code/branches/core6/src/libraries/core/class
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/libraries/core/class/Identifier.cc

    r9640 r9641  
    5050    */
    5151    Identifier::Identifier()
    52         : classID_(IdentifierManager::getInstance().classIDCounter_s++)
     52        : classID_(IdentifierManager::getInstance().getUniqueClassId())
    5353    {
    5454        this->bCreatedOneObject_ = false;
     
    155155            this->name_ = name;
    156156            this->bSetName_ = true;
    157             IdentifierManager::getInstance().identifierByString_[name] = this;
    158             IdentifierManager::getInstance().identifierByLowercaseString_[getLowercase(name)] = this;
    159             IdentifierManager::getInstance().identifierByNetworkId_[this->networkID_] = this;
     157            IdentifierManager::getInstance().registerIdentifier(this);
    160158        }
    161159    }
     
    195193    void Identifier::setNetworkID(uint32_t id)
    196194    {
    197 //        Identifier::getIDIdentifierMapIntern().erase(this->networkID_);
    198         IdentifierManager::getInstance().identifierByNetworkId_[id] = this;
    199195        this->networkID_ = id;
     196        IdentifierManager::getInstance().registerIdentifier(this);
    200197    }
    201198
  • code/branches/core6/src/libraries/core/class/Identifier.h

    r9640 r9641  
    106106    class _CoreExport Identifier
    107107    {
    108         friend class IdentifierManager;
    109 
    110108        public:
     109            Identifier();
     110            Identifier(const Identifier& identifier); // don't copy
     111            virtual ~Identifier();
     112
    111113            /// Returns the name of the class the Identifier belongs to.
    112114            inline const std::string& getName() const { return this->name_; }
     
    209211
    210212        protected:
    211             Identifier();
    212             Identifier(const Identifier& identifier); // don't copy
    213             virtual ~Identifier();
    214 
    215213            virtual void createSuperFunctionCaller() const = 0;
    216214
  • code/branches/core6/src/libraries/core/class/IdentifierManager.cc

    r9640 r9641  
    7777            return proposal;
    7878        }
     79    }
     80
     81    /**
     82     * Registers the identifier in all maps of the IdentifierManager.
     83     */
     84    void IdentifierManager::registerIdentifier(Identifier* identifier)
     85    {
     86        IdentifierManager::getInstance().identifierByString_[identifier->getName()] = identifier;
     87        IdentifierManager::getInstance().identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier;
     88        IdentifierManager::getInstance().identifierByNetworkId_[identifier->getNetworkID()] = identifier;
    7989    }
    8090
  • code/branches/core6/src/libraries/core/class/IdentifierManager.h

    r9640 r9641  
    4444    class _CoreExport IdentifierManager
    4545    {
    46         friend class Identifier;
    47         template <class T> friend class ClassIdentifier;
    48 
    4946        public:
    5047            static IdentifierManager& getInstance();
     
    5350            ////// Class Hierarchy //////
    5451            /////////////////////////////
     52            Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);
     53
     54            unsigned int getUniqueClassId()
     55                { return this->classIDCounter_s++; }
     56
     57            void registerIdentifier(Identifier* identifier);
     58
    5559            void createClassHierarchy();
    5660
     
    101105                { return this->identifierByNetworkId_.end(); }
    102106
    103         protected:
    104             Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);
    105 
    106107        private:
    107108            IdentifierManager();
Note: See TracChangeset for help on using the changeset viewer.