This is a little complicated but, I'm going to try and explain as best I can...
I have a program that I'm working on, it has several classes, one main class that controls everything called: 'voidNN' this class uses other classes inside of it called 'voidL', all of which are dynamically created and deleted, through a doubly-linked list. The 'voidL' classes are aware of one-another, and are linked together, again dynamically, with some insignificant values, relevant only to their communication.
That being said, here is my problem:
I have to have quick access to any 'voidL' object within the 'voidNN' class, so I decided to use pointers, and return these pointers to the user, so that the user can use them to quickly access a particular object, however, the data in the 'voidL' classes is very sensitive, and could have unexpected results if it were tampered with by the user, so I only return "void *" pointers to the user, which I type cast back to 'voidL's.
...still going!...
Lastly there are three different types of 'voidL', all of which are similar in all aspects except for one or two added functions. It would be extremely helpful if I could pass some sort of object back to the user as a sort of interface to use to interact with the 'voidL' objects, without having to go through the 'voidNN' object to do so. Is there any type of interface object that I could return, that was slightly different depending on what implementation of the 'voidL' object was being used?
I am sorry if this didn't quite make sense, please post any questions that you have, I'm not entirely sure how to explain it, but I'll try to answer any questions you have! And thank you in advance for any help!
I have a program that I'm working on, it has several classes, one main class that controls everything called: 'voidNN' this class uses other classes inside of it called 'voidL', all of which are dynamically created and deleted, through a doubly-linked list. The 'voidL' classes are aware of one-another, and are linked together, again dynamically, with some insignificant values, relevant only to their communication.
That being said, here is my problem:
I have to have quick access to any 'voidL' object within the 'voidNN' class, so I decided to use pointers, and return these pointers to the user, so that the user can use them to quickly access a particular object, however, the data in the 'voidL' classes is very sensitive, and could have unexpected results if it were tampered with by the user, so I only return "void *" pointers to the user, which I type cast back to 'voidL's.
...still going!...
Lastly there are three different types of 'voidL', all of which are similar in all aspects except for one or two added functions. It would be extremely helpful if I could pass some sort of object back to the user as a sort of interface to use to interact with the 'voidL' objects, without having to go through the 'voidNN' object to do so. Is there any type of interface object that I could return, that was slightly different depending on what implementation of the 'voidL' object was being used?
I am sorry if this didn't quite make sense, please post any questions that you have, I'm not entirely sure how to explain it, but I'll try to answer any questions you have! And thank you in advance for any help!