Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


bad practice // hack ?

This topic is 5444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, would you guys consider this to be bad practis or hacking?
#define LOG_INTERFACE_VER(interface_version) ILog##_V_##interface_version 

class LOG_INTERFACE_VER(1_1) : public IBase {
	virtual Init();
	virtual Release();
I was thinking of having some kind of system similar to COM. Every Interface like this one, will register itself at a SystemManager that keeps track of all possible Interfaces. Now, when I want to update a specific Interface I just derive it from the old one and add new functions to that interface and register it at the SystemManager. This new one will contain a pointer to the previous version of the interface. The thing is that I will have some kind of version variable//definition in the "1_1" above. And the same thing will be for different Implementations of the interfaces. So when I want to use an interface from the SystemManager I just query for it... Ah well, just two seconds ago I had some point in this... just can't see it now lol... think I'm kinda tired, heh Anyway... would that kind of code be bad practice, if you never would actually type decrations like this in you application anyway: ILogSomeVersion *newLog = new ILogSomeVersion(); The only way would be to use the SystemManager to get the wanted interface//implementation thx ... and good night, sigh ... [edited by - bilsa on January 16, 2004 7:16:58 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!