Mickeysofine1972
December 23rd, 2007, 12:34 AM
Hey guys
Here's a weird one for you, I have a object that contains a vector list of pointers to objects of another class. within the other objects I have a vector list of pointers to yet another class of a different type.
My problem is that the last class seems to be having member variables that have changing values.
I have made all member vars protected so that they can only be accessed outside the object using Get and Set member functions but they still continue to change with being made to by my code!!!!???!?!?!
They are all created on the heap with the first object being created as a new object assigned to a pointer to the new object which is also on the heap.
The members in question are all of type GLfloat if thats worth knowing. I also have checked and the Get / Set members are only used in the places that I want them and I know exactly what they are doing so it can be them.
Does anyone have a clue what could be happening?
here is some code to help:
class ObjectThree{
public:
// I use Get / Set members here to access the protected vars
protected:
GLfloat x,y,z;
};
class ObjectTwo{
public:
protected:
vector <ObjectThree *> MyListOfObjectThrees;
};
class ObjectOne{
public:
protected:
vector <ObjectTwo *> MyListOfObjectTwos;
};
I'm currently compiling with -ggdb -Wall -O0 so as to debug.
PLEASE HELP!
Mike
Here's a weird one for you, I have a object that contains a vector list of pointers to objects of another class. within the other objects I have a vector list of pointers to yet another class of a different type.
My problem is that the last class seems to be having member variables that have changing values.
I have made all member vars protected so that they can only be accessed outside the object using Get and Set member functions but they still continue to change with being made to by my code!!!!???!?!?!
They are all created on the heap with the first object being created as a new object assigned to a pointer to the new object which is also on the heap.
The members in question are all of type GLfloat if thats worth knowing. I also have checked and the Get / Set members are only used in the places that I want them and I know exactly what they are doing so it can be them.
Does anyone have a clue what could be happening?
here is some code to help:
class ObjectThree{
public:
// I use Get / Set members here to access the protected vars
protected:
GLfloat x,y,z;
};
class ObjectTwo{
public:
protected:
vector <ObjectThree *> MyListOfObjectThrees;
};
class ObjectOne{
public:
protected:
vector <ObjectTwo *> MyListOfObjectTwos;
};
I'm currently compiling with -ggdb -Wall -O0 so as to debug.
PLEASE HELP!
Mike