Efficient Object Management
-
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?
-
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?
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++ -
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++thanks for your help :)