Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 7, 2015, 5:24:58 PM (8 years ago)
Author:
landauf
Message:

using std::shared_ptr instead of boost::shared_ptr (same for weak_ptr)

File:
1 edited

Legend:

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

    r10769 r10771  
    4444#include <string>
    4545#include <vector>
    46 #include <boost/shared_ptr.hpp>
     46#include <memory>
    4747#include <boost/preprocessor/cat.hpp>
    4848
     
    8484    { // tolua_export
    8585        friend class Singleton<Game>;
    86         typedef std::vector<shared_ptr<GameState>> GameStateVector;
    87         typedef std::map<std::string, shared_ptr<GameState>> GameStateMap;
    88         typedef shared_ptr<GameStateTreeNode> GameStateTreeNodePtr;
     86        typedef std::vector<std::shared_ptr<GameState>> GameStateVector;
     87        typedef std::map<std::string, std::shared_ptr<GameState>> GameStateMap;
     88        typedef std::shared_ptr<GameStateTreeNode> GameStateTreeNodePtr;
    8989
    9090    public:
     
    9797
    9898        void setStateHierarchy(const std::string& str);
    99         shared_ptr<GameState> getState(const std::string& name);
     99        std::shared_ptr<GameState> getState(const std::string& name);
    100100
    101101        void run();
     
    123123        public:
    124124            virtual ~GameStateFactory() { }
    125             static shared_ptr<GameState> fabricate(const GameStateInfo& info);
     125            static std::shared_ptr<GameState> fabricate(const GameStateInfo& info);
    126126            template <class T>
    127127            static void createFactory(const std::string& className)
    128128                { getFactories()[className].reset(new TemplateGameStateFactory<T>()); }
    129129
    130             virtual shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;
    131             static std::map<std::string, shared_ptr<GameStateFactory>>& getFactories();
     130            virtual std::shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;
     131            static std::map<std::string, std::shared_ptr<GameStateFactory>>& getFactories();
    132132        };
    133133        template <class T>
     
    135135        {
    136136        public:
    137             shared_ptr<GameState> fabricateInternal(const GameStateInfo& info)
    138                 { return shared_ptr<GameState>(new T(info)); }
     137            std::shared_ptr<GameState> fabricateInternal(const GameStateInfo& info)
     138                { return std::shared_ptr<GameState>(new T(info)); }
    139139        };
    140140
     
    150150        void unloadGraphics(bool loadGraphicsManagerWithoutRenderer = true);
    151151
    152         void parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode);
     152        void parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, std::shared_ptr<GameStateTreeNode> currentNode);
    153153        bool checkState(const std::string& name) const;
    154154        void loadState(const std::string& name);
Note: See TracChangeset for help on using the changeset viewer.