lwho / pioneer

A game of lonely space adventure
http://pioneerspacesim.net/
1 stars 0 forks source link

Migration to C++11 shared_ptr #28

Open lwho opened 10 years ago

lwho commented 10 years ago

http://pioneerspacesim.net/forum/viewtopic.php?f=3&t=267

Migration steps for a class

  1. Derive class from std::enable_shared_from_this
  2. RefCountedPtr<Class> to std::shared_ptr<Class>
  3. shared = bare_ptr->shared_from_this(); where necessary (there must already be a shared_ptr for the object.

    Current RefCounted classes

    • [ ] CameraContext
    • [ ] CollMesh
    • [ ] FileSystem::FileData
    • [ ] Galaxy
    • [ ] GalaxyGenerator
    • [ ] GalaxyObjectCache::Slave
    • [ ] GasPatchContext
    • [ ] GeoPatchContext
    • [ ] Graphics::GL2::RenderBuffer
    • [ ] Graphics::IndexBuffer
    • [ ] Graphics::Material
    • [ ] Graphics::Texture
    • [ ] Graphics::VertexBuffer
    • [ ] Random
    • [ ] SceneGraph::Node
    • [ ] Sector
    • [ ] StarSystem
    • [ ] SystemBody
    • [ ] Terrain
    • [ ] Text::DistanceFieldFont
    • [ ] Text::TextureFont
    • [ ] UI::Animation
    • [ ] UI::Widget