From: Grzegorz J. <ja...@he...> - 2003-08-15 04:17:54
|
On Wed, 13 Aug 2003, yang qu wrote: > Hi! I am still not sure how I could use opencxx in my work, but anyway > I would like to listen to your advices for the template staffs. Thank > you! Basically the object model needs to be slightly redone --- in my opinion class templates are not classes, as current design has it. How much needs to be done depends on how do you need to use OpenC++. If you use it as C++ static analyzer library, then you don't need to change much, most likely you can just checkout the 'templates_exp' brach and the code for handling specializations is there. If you need to use occ as a whole, then again --- will you just be happy with ignoring specializations or do your application needs occ to perform translation on classes being template instances? Or what about: metaclass MyMetaclass A; class A { ... }; template <class> class Templ; template <> class Templ<int> { typedef A type; } Templ<int>::type a; a.f(); // <----------- do you need MyMetaclass // translation to kick in here? BR Grzegorz > best regards > --yang > > Grzegorz Jakacki <ja...@he...> wrote: > On Mon, 4 Aug 2003, yang qu wrote: > > > Hi! > > > I believe the problem comes from "Template Specilization". In the code > > that I attached, the template class Buffer has a general declaration > > and a specialized declaration. the class "IntBuffer" has two parents > > classes. one is the specialized "Buffer", and another is the normal > > class "TestObject". The occ failed when it detected that the two > > parent classes have different Metaclass names, namely "TemplateClass" > > and "Class". > > Yes. > > > should this bug be fixed somehow? > > Yes, but I don't see any quick fix. If you would like to get down to this > I can advice where to look etc. > > Best regards > Grzegorz > > > best regards > > --yang > > > > --------------------------------- a simple test code ---------------------- > > > > class Mem{ > > > > public: > > > > virtual int name() =0; > > > > }; > > > > template class Buffer : virtual public Mem{ > > > > public: > > > > int name(){return 0;} > > > > C get(int); > > > > void set(C, int); > > > > int size(); > > > > private: > > > > C data[10]; > > > > }; > > > > > > > > template<> class Buffer: virtual public Mem{ > > > > public: > > > > int name(){return 1;}; > > > > int get(int); > > > > void set(int,int); > > > > int size(); > > > > private: > > > > int data[10]; > > > > }; > > > > class BasicObject{ > > > > }; > > > > class TestObject : public BasicObject{ > > > > public: > > > > virtual int type(){return 1;} > > > > }; > > > > class IntBuffer : public Buffer, public TestObject{ > > > > public: > > > > int type(){return 10;} > > > > }; > > --------------------------------------------------- > > > > Grzegorz Jakacki wrote: > > On Fri, 1 Aug 2003, yang qu wrote: > > > > > Hi! > > > when I was applying the openc++ on a set of regular > > > C++ codes that can be successfully compiled using > > > gcc3.2, I got the following error message: "inherited > > > metaclasses conflict: test_class". the "test_class" > > > and all of its parents classes are regular C++ > > > classes. No meta-level classes are defined in the > > > codes. Could someone tells me what might cause the > > > problem? > > > > Could you post the offending code (preferably stripped from irrelevant > > details)? > > > > BR > > Grzegorz > > > > > thank you in advance! > > > best regards > > > --yang > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! SiteBuilder - Free, easy-to-use web site design software > > > http://sitebuilder.yahoo.com > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > > > Data Reports, E-commerce, Portals, and Forums are available now. > > > Download today and enter to win an XBOX or Visual Studio .NET. > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > _______________________________________________ > > > Opencxx-users mailing list > > > Ope...@li... > > > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > > > > > > > > > ################################################################## > > # Grzegorz Jakacki Huada Electronic Design # > > # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # > > # tel. +86-10-64365577 x2074 Beijing 100015, China # > > # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # > > ################################################################## > > > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! SiteBuilder - Free, easy-to-use web site design software > > ################################################################## > # Grzegorz Jakacki Huada Electronic Design # > # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # > # tel. +86-10-64365577 x2074 Beijing 100015, China # > # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # > ################################################################## > > > > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |