[ 
https://issues.apache.org/jira/browse/AVRO-1026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thiruvalluvan M. G. updated AVRO-1026:
--------------------------------------

    Attachment: AVRO-1026-2.patch

Here is a modified version of Keh-Li Sheng's patch, where instead of 
introducing a new template parameter, I've changed the NameConcept to use a new 
class Name instead of std::string.

I think the namespace belongs to the NameConcept instead of its own concept. 
Hence this change.

The original tests pass on Windows 7 and Cygwin.

The code generator does not currently encode the namespace into the C++ types 
it generates. It should not be a problem in most cases; but if there is a name 
clash the generated code will not compile because of duplicate type 
definitions. I tried to encode the namespace into the names of the generated 
types (by replacing dot with underscore). It results in too many long names, 
which would be too tiresome for the users to use. We have to solve it in some 
other way.
                
> Add namespace support to C++
> ----------------------------
>
>                 Key: AVRO-1026
>                 URL: https://issues.apache.org/jira/browse/AVRO-1026
>             Project: Avro
>          Issue Type: Improvement
>          Components: c++
>    Affects Versions: 1.6.1
>            Reporter: Keh-Li Sheng
>              Labels: patch
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1026-2.patch, AVRO-1026.patch, 
> AVRO-1026_json.patch, AVRO-1026_with_AVRO-956.patch
>
>
> This patch adds support for reading and resolving schemas that use namespaces 
> for named types. Looking for a code review and application of the patch to 
> codebase.
> Node is modified to take an additional NamespaceConcept attribute in the 
> template parameters. An additional stack has been added to the compiler 
> context to track when namespaces have been entered or left for resolving 
> further types/symbols. Symbolic resolution is now done against the "fullname" 
> of the type and not just by the name. Some string gymnastics were needed in 
> other areas of codegen in order to handle the new symbols.
> Added very trivial tests to AvrogencppTests for schema generation by 
> avrogencpp and added a test schema (tweet) that has namespaces, a record 
> definition inside a namespace, and then a later symbolic reference by name 
> within an outer namespace. Also patched to work with gen-cppcode.py output. 
> Note that NodeImpl::printBasicInfo intentionally does not output the 
> namespace since that caused downstream breakage of gen-cppcode.py expected 
> format.
> github project was forked at https://github.com/bifflabs/avro

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to