几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】define od-use-stub-fns question (http://www.dimcax.com/hust/showthread.php?t=15663)

yang686526 2009-05-04 07:18 PM

【转帖】define od-use-stub-fns question
 
define "od_use_stub_fns" question
define "od_use_stub_fns" question
hi,
why is the macro definition od_use_stub_fns placed at most of the oddbcurve methods?
currently i cannot use these methods through the oddbcurve interface class, but only through the inheritants
thanks in advance for any help.
regards
chudomir
oddbcurve methods which are not implemented in all oddbcurve inheritants are commented out.
sergey slezkin
thank you for your reply, sergey.
but why don't you just return enotimplemented or similar , so we can use the oddbcurve class as an interface and determine at runtime whether a class supports such operations like getpointatparam, etc, or not.
so the client code will remain unchanged when there are new implementations in the inherited classes.
however, you probably have certain reasons to do it...
regards
chudomir
i do not have strong opinion on this. untill all methods are implemented we'll get compains like
-my code compiles but i get unresolved externals at linking.
-my code compiles and links but i get enotimplemented exception.
sergey slezkin
so i suppose i can define od_use_stub_fns before include the dwgdirect headers and i've got the methods?
thanks.
chudomir
if you recompile dd - yes. defining the symbol changes size of virtual functions table...
sergey slezkin
well, i'm not a fan of recompiling third party libraries (though i have the sources as part from the founding membership).
moreover, not only the virtual table, but also the implementation of these functions in the cpp file will be problematic without recompilation (some playing with inlining them should be a questionable success).
sorry for losing your time with this, sergey, and thanks once again.
regards
chudomir


所有的时间均为北京时间。 现在的时间是 05:07 AM.