Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 27, 2007, 5:49:03 AM (16 years ago)
Author:
landauf
Message:

hopefully replaced all static pre-main variables with more secure wrapper functions. and now i'll sleep.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/Identifier.h

    r696 r698  
    137137                { this->configValues_[varname] = container; }
    138138
    139             std::map<std::string, Identifier*>& getIdentifierMap();
     139            static std::map<std::string, Identifier*>& getIdentifierMap();
    140140
    141141        private:
     
    171171            bool bCreatedOneObject_;                                    //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
    172172            static 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)
    173             static unsigned int classIDcounter_s;                       //!< The number of existing Identifiers
    174173            unsigned int classID_;                                      //!< The network ID to identify a class through the network
    175174            std::map<std::string, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer
     
    197196        private:
    198197            ClassIdentifier();
    199             ClassIdentifier(const ClassIdentifier<T>& identifier) {} // don't copy
    200             ~ClassIdentifier();
     198            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
     199            ~ClassIdentifier() {}                                       // don't delete
    201200
    202201            ObjectList<T>* objects_;    //!< The ObjectList, containing all objects of type T
     
    211210    ClassIdentifier<T>::ClassIdentifier()
    212211    {
    213         this->objects_ = new ObjectList<T>;
     212        this->objects_ = ObjectList<T>::getList();
    214213        this->bSetName_ = false;
    215     }
    216 
    217     /**
    218         @brief Destructor: Deletes the ObjectList, sets the singleton-pointer to zero.
    219     */
    220     template <class T>
    221     ClassIdentifier<T>::~ClassIdentifier()
    222     {
    223         delete this->objects_;
    224214    }
    225215
Note: See TracChangeset for help on using the changeset viewer.