Hi,
I am designing a class having interlinked object...a sort of tree. The code for each element of tree looks like :
Class C;
class Element {
public:
int key;
string payload;
C * next;
};
But the object of Element is becoming too heavy because of use of string class. I want to design a separate vector class for storing these strings value and refer them by just using a iterator. So the code will look something like this:
Class C;
class Element {
public:
int key;
vector <string>::iterator payload;
C * next;
};
The easier way is to declare a vector string as global variable and use global function to insert and delete. But I want to do this using a separate class for the whole vector string with member function for insertion and deletion. Any suggestion how to proceed? Couldnt find out a proper architecture...