Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10771


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

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

Location:
code/branches/cpp11_v2/src
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/OrxonoxConfig.h.in

    r10769 r10771  
    216216}
    217217
    218 // Import general purpose smart pointers
    219 namespace boost
    220 {
    221     template<class T> class scoped_ptr;
    222     template<class T> class shared_ptr;
    223     template<class T> class weak_ptr;
    224     template<class T> class intrusive_ptr;
    225     template<class T> class shared_array;
    226     template<class T> class scoped_array;
    227 }
    228 namespace orxonox
    229 {
    230     using boost::scoped_ptr;
    231     using boost::shared_ptr;
    232     using boost::weak_ptr;
    233     using boost::intrusive_ptr;
    234     using boost::shared_array;
    235     using boost::scoped_array;
    236 }
    237 
    238218// Define Boost Filesystem version
    239219#include <boost/version.hpp>
  • code/branches/cpp11_v2/src/external/cpptcl/cpptcl.cc

    r8351 r10771  
    1717using namespace Tcl::details;
    1818using namespace std;
    19 // boost::shared_ptr conflicts with the new std::shared_ptr
    20 //using namespace boost;
    21 
    2219
    2320result::result(Tcl_Interp *interp) : interp_(interp) {}
     
    168165
    169166// map of polymorphic callbacks
    170 typedef map<string, boost::shared_ptr<callback_base> > callback_interp_map;
     167typedef map<string, std::shared_ptr<callback_base> > callback_interp_map;
    171168typedef map<Tcl_Interp *, callback_interp_map> callback_map;
    172169
     
    181178
    182179// map of object handlers
    183 typedef map<string, boost::shared_ptr<class_handler_base> > class_interp_map;
     180typedef map<string, std::shared_ptr<class_handler_base> > class_interp_map;
    184181typedef map<Tcl_Interp *, class_interp_map> class_handlers_map;
    185182
     
    492489
    493490void class_handler_base::register_method(string const &name,
    494      boost::shared_ptr<object_cmd_base> ocb, policies const &p)
     491     std::shared_ptr<object_cmd_base> ocb, policies const &p)
    495492{
    496493     methods_[name] = ocb;
     
    991988
    992989void interpreter::add_function(string const &name,
    993      boost::shared_ptr<callback_base> cb, policies const &p)
     990     std::shared_ptr<callback_base> cb, policies const &p)
    994991{
    995992     Tcl_CreateObjCommand(interp_, name.c_str(),
     
    1001998
    1002999void interpreter::add_class(string const &name,
    1003      boost::shared_ptr<class_handler_base> chb)
     1000     std::shared_ptr<class_handler_base> chb)
    10041001{
    10051002     class_handlers[interp_][name] = chb;
     
    10071004
    10081005void interpreter::add_constructor(string const &name,
    1009      boost::shared_ptr<class_handler_base> chb, boost::shared_ptr<callback_base> cb,
     1006     std::shared_ptr<class_handler_base> chb, std::shared_ptr<callback_base> cb,
    10101007     policies const &p)
    10111008{
  • code/branches/cpp11_v2/src/external/cpptcl/cpptcl.h

    r5781 r10771  
    1717#include <map>
    1818#include <vector>
    19 #include <boost/shared_ptr.hpp>
    2019#include <boost/bind.hpp>
    2120
     
    141140
    142141     void register_method(std::string const &name,
    143           boost::shared_ptr<object_cmd_base> ocb, policies const &p);
     142          std::shared_ptr<object_cmd_base> ocb, policies const &p);
    144143
    145144     policies & get_policies(std::string const &name);
     
    148147     typedef std::map<
    149148          std::string,
    150           boost::shared_ptr<object_cmd_base>
     149          std::shared_ptr<object_cmd_base>
    151150          > method_map_type;
    152151
     
    214213{
    215214public:
    216      class_definer(boost::shared_ptr<class_handler<C> > ch) : ch_(ch) {}
     215     class_definer(std::shared_ptr<class_handler<C> > ch) : ch_(ch) {}
    217216
    218217     template <typename R>
     
    221220     {
    222221          ch_->register_method(name,
    223                boost::shared_ptr<details::object_cmd_base>(
     222               std::shared_ptr<details::object_cmd_base>(
    224223                    new details::method0<C, R>(f)), p);
    225224          return *this;
     
    231230     {
    232231          ch_->register_method(name,
    233                boost::shared_ptr<details::object_cmd_base>(
     232               std::shared_ptr<details::object_cmd_base>(
    234233                    new details::method0<C, R>(f)), p);
    235234          return *this;
     
    241240     {
    242241          ch_->register_method(name,
    243                boost::shared_ptr<details::object_cmd_base>(
     242               std::shared_ptr<details::object_cmd_base>(
    244243                    new details::method1<C, R, T1>(f)), p);
    245244          return *this;
     
    251250     {
    252251          ch_->register_method(name,
    253                boost::shared_ptr<details::object_cmd_base>(
     252               std::shared_ptr<details::object_cmd_base>(
    254253                    new details::method1<C, R, T1>(f)), p);
    255254          return *this;
     
    261260     {
    262261          ch_->register_method(name,
    263                boost::shared_ptr<details::object_cmd_base>(
     262               std::shared_ptr<details::object_cmd_base>(
    264263                    new details::method2<C, R, T1, T2>(f)), p);
    265264          return *this;
     
    271270     {
    272271          ch_->register_method(name,
    273                boost::shared_ptr<details::object_cmd_base>(
     272               std::shared_ptr<details::object_cmd_base>(
    274273                    new details::method2<C, R, T1, T2>(f)), p);
    275274          return *this;
     
    281280     {
    282281          ch_->register_method(name,
    283                boost::shared_ptr<details::object_cmd_base>(
     282               std::shared_ptr<details::object_cmd_base>(
    284283                    new details::method3<C, R, T1, T2, T3>(f)), p);
    285284          return *this;
     
    291290     {
    292291          ch_->register_method(name,
    293                boost::shared_ptr<details::object_cmd_base>(
     292               std::shared_ptr<details::object_cmd_base>(
    294293                    new details::method3<C, R, T1, T2, T3>(f)), p);
    295294          return *this;
     
    301300     {
    302301          ch_->register_method(name,
    303                boost::shared_ptr<details::object_cmd_base>(
     302               std::shared_ptr<details::object_cmd_base>(
    304303                    new details::method4<C, R, T1, T2, T3, T4>(f)), p);
    305304          return *this;
     
    312311     {
    313312          ch_->register_method(name,
    314                boost::shared_ptr<details::object_cmd_base>(
     313               std::shared_ptr<details::object_cmd_base>(
    315314                    new details::method4<C, R, T1, T2, T3, T4>(f)), p);
    316315          return *this;
     
    323322     {
    324323          ch_->register_method(name,
    325                boost::shared_ptr<details::object_cmd_base>(
     324               std::shared_ptr<details::object_cmd_base>(
    326325                    new details::method5<C, R, T1, T2, T3, T4, T5>(f)), p);
    327326          return *this;
     
    334333     {
    335334          ch_->register_method(name,
    336                boost::shared_ptr<details::object_cmd_base>(
     335               std::shared_ptr<details::object_cmd_base>(
    337336                    new details::method5<C, R, T1, T2, T3, T4, T5>(f)), p);
    338337          return *this;
     
    345344     {
    346345          ch_->register_method(name,
    347                boost::shared_ptr<details::object_cmd_base>(
     346               std::shared_ptr<details::object_cmd_base>(
    348347                    new details::method6<C, R, T1, T2, T3, T4, T5, T6>(f)),
    349348               p);
     
    358357     {
    359358          ch_->register_method(name,
    360                boost::shared_ptr<details::object_cmd_base>(
     359               std::shared_ptr<details::object_cmd_base>(
    361360                    new details::method6<C, R, T1, T2, T3, T4, T5, T6>(f)),
    362361               p);
     
    371370     {
    372371          ch_->register_method(name,
    373                boost::shared_ptr<details::object_cmd_base>(
     372               std::shared_ptr<details::object_cmd_base>(
    374373                    new details::method7<C, R,
    375374                    T1, T2, T3, T4, T5, T6, T7>(f)), p);
     
    384383     {
    385384          ch_->register_method(name,
    386                boost::shared_ptr<details::object_cmd_base>(
     385               std::shared_ptr<details::object_cmd_base>(
    387386                    new details::method7<C, R,
    388387                    T1, T2, T3, T4, T5, T6, T7>(f)), p);
     
    397396     {
    398397          ch_->register_method(name,
    399                boost::shared_ptr<details::object_cmd_base>(
     398               std::shared_ptr<details::object_cmd_base>(
    400399                    new details::method8<C, R,
    401400                    T1, T2, T3, T4, T5, T6, T7, T8>(f)), p);
     
    410409     {
    411410          ch_->register_method(name,
    412                boost::shared_ptr<details::object_cmd_base>(
     411               std::shared_ptr<details::object_cmd_base>(
    413412                    new details::method8<C, R,
    414413                    T1, T2, T3, T4, T5, T6, T7, T8>(f)), p);
     
    423422     {
    424423          ch_->register_method(name,
    425                boost::shared_ptr<details::object_cmd_base>(
     424               std::shared_ptr<details::object_cmd_base>(
    426425                    new details::method9<C, R,
    427426                    T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p);
     
    436435     {
    437436          ch_->register_method(name,
    438                boost::shared_ptr<details::object_cmd_base>(
     437               std::shared_ptr<details::object_cmd_base>(
    439438                    new details::method9<C, R,
    440439                    T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p);
     
    443442
    444443private:
    445      boost::shared_ptr<class_handler<C> > ch_;
     444     std::shared_ptr<class_handler<C> > ch_;
    446445};
    447446
     
    482481     {
    483482          add_function(name,
    484                boost::shared_ptr<details::callback_base>(
     483               std::shared_ptr<details::callback_base>(
    485484                    new details::callback0<R>(f)), p);
    486485     }
     
    491490     {
    492491          add_function(name,
    493                boost::shared_ptr<details::callback_base>(
     492               std::shared_ptr<details::callback_base>(
    494493                    new details::callback1<R, T1>(f)), p);
    495494     }
     
    500499     {
    501500          add_function(name,
    502                boost::shared_ptr<details::callback_base>(
     501               std::shared_ptr<details::callback_base>(
    503502                    new details::callback2<R, T1, T2>(f)), p);
    504503     }
     
    509508     {
    510509          add_function(name,
    511                boost::shared_ptr<details::callback_base>(
     510               std::shared_ptr<details::callback_base>(
    512511                    new details::callback3<R, T1, T2, T3>(f)), p);
    513512     }
     
    518517     {
    519518          add_function(name,
    520                boost::shared_ptr<details::callback_base>(
     519               std::shared_ptr<details::callback_base>(
    521520                    new details::callback4<R, T1, T2, T3, T4>(f)), p);
    522521     }
     
    528527     {
    529528          add_function(name,
    530                boost::shared_ptr<details::callback_base>(
     529               std::shared_ptr<details::callback_base>(
    531530                    new details::callback5<R, T1, T2, T3, T4, T5>(f)), p);
    532531     }
     
    538537     {
    539538          add_function(name,
    540                boost::shared_ptr<details::callback_base>(
     539               std::shared_ptr<details::callback_base>(
    541540                    new details::callback6<R, T1, T2, T3, T4, T5, T6>(f)), p);
    542541     }
     
    548547     {
    549548          add_function(name,
    550                boost::shared_ptr<details::callback_base>(
     549               std::shared_ptr<details::callback_base>(
    551550                    new details::callback7<R,
    552551                    T1, T2, T3, T4, T5, T6, T7>(f)), p);
     
    559558     {
    560559          add_function(name,
    561                boost::shared_ptr<details::callback_base>(
     560               std::shared_ptr<details::callback_base>(
    562561                    new details::callback8<R,
    563562                    T1, T2, T3, T4, T5, T6, T7, T8>(f)), p);
     
    572571     {
    573572          add_function(name,
    574                boost::shared_ptr<details::callback_base>(
     573               std::shared_ptr<details::callback_base>(
    575574                    new details::callback9<R,
    576575                    T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p);
     
    583582     details::class_definer<C> class_(std::string const &name)
    584583     {
    585           boost::shared_ptr<details::class_handler<C> > ch(
     584          std::shared_ptr<details::class_handler<C> > ch(
    586585               new details::class_handler<C>());
    587586
     
    589588
    590589          add_constructor(name, ch,
    591                boost::shared_ptr<details::callback_base>(
     590               std::shared_ptr<details::callback_base>(
    592591                    new details::callback0<C*>(&details::construct<
    593592                         C, void, void, void, void, void, void, void,
     
    608607               callback_type;
    609608
    610           boost::shared_ptr<details::class_handler<C> > ch(
     609          std::shared_ptr<details::class_handler<C> > ch(
    611610               new details::class_handler<C>());
    612611
     
    614613
    615614          add_constructor(name, ch,
    616                boost::shared_ptr<details::callback_base>(
     615               std::shared_ptr<details::callback_base>(
    617616                    new callback_type(&details::construct<
    618617                         C, T1, T2, T3, T4, T5, T6, T7, T8, T9>::doit)), p);
     
    625624          std::string const &name, details::no_init_type const &)
    626625     {
    627           boost::shared_ptr<details::class_handler<C> > ch(
     626          std::shared_ptr<details::class_handler<C> > ch(
    628627               new details::class_handler<C>());
    629628
     
    660659
    661660     void add_function(std::string const &name,
    662           boost::shared_ptr<details::callback_base> cb,
     661          std::shared_ptr<details::callback_base> cb,
    663662          policies const &p = policies());
    664663
    665664     void add_class(std::string const &name,
    666           boost::shared_ptr<details::class_handler_base> chb);
     665          std::shared_ptr<details::class_handler_base> chb);
    667666
    668667     void add_constructor(std::string const &name,
    669           boost::shared_ptr<details::class_handler_base> chb,
    670           boost::shared_ptr<details::callback_base> cb,
     668          std::shared_ptr<details::class_handler_base> chb,
     669          std::shared_ptr<details::callback_base> cb,
    671670          policies const &p = policies());
    672671
  • code/branches/cpp11_v2/src/libraries/core/CorePrecompiledHeaders.h

    r8858 r10771  
    5050#include <sstream>  // 53
    5151#include <set>      // 50
     52#include <memory>
    5253
    5354#include "util/Output.h" // 48
     
    6667#include <OgreColourValue.h> // 36
    6768#include <boost/preprocessor/cat.hpp> // 27
    68 #include <boost/shared_ptr.hpp> // 21
    6969
    7070#ifdef ORXONOX_COMPILER_MSVC
     
    7676#include "util/SubString.h"  // 14
    7777
    78 #include <boost/scoped_ptr.hpp> // 13
    7978#include <stack> // 12
    8079
  • code/branches/cpp11_v2/src/libraries/core/GUIManager.h

    r10768 r10771  
    4040#include <map>
    4141#include <string>
     42#include <memory>
    4243
    4344#if CEGUI_VERSION >= 0x000800
     
    4849#   include <CEGUIVersion.h>
    4950#endif
    50 
    51 #include <boost/shared_ptr.hpp>
    5251
    5352#include "util/DestructionHelper.h"
     
    196195        CEGUI::LuaScriptModule*              scriptModule_;         //!< CEGUI's script module to use Lua
    197196        CEGUI::System*                       guiSystem_;            //!< CEGUI's main system
    198         shared_ptr<ResourceInfo>             rootFileInfo_;         //!< Resource information about the root script
     197        std::shared_ptr<ResourceInfo>        rootFileInfo_;         //!< Resource information about the root script
    199198        CEGUI::Logger*                       ceguiLogger_;          //!< CEGUI's logger to be able to log CEGUI errors in our log
    200199        int                                  outputLevelCeguiLog_;  //!< CEGUI's log level
  • code/branches/cpp11_v2/src/libraries/core/Game.cc

    r10769 r10771  
    3636
    3737#include <exception>
    38 #include <boost/weak_ptr.hpp>
    3938#include <loki/ScopeGuard.h>
    4039
     
    7271    {
    7372        std::string name_;
    74         weak_ptr<GameStateTreeNode> parent_;
    75         std::vector<shared_ptr<GameStateTreeNode>> children_;
     73        std::weak_ptr<GameStateTreeNode> parent_;
     74        std::vector<std::shared_ptr<GameStateTreeNode>> children_;
    7675    };
    7776
     
    124123
    125124        // The empty root state is ALWAYS loaded!
    126         this->rootStateNode_ = shared_ptr<GameStateTreeNode>(new GameStateTreeNode());
     125        this->rootStateNode_ = std::shared_ptr<GameStateTreeNode>(new GameStateTreeNode());
    127126        this->rootStateNode_->name_ = "emptyRootGameState";
    128127        this->loadedTopStateNode_ = this->rootStateNode_;
     
    137136
    138137        assert(loadedStates_.size() <= 1); // Just empty root GameState
    139         // Destroy all GameStates (shared_ptrs take care of actual destruction)
     138        // Destroy all GameStates (std::shared_ptrs take care of actual destruction)
    140139        constructedStates_.clear();
    141140
     
    235234        while (this->requestedStateNodes_.size() > 0)
    236235        {
    237             shared_ptr<GameStateTreeNode> requestedStateNode = this->requestedStateNodes_.front();
     236            std::shared_ptr<GameStateTreeNode> requestedStateNode = this->requestedStateNodes_.front();
    238237            assert(this->loadedTopStateNode_);
    239238            if (!this->loadedTopStateNode_->parent_.expired() && requestedStateNode == this->loadedTopStateNode_->parent_.lock())
     
    281280                orxout(user_error) << "This should really never happen!" << endl;
    282281                orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl;
    283                 shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
     282                std::shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
    284283                while (current->name_ != (*it)->getName() && current)
    285284                    current = current->parent_.lock();
     
    372371        }
    373372
    374         shared_ptr<GameStateTreeNode> lastRequestedNode;
     373        std::shared_ptr<GameStateTreeNode> lastRequestedNode;
    375374        if (this->requestedStateNodes_.empty())
    376375            lastRequestedNode = this->loadedTopStateNode_;
     
    384383
    385384        // Check children first
    386         std::vector<shared_ptr<GameStateTreeNode>> requestedNodes;
     385        std::vector<std::shared_ptr<GameStateTreeNode>> requestedNodes;
    387386        for (unsigned int i = 0; i < lastRequestedNode->children_.size(); ++i)
    388387        {
     
    397396        {
    398397            // Check parent and all its grand parents
    399             shared_ptr<GameStateTreeNode> currentNode = lastRequestedNode;
     398            std::shared_ptr<GameStateTreeNode> currentNode = lastRequestedNode;
    400399            while (currentNode != nullptr)
    401400            {
     
    424423    void Game::popState()
    425424    {
    426         shared_ptr<GameStateTreeNode> lastRequestedNode;
     425        std::shared_ptr<GameStateTreeNode> lastRequestedNode;
    427426        if (this->requestedStateNodes_.empty())
    428427            lastRequestedNode = this->loadedTopStateNode_;
     
    435434    }
    436435
    437     shared_ptr<GameState> Game::getState(const std::string& name)
     436    std::shared_ptr<GameState> Game::getState(const std::string& name)
    438437    {
    439438        GameStateMap::const_iterator it = constructedStates_.find(name);
     
    447446            else
    448447                orxout(internal_error) << "Could not find GameState '" << name << "'." << endl;
    449             return shared_ptr<GameState>();
     448            return std::shared_ptr<GameState>();
    450449        }
    451450    }
     
    479478    /*** Internal ***/
    480479
    481     void Game::parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode)
     480    void Game::parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, std::shared_ptr<GameStateTreeNode> currentNode)
    482481    {
    483482        SubString tokens(it->first, ",");
     
    491490            if (tokens[i] == this->rootStateNode_->name_)
    492491                ThrowException(GameState, "You shouldn't use 'emptyRootGameState' in the hierarchy...");
    493             shared_ptr<GameStateTreeNode> node(new GameStateTreeNode());
     492            std::shared_ptr<GameStateTreeNode> node(new GameStateTreeNode());
    494493            node->name_ = tokens[i];
    495494            node->parent_ = currentNode;
     
    527526                {
    528527                    // Game state loading failure is serious --> don't catch
    529                     shared_ptr<GameState> gameState = GameStateFactory::fabricate(it->second);
     528                    std::shared_ptr<GameState> gameState = GameStateFactory::fabricate(it->second);
    530529                    if (!constructedStates_.insert(std::make_pair(
    531530                        it->second.stateName, gameState)).second)
     
    582581            graphicsUnloader.Dismiss();
    583582
    584         shared_ptr<GameState> state = this->getState(name);
     583        std::shared_ptr<GameState> state = this->getState(name);
    585584        state->activateInternal();
    586585        if (!this->loadedStates_.empty())
     
    599598        try
    600599        {
    601             shared_ptr<GameState> state = this->getState(name);
     600            std::shared_ptr<GameState> state = this->getState(name);
    602601            state->activity_.topState = false;
    603602            this->loadedStates_.pop_back();
     
    620619    }
    621620
    622     /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory>>& Game::GameStateFactory::getFactories()
    623     {
    624         static std::map<std::string, shared_ptr<GameStateFactory>> factories;
     621    /*static*/ std::map<std::string, std::shared_ptr<Game::GameStateFactory>>& Game::GameStateFactory::getFactories()
     622    {
     623        static std::map<std::string, std::shared_ptr<GameStateFactory>> factories;
    625624        return factories;
    626625    }
    627626
    628     /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info)
    629     {
    630         std::map<std::string, shared_ptr<Game::GameStateFactory>>::const_iterator it = getFactories().find(info.className);
     627    /*static*/ std::shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info)
     628    {
     629        std::map<std::string, std::shared_ptr<Game::GameStateFactory>>::const_iterator it = getFactories().find(info.className);
    631630        assert(it != getFactories().end());
    632631        return it->second->fabricateInternal(info);
  • 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);
  • code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc

    r10768 r10771  
    3434#include <sstream>
    3535#include <boost/filesystem.hpp>
    36 #include <boost/shared_array.hpp>
    3736
    3837#include <OgreFrameListener.h>
  • code/branches/cpp11_v2/src/libraries/core/GraphicsManager.h

    r10765 r10771  
    4747#include <cassert>
    4848#include <string>
     49#include <memory>
     50
    4951#include <OgreLog.h>
    50 #include <boost/shared_ptr.hpp>
    5152
    5253#include "util/DestructionHelper.h"
     
    130131
    131132        // XML files for the resources and the debug overlay
    132         shared_ptr<XMLFile> resources_;                //!< XML with resource locations
    133         shared_ptr<XMLFile> extResources_;             //!< XML with resource locations in the external path (only for dev runs)
    134         shared_ptr<XMLFile> debugOverlay_;             //!< XML with various debug overlays
     133        std::shared_ptr<XMLFile> resources_;           //!< XML with resource locations
     134        std::shared_ptr<XMLFile> extResources_;        //!< XML with resource locations in the external path (only for dev runs)
     135        std::shared_ptr<XMLFile> debugOverlay_;        //!< XML with various debug overlays
    135136
    136137        // config values
  • code/branches/cpp11_v2/src/libraries/core/Loader.cc

    r10769 r10771  
    7373        std::string xmlInput;
    7474
    75         shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> lineTrace(new std::vector<std::vector<std::pair<std::string, size_t>>>());
     75        std::shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> lineTrace(new std::vector<std::vector<std::pair<std::string, size_t>>>());
    7676        lineTrace->reserve(1000); //arbitrary number
    7777
     
    8080        {
    8181            // Use the LuaState to replace the XML tags (calls our function)
    82             scoped_ptr<LuaState> luaState(new LuaState());
     82            boost::scoped_ptr<LuaState> luaState(new LuaState());
    8383            luaState->setTraceMap(lineTrace);
    8484            luaState->setIncludeParser(&Loader::replaceLuaTags);
     
    8888        else
    8989        {
    90             shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename());
     90            std::shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename());
    9191            if (info == nullptr)
    9292            {
  • code/branches/cpp11_v2/src/libraries/core/LuaState.cc

    r10769 r10771  
    7979    }
    8080
    81     shared_ptr<ResourceInfo> LuaState::getFileInfo(const std::string& filename)
     81    std::shared_ptr<ResourceInfo> LuaState::getFileInfo(const std::string& filename)
    8282    {
    8383        // Look in the current directory first
    84         shared_ptr<ResourceInfo> sourceInfo = Resource::getInfo(sourceFileInfo_->path + filename);
     84        std::shared_ptr<ResourceInfo> sourceInfo = Resource::getInfo(sourceFileInfo_->path + filename);
    8585        // Continue search in root directories
    8686        if (sourceInfo == nullptr && !sourceFileInfo_->path.empty())
     
    9191    bool LuaState::includeFile(const std::string& filename)
    9292    {
    93         shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename);
     93        std::shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename);
    9494        if (sourceInfo != nullptr)
    9595            return this->includeString(Resource::open(sourceInfo)->getAsString(), sourceInfo);
     
    101101    }
    102102
    103     bool LuaState::includeString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo)
     103    bool LuaState::includeString(const std::string& code, const std::shared_ptr<ResourceInfo>& sourceFileInfo)
    104104    {
    105105        // Parse string with provided include parser (otherwise don't preparse at all)
     
    131131    bool LuaState::doFile(const std::string& filename)
    132132    {
    133         shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename);
     133        std::shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename);
    134134        if (sourceInfo != nullptr)
    135135            return this->doString(Resource::open(sourceInfo)->getAsString(), sourceInfo);
     
    141141    }
    142142
    143     bool LuaState::doString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo)
     143    bool LuaState::doString(const std::string& code, const std::shared_ptr<ResourceInfo>& sourceFileInfo)
    144144    {
    145145        // Save the old source file info
    146         shared_ptr<ResourceInfo> oldSourceFileInfo = sourceFileInfo_;
     146        std::shared_ptr<ResourceInfo> oldSourceFileInfo = sourceFileInfo_;
    147147        // Only override if sourceFileInfo provides useful information
    148148        if (sourceFileInfo != nullptr)
     
    285285    bool LuaState::fileExists(const std::string& filename)
    286286    {
    287         shared_ptr<ResourceInfo> info = this->getFileInfo(filename);
     287        std::shared_ptr<ResourceInfo> info = this->getFileInfo(filename);
    288288        if (info == nullptr)
    289289            return false;
     
    300300        if (it != this->sourceCodeMap_.end())
    301301            return it->second;
    302         shared_ptr<ResourceInfo> info = Resource::getInfo(filename);
     302        std::shared_ptr<ResourceInfo> info = Resource::getInfo(filename);
    303303        if (info == nullptr)
    304304            return "";
  • code/branches/cpp11_v2/src/libraries/core/LuaState.h

    r10769 r10771  
    4747#include <string>
    4848#include <vector>
    49 #include <boost/shared_ptr.hpp>
     49#include <memory>
    5050
    5151#include "util/Output.h"
     
    7979
    8080        bool doFile(const std::string& filename); // tolua_export
    81         bool doString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo = shared_ptr<ResourceInfo>());
     81        bool doString(const std::string& code, const std::shared_ptr<ResourceInfo>& sourceFileInfo = std::shared_ptr<ResourceInfo>());
    8282
    8383        bool includeFile(const std::string& filename); // tolua_export
    84         bool includeString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo = shared_ptr<ResourceInfo>());
     84        bool includeString(const std::string& code, const std::shared_ptr<ResourceInfo>& sourceFileInfo = std::shared_ptr<ResourceInfo>());
    8585
    8686        void luaPrint(const std::string& str); // tolua_export
     
    9494        void clearOutput() { output_.clear(); } // tolua_export
    9595
    96         void setTraceMap(shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> map)
     96        void setTraceMap(std::shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> map)
    9797            { map->push_back(std::vector<std::pair<std::string, size_t>>()); lineTrace_ = map; }
    9898
     
    100100        lua_State* getInternalLuaState() { return luaState_; }
    101101
    102         void setDefaultResourceInfo(const shared_ptr<ResourceInfo>& sourceFileInfo) { this->sourceFileInfo_ = sourceFileInfo; }
    103         const shared_ptr<ResourceInfo>& getDefaultResourceInfo() { return this->sourceFileInfo_; }
     102        void setDefaultResourceInfo(const std::shared_ptr<ResourceInfo>& sourceFileInfo) { this->sourceFileInfo_ = sourceFileInfo; }
     103        const std::shared_ptr<ResourceInfo>& getDefaultResourceInfo() { return this->sourceFileInfo_; }
    104104
    105105        LuaFunctor* createLuaFunctor(const std::string& code) { return new LuaFunctor(code, this); } // tolua_export
     
    115115
    116116    private:
    117         shared_ptr<ResourceInfo> getFileInfo(const std::string& filename);
    118         shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> lineTrace_;
     117        std::shared_ptr<ResourceInfo> getFileInfo(const std::string& filename);
     118        std::shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> lineTrace_;
    119119       
    120120        std::stringstream output_;
    121121        lua_State* luaState_;
    122122        bool bIsRunning_;
    123         shared_ptr<ResourceInfo> sourceFileInfo_;
     123        std::shared_ptr<ResourceInfo> sourceFileInfo_;
    124124        std::map<std::string, std::string> sourceCodeMap_;
    125125        std::string (*includeParseFunction_)(const std::string&);
  • code/branches/cpp11_v2/src/libraries/core/Resource.cc

    r10765 r10771  
    7979    }
    8080
    81     shared_ptr<ResourceInfo> Resource::getInfo(const std::string& name)
     81    std::shared_ptr<ResourceInfo> Resource::getInfo(const std::string& name)
    8282    {
    8383        std::string group;
     
    8888        catch (const Ogre::Exception&)
    8989        {
    90             return shared_ptr<ResourceInfo>();
     90            return std::shared_ptr<ResourceInfo>();
    9191        }
    9292        Ogre::FileInfoListPtr infos = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(group, name);
     
    9595            if (it->filename == name)
    9696            {
    97                 shared_ptr<ResourceInfo> ptr(new ResourceInfo());
     97                std::shared_ptr<ResourceInfo> ptr(new ResourceInfo());
    9898                ptr->filename = name;
    9999                ptr->path = it->path;
     
    114114            }
    115115        }
    116         return shared_ptr<ResourceInfo>();
     116        return std::shared_ptr<ResourceInfo>();
    117117    }
    118118
  • code/branches/cpp11_v2/src/libraries/core/Resource.h

    r8351 r10771  
    4242#include "CorePrereqs.h"
    4343
    44 #include <boost/shared_ptr.hpp>
     44#include <memory>
     45
    4546#include <OgreDataStream.h>
    4647#include <OgreStringVector.h>
     
    9394
    9495        //! Similar to open(string, string, bool), but with a fileInfo struct
    95         static DataStreamPtr open(shared_ptr<ResourceInfo> fileInfo)
     96        static DataStreamPtr open(std::shared_ptr<ResourceInfo> fileInfo)
    9697        {
    9798            return open(fileInfo->filename);
     
    125126            Fully qualified name of the file to test for
    126127        */
    127         static shared_ptr<ResourceInfo> getInfo(const std::string& name);
     128        static std::shared_ptr<ResourceInfo> getInfo(const std::string& name);
    128129
    129130        /**
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc

    r10768 r10771  
    188188    {
    189189        while (joyStickAxes_.size() < joySticks_.size())
    190             joyStickAxes_.push_back(shared_ptr<JoyStickAxisVector>(new JoyStickAxisVector()));
     190            joyStickAxes_.push_back(std::shared_ptr<JoyStickAxisVector>(new JoyStickAxisVector()));
    191191        while (joyStickButtons_.size() < joySticks_.size())
    192             joyStickButtons_.push_back(shared_ptr<JoyStickButtonVector>(new JoyStickButtonVector()));
     192            joyStickButtons_.push_back(std::shared_ptr<JoyStickButtonVector>(new JoyStickButtonVector()));
    193193        // For the case the new size is smaller
    194194        this->joyStickAxes_.resize(joySticks_.size());
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h

    r10769 r10771  
    3636#include <vector>
    3737#include <map>
    38 #include <boost/shared_ptr.hpp>
     38#include <memory>
    3939
    4040#include "InputHandler.h"
     
    127127        };
    128128        //! Actual key bindings for joy stick buttons
    129         std::vector<shared_ptr<JoyStickButtonVector>> joyStickButtons_;
     129        std::vector<std::shared_ptr<JoyStickButtonVector>> joyStickButtons_;
    130130        //! Helper class to use something like std:vector<HalfAxis[48]>
    131131        struct JoyStickAxisVector
     
    135135        };
    136136        //! Actual key bindings for joy stick axes (and sliders)
    137         std::vector<shared_ptr<JoyStickAxisVector>> joyStickAxes_;
     137        std::vector<std::shared_ptr<JoyStickAxisVector>> joyStickAxes_;
    138138
    139139        //! Pointer map with all Buttons, including half axes
  • code/branches/cpp11_v2/src/orxonox/sound/AmbientSound.cc

    r10765 r10771  
    9292        {
    9393            const std::string& path = "ambient/" + mood + '/' + this->ambientSource_;
    94             shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
     94            std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    9595            if (fileInfo != nullptr)
    9696            {
  • code/branches/cpp11_v2/src/orxonox/sound/BaseSound.h

    r9667 r10771  
    3333
    3434#include <string>
    35 #include <boost/shared_ptr.hpp>
     35#include <memory>
    3636#include <OgreDataStream.h>
    3737#include "core/object/Listable.h"
     
    107107        ALuint          audioSource_;
    108108        bool            bPooling_;
    109         shared_ptr<SoundBuffer> soundBuffer_;
     109        std::shared_ptr<SoundBuffer> soundBuffer_;
    110110        std::string     source_;
    111111        float           volume_;
  • code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.cc

    r10769 r10771  
    3939namespace orxonox
    4040{
    41     SoundBuffer::SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer>>::iterator poolIterator)
     41    SoundBuffer::SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator)
    4242        : filename_(filename)
    4343        , audioBuffer_(AL_NONE)
     
    4848
    4949        // Get resource info
    50         shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
     50        std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
    5151        if (fileInfo == nullptr)
    5252        {
     
    8383    }
    8484
    85     void SoundBuffer::loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
     85    void SoundBuffer::loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
    8686    {
    8787        // Read everything into a temporary buffer
     
    127127    }
    128128
    129     void SoundBuffer::loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
     129    void SoundBuffer::loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
    130130    {
    131131        char inbuffer[256*1024];
  • code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.h

    r10769 r10771  
    3333
    3434#include <list>
    35 #include <boost/shared_ptr.hpp>
     35#include <memory>
    3636#include "core/Resource.h"
    3737
     
    4545    {
    4646        friend class SoundManager;
    47 #if !defined(_MSC_VER) || _MSC_VER >= 1500
    48         // Make sure nobody deletes an instance (using strong pointers)
    49         template <class T>
    50         friend void boost::checked_delete(T*);
    51 #endif
    5247
    5348    public:
    54 #if defined(_MSC_VER) && _MSC_VER < 1500
    5549        ~SoundBuffer();
    56 #endif
    5750        inline ALuint getBuffer()
    5851            { return this->audioBuffer_; }
     
    6457
    6558    private:
    66         SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer>>::iterator poolIterator);
    67 #if !defined(_MSC_VER) || _MSC_VER >= 1500
    68         ~SoundBuffer();
    69 #endif
    70         void loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
    71         void loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
     59        SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator);
     60        void loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
     61        void loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
    7262
    7363        std::string filename_;
    7464        ALuint audioBuffer_;
    75         std::list<shared_ptr<SoundBuffer>>::iterator poolIterator_;
     65        std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator_;
    7666    };
    7767}
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc

    r10769 r10771  
    505505    }
    506506
    507     shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)
    508     {
    509         shared_ptr<SoundBuffer> buffer;
     507    std::shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)
     508    {
     509        std::shared_ptr<SoundBuffer> buffer;
    510510        // Check active or pooled buffers
    511511        SoundBufferMap::const_iterator it = this->soundBuffers_.find(filename);
     
    538538    }
    539539
    540     void SoundManager::releaseSoundBuffer(const shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)
     540    void SoundManager::releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)
    541541    {
    542542        // Check if others are still using the buffer
     
    551551                while (this->effectsPoolSize_ + it->second->getSize() > this->maxEffectsPoolSize_s && !this->effectsPool_.empty())
    552552                {
    553                     shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();
     553                    std::shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();
    554554                    this->effectsPoolSize_ -= bufferDel->getSize();
    555555                    bufferDel->poolIterator_ = this->effectsPool_.end();
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.h

    r10769 r10771  
    3636#include <map>
    3737#include <string>
    38 #include <boost/shared_ptr.hpp>
     38#include <memory>
    3939
    4040#include "util/Singleton.h"
     
    9696        // tolua_end
    9797
    98         shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);
    99         void releaseSoundBuffer(const shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);
     98        std::shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);
     99        void releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);
    100100
    101101        ALuint getSoundSource(BaseSound* object);
     
    139139        static const unsigned int maxEffectsPoolSize_s = 40 * 1024 * 1024;
    140140        unsigned int effectsPoolSize_;
    141         typedef std::list<shared_ptr<SoundBuffer>> EffectsPoolList;
     141        typedef std::list<std::shared_ptr<SoundBuffer>> EffectsPoolList;
    142142        EffectsPoolList effectsPool_;
    143         typedef std::map<std::string, shared_ptr<SoundBuffer>> SoundBufferMap;
     143        typedef std::map<std::string, std::shared_ptr<SoundBuffer>> SoundBufferMap;
    144144        SoundBufferMap soundBuffers_;
    145145
Note: See TracChangeset for help on using the changeset viewer.