I think I understand what you mean, I'm just not sure what the advantage is. I'm also not sure why this has any affect on memory management or how it can be done.
By using a desing based on "interfaces only" you seem to mean that the interface is a function call interface only. But really, the "new" operator is a function call anyway, it's just that it has a standard semantic.
If you want to control memory management of a particular class type, all you need to do is override the "new" operator for that class.
Having said all this I must admit that I haven't read all the documentation or attempted to use the library yet. I do like the idea of having a C++ library for this purpose very much; I am slightly pained however by the idea that you may have obfuscated your interface a little. (On the other hand, it would be relatively simple for me to write a class which wraps your library and gives me the sort of interface that *I'm* looking for).
Don't get me wrong: I'm not trying to criticise, just make some suggestions which, as the author, you have the right to ignore.
best regards,
Davin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You specify in the tutorial that to instantiate a IELFI object you need to do this:
IELFI *p;
ELFIO::GetInstance()->CreateELFI(&p);
p->Load("filename.o");
Why not make it simple:
IELFI *p = new IELFI("filename.o");
?? - or is there a special reason you have avoided doing this
regards, Davin.
The main idea behind - to keep all memory management
inside the package. That's why Release() functions were born too.
ELFIO uses design based on interfaces only. There are no classes
that you should instantiate explicitly.
I think I understand what you mean, I'm just not sure what the advantage is. I'm also not sure why this has any affect on memory management or how it can be done.
By using a desing based on "interfaces only" you seem to mean that the interface is a function call interface only. But really, the "new" operator is a function call anyway, it's just that it has a standard semantic.
If you want to control memory management of a particular class type, all you need to do is override the "new" operator for that class.
Having said all this I must admit that I haven't read all the documentation or attempted to use the library yet. I do like the idea of having a C++ library for this purpose very much; I am slightly pained however by the idea that you may have obfuscated your interface a little. (On the other hand, it would be relatively simple for me to write a class which wraps your library and gives me the sort of interface that *I'm* looking for).
Don't get me wrong: I'm not trying to criticise, just make some suggestions which, as the author, you have the right to ignore.
best regards,
Davin.
DirectX uses a similar style of interface with releases and things. Not sure if that's a good thing or not.