[xsde-users] XSDE Generates Different Base Class Return Value from post() after minor reductions to XSD schema file under Eclipse Linux 64-bit

Bob.Oneil at L-3Com.com Bob.Oneil at L-3Com.com
Mon Mar 15 16:44:03 EDT 2010


I have a somewhat unexpected result from the xsde compiler that occurred
after I modified an original version of an xsd file to simply remove
some content.   

The conditions are very repeatable.  The XSD files passed basic
validation.

 

The return value from the template to the post() method in the parser
implementation template (net_mdl-pimpl.hxx) has changed from a pointer
to the C++ mapped collection 

(as ::Settings* post())  to  simply the object itself (as ::Settings).

 

It was my understanding that the parser dynamically allocated the mapped
C++ class returned from the call similar to the following:

 

        // Perform post processing

       class Settings* pSettings = Settings_p.post ();

 

It was then up to the application to pass around this pointer to
routines that needed the C++ mapped content,

and to free the dynamic memory when done with the created object.

 

By simply removing a few entries from the xsd file, the xsde compiler
generates a different prototype in the class.

 

Perhaps this reflects some basic misunderstanding I have in some of the
specifics about xsde.

 

This is using an Eclipse Project under Linux 64-bit

 

Attached are a couple of Eclipse Projects that provide the generated
files, and the xsd schema.

 

For these projects, xsde was installed to '/opt'.

 

 

FROM:



// Parser aggregate for the Settings element.

//

class Settings_paggr

{

  public:

  Settings_paggr ();

 

  void

  pre ()

  {

    this->Settings_p_.pre ();

  }

 

  ::Settings*

  post ()

  {

    return this->Settings_p_.post_Settings ();

  }

 

  ::Settings_pimpl&

  root_parser ()

  {

    return this->Settings_p_;

  }

 

  static const char*

  root_name ();

 

  static const char*

  root_namespace ();

 

  ::xml_schema::parser_error

  _error ()

  {

    return this->Settings_p_._error ();

  }

 

  void

  reset ()

  {

    this->Settings_p_._reset ();

  }

 

 

TO:

 

// Parser aggregate for the Settings element.

//

class Settings_paggr

{

  public:

  Settings_paggr ();

 

  void

  pre ()

  {

    this->Settings_p_.pre ();

  }

 

  ::Settings

  post ()

  {

    return this->Settings_p_.post_Settings ();

  }

 

  ::Settings_pimpl&

  root_parser ()

  {

    return this->Settings_p_;

  }

 

  static const char*

  root_name ();

 

  static const char*

  root_namespace ();

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Reference Projects.rar
Type: application/octet-stream
Size: 67541 bytes
Desc: Reference Projects.rar
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20100315/7ae00a37/ReferenceProjects-0001.obj


More information about the xsde-users mailing list