Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Efficient Object Management

Efficient Object Management

Scheduled Pinned Locked Moved C / C++ / MFC
questioncareer
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex H 1983
    wrote on last edited by
    #1

    I need an Efficient Object Management Class to add, remove, get and set (Manage Actually) objects of my own class. I read somewhere that std::list will do this job but i did not find the function for removing objects or get or set properties of existing objects. Any suggestions?

    C 1 Reply Last reply
    0
    • A Alex H 1983

      I need an Efficient Object Management Class to add, remove, get and set (Manage Actually) objects of my own class. I read somewhere that std::list will do this job but i did not find the function for removing objects or get or set properties of existing objects. Any suggestions?

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Your question is not really clear but it sesems that you simply need some kind of container (std::list is a container class). Why do you call the an "Object Management Class" ? Anyway, the way to access elements in a std::list is by using an iterator. The iterator overload * and -> operators that give you access to the object pointed by the iterator. To remove objects, simply erase the iterator (it has an erase member function). But I suggest that you first read some tutorial about how to use those classes from the STL because it could be quite difficult to start with that without a good tutorial. Just google for it and I am sure you'll find plenty.

      Cédric Moonen Software developer
      Charting control [v1.4] OpenGL game tutorial in C++

      A 1 Reply Last reply
      0
      • C Cedric Moonen

        Your question is not really clear but it sesems that you simply need some kind of container (std::list is a container class). Why do you call the an "Object Management Class" ? Anyway, the way to access elements in a std::list is by using an iterator. The iterator overload * and -> operators that give you access to the object pointed by the iterator. To remove objects, simply erase the iterator (it has an erase member function). But I suggest that you first read some tutorial about how to use those classes from the STL because it could be quite difficult to start with that without a good tutorial. Just google for it and I am sure you'll find plenty.

        Cédric Moonen Software developer
        Charting control [v1.4] OpenGL game tutorial in C++

        A Offline
        A Offline
        Alex H 1983
        wrote on last edited by
        #3

        thanks for your help :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups