Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2007, 1:19:13 AM (16 years ago)
Author:
rgrieder
Message:
  • some minor change in static initialisation of factory (this concept could be adopted to the other singletons in the factory as well)
File:
1 edited

Legend:

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

    r552 r553  
    3838            static void createClassHierarchy();
    3939
     40            static Factory* getFactoryPointer();// avoid overriding pointer_s in the static intialisation process
     41
    4042        private:
    4143            Factory() {}                            // don't create
    4244            Factory(const Factory& factory) {}      // don't copy
    4345            ~Factory() {}                           // don't delete
     46            static void checkPointer();
    4447
    45             /**
    46                 @brief Checks if the pointer to the only Factory-object exists and creates it, if not.
    47             */
    48             inline static void checkPointer()
    49             {
    50                 if (!pointer_s)
    51                     pointer_s = new Factory;
    52             }
    53 
    54             static Factory* pointer_s;                                          //!< The pointer to the singleton
    5548            std::map<std::string, Identifier*> identifierStringMap_;            //!< The map, mapping the name with the Identifier
    5649            std::map<unsigned int, Identifier*> identifierNetworkIDMap_;        //!< The map, mapping the network ID with the Identifier
Note: See TracChangeset for help on using the changeset viewer.