Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    SUPER:: - must be a class or namespace name..

    SDK Help
    0
    7
    636
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 10/06/2013 at 10:38, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      Hi, some plugins use this:

      return SUPER::BlaBla_foo(x, y, z);
      

      the hashmap.h uses this:

      Super::ConstIterator::operator++();
      

      but I can't. I get "name followed by '::' must be a class or namespace name"

      I do use this:

      ObjectAncestor::BlaBla_foo(x, y, z);
      

      but I wonder how other can use SUPER / Super and to what extent it has any purpose / is better than just using the name of the ancestor.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 10/06/2013 at 10:41, xxxxxxxx wrote:

        SUPER is coming from this macro.
        You can use it only if you have INSTANCEOF(Object,ObjectAncestor) in you class.

          
            
            
            	#define INSTANCEOF(X,Y)                  \n    		public:                                \n    			typedef Y SUPER;                     \n    		private:
        

        > but I wonder how other can use SUPER / Super and to what extent it has any purpose / is better than just using the name of the ancestor.

        Actually it is the same, just using some macro magic.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 10/06/2013 at 10:55, xxxxxxxx wrote:

          Thanks a lot!
          I will stick to my usual way of doing things then.
          In C# there is something called "Base" which is intrinsic so to say.

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 11/06/2013 at 03:16, xxxxxxxx wrote:

            I suggest you to just use

            class MyClass : public BaseClass {
              
            public:
              
                typedef BaseClass SUPER;
              
            };
            

            instead. The INSTANCEOF macro is in my eyes nothing but confusing. I've also
            never need to have it public, so you can usually skip that as well.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 11/06/2013 at 04:49, xxxxxxxx wrote:

              Why not use Super instate like hashmap?
              Or even Base like in C# then ?  🙂

                
                  
                  
                  class MyClass : public BaseClass {
                  
                    
                  
                  
                  public:
                  
                      typedef BaseClass Super;  
                      typedef BaseClass Base;  
                  
                  
                  };
                
              
              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 11/06/2013 at 05:11, xxxxxxxx wrote:

                Personally, I use the lower-case "super" (like Python, Java)

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 11/06/2013 at 08:26, xxxxxxxx wrote:

                  Yep, that's also my default typedef.

                  typedef BaseClass Base;
                  
                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post