The point of that paragraph was basically stating that I could only find builtin functions for determining parents of programs and not objects.
Object parents is a totally different thing. There used to be a parent_of (or similar) function, but I think it was removed for some reason. Object parenting/childs occur when you do things like this:
class Parent { int x; class Child { ...x... }
Child child() { return Child(); } }
which is orthogonal from inheritance. Note the use of 'x'. (Without that, you might not get a parent/child relation.)
So I can find all the children of a specified object!! *grin*
That is rather easy in most projects I've been involved with, the number of objects has been rather limited, or already placed in easy-to-reach lists...
Again, why do you want to find all usage of a specific program (which I still assume is what you ask for)? The only place I can see where that might be useful is in mud environments...
/ Mirar
Previous text:
2003-03-04 00:16: Subject: Children and Clones
Your terminology confuses me.
Don't worry, it confuses me sometimes too! Actually just frazzled right now so I sometimes type without thinking.
Mirar:
Programs can only inherit programs, not objects? Sounds complicated.
Martin Stjernholm:
Your terminology confuses me. You seem to mean "program" in many
cases
where you talk about "object"; it's for instance not possible to inherit an object - only programs (aka classes) can be inherited.
Sorry for the misunderstanding, the "clones of a specified object" part was just retardedness, forgive me my lack of caffeine, but the one "save the pointer to the program in the array if it inherits Obj X, iterate again," was meant to read "if it inherits Program X",
The point of that paragraph was basically stating that I could only find builtin functions for determining parents of programs and not objects.
As for your code Mirar, thanks for the time to post the idea, it is what I was basically thinking about already if there were no builtin solutions. The only major annoyance I had with that Idea was in the cleaning up of destroyed objects in the list (which was more due to laziness on my part and which your idea of set_weak_flag() takes care of quite nicely). A minor problem was that I was just being generally lazy and hoping there was something available to make it easier to find the children of an object.
Blah! It's just as simple to add it myself, I suppose =)
Mirar:
For what purpose?
So I can find all the children of a specified object!! *grin*
Kaylus
/ kaylus