Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-44

Autoboxing support

    XMLWordPrintable

Details

    • Improvement
    • Status: In Review
    • Low
    • Resolution: Unresolved
    • None
    • 14.0.0
    • Binding codegen
    • Operating System: All
      Platform: All

    Description

      In situations where we have a containing element which has as its child a single container, we should make it easy to autobox it.

      Example: 

      choice ch {
        case foo-case {
          container foo {
            ...
          }
      
        }
      }
      

      foo-case contains a single container, foo. We should add an interface to Foo AutoBoxAble<FooCase>, and provide it a method

      class Foo {
        ...
      
        public FooCase autoBox() {
         // wraps Foo in FooCase and returns it
        }
      }
       
      

      The same can also be done for containers:

      container bar-container {
        container bar {
           ...
        }
      }
      
      public class Bar {
        public BarContainer autoBox();
      }
      

       and lists

      list baz-entry { container baz { ... } }
      
      public class Baz { public BazEntry autoBox(); }

      Note, this would be done only in the case where there was only where there is a single container child.

      Attachments

        Issue Links

          # Subject Branch Project Status CR V

          Activity

            People

              SamoSchneider Samuel Schneider
              hagbard Ed Warnicke
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: