[xsde-users] enumeration type support

Thomas Frenzel (TomSun) tftomsun at streamteam.de
Mon Aug 10 18:03:17 EDT 2009


Hello Boris,
  
  thanks for your reply and for putting this issue on your todo list. I  know that my code didn't match to the architecture. I just wanted to  show how the verification should be implemented, so i copy and pasted some code. In the end the enum  should become one of the supported default types like integer, double,  string.
  
  So, i'm excited now and wait for the next version. :)
  
  Bye, Thomas
  
    _____  

From: Boris Kolpackov [mailto:boris at codesynthesis.com]
To: Thomas Frenzel (TomSun) [mailto:tftomsun at streamteam.de]
Cc: xsde-users at codesynthesis.com
Sent: Mon, 10 Aug 2009 09:58:16 +0200
Subject: Re: [xsde-users] enumeration type support

Hi Thomas,
  
  Thomas Frenzel (TomSun) <tftomsun at streamteam.de> writes:
  
  > There's one thing that i am missing. Why do i have to implement the 
  > enum parse/serialization by myself? I would like to get an generated
  > enum for each simple type that derives from string and contains only
  > enumerations. Additionally i would like to have generated 
  > serializer/parser classes that does the validation for me
  
  I agree, handling of enums in C++/Parser and C++/Serializer is
  somewhat awkward. The problem with the approach you suggested is
  that conceptually these two mappings don't generate object model
  types. They only provide parser and serializer skeletons. The
  object model types are provided, if any, by the application
  developer.
  
  Maybe we could generate a helper enum class inside the generated
  parser skeleton along with the corresponding callback function.
  Something like this:
  
  class gender_pskel
  {
    enum gender
    {
      male,
      female
    };
  
    virtual void pre ();
    virtual void value (gender g);
    virtual void post_gender ();
  };
  
  In any case, I have added this to my TODO list and will try to come 
  up with a solution for the next release of XSD/e. Thanks for the
  suggestion!
  
  Boris
    


More information about the xsde-users mailing list