Menu

User Sections

2002-07-09
2002-07-11
  • Kazuhiro Sakai

    Kazuhiro Sakai - 2002-07-09

    Hi.

    My current project requires to have some lines after properties and methods definition inside a class definition , not before. It seems that the current version of ClassBuilder allows the access to only before properties and methods definition inside a class.

    Is there anyway to have extra lines there?

    Thanks in advance!

    KS

     
    • Craig Gunhouse

      Craig Gunhouse - 2002-07-09

      Could you give an example? 

      I know of reasons for doing it prior to the properties and methods but I haven't come accross any for after.  Maybe there is a work around for what you are trying to do. 

      You maybe able to do something with a context

       
    • Kazuhiro Sakai

      Kazuhiro Sakai - 2002-07-10

      Thanks for your reply.

      I'd like to deploy GigaBase, which is an opensource ojbect relational database available following URL:
      http://www.garret.ru/~knizhnik/gigabase.html

      It requires to have db implementations after the properties and methods inside the class. For example, to make a class storalbe into db:

      class Detail {
        public:
          char const* name;
          char const* material;
          char const* color;
          real4       weight;

          TYPE_DESCRIPTOR((KEY(name, INDEXED|HASHED),
                   KEY(material, HASHED),
                   KEY(color, HASHED),
                   KEY(weight, INDEXED),

      };

      Implementing TYPE_DESCRIPTOR prior to the properties and methods causes compilation error.

      KS

       
      • Craig Gunhouse

        Craig Gunhouse - 2002-07-10

        The following example compiled under Visual C++ .NET and it looks similar to your example.

        #ifndef _A_H
        #define _A_H

        //@START_USER1
        //@END_USER1

        class A
        {

        //@START_USER2
        #define TYPE_DESCRIPTOR(A, B) char * X##A, X##B ;
            TYPE_DESCRIPTOR(_A1, _A2)
        //@END_USER2

        // Members
        private:
            char * _A1;
            char * _A2;

        protected:

        public:

        // Methods
        private:
            void ConstructorInclude();
            void DestructorInclude();

        protected:

        public:
            virtual ~A();

        };

        #endif

        #ifdef CB_INLINES
        #ifndef _A_H_INLINES
        #define _A_H_INLINES

        //@START_USER3
        //@END_USER3

        #endif
        #endif

        Possible areas to check:
        1) Your compiler is a one pass compiler that doesn't do forward referencing very well.   You could place a forward reference before you class to see if that helps.

        2) Check to see what your macro is doing.  Since my macro worked, there must be something hide inside your macro that is causing the problem.

        Craig

         
    • Kazuhiro Sakai

      Kazuhiro Sakai - 2002-07-11

      Thanks!

      Oops. It worked. Probably I made a basic syntax error or something. Now I can use ClassBuilder for my project! That's great!

      KS

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.