[
https://issues.apache.org/jira/browse/IGNITE-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15961081#comment-15961081
]
ASF GitHub Bot commented on IGNITE-3584:
----------------------------------------
GitHub user isapego opened a pull request:
https://github.com/apache/ignite/pull/1757
IGNITE-3584: BinaryType refactored
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gridgain/apache-ignite ignite-3584
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/1757.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1757
----
commit 2874f0fcfcec6ad529ab8546cca79eba7625e2bd
Author: Igor Sapego <[email protected]>
Date: 2017-04-04T15:37:06Z
IGNITE-3584: Added autotools files to gitignore
commit b64902022d809f5786c1bf848895ea278f2a5187
Author: Igor Sapego <[email protected]>
Date: 2017-04-07T16:31:25Z
IGNITE-3584: BinaryType refactored
----
> CPP: Refactor BinaryType class template.
> ----------------------------------------
>
> Key: IGNITE-3584
> URL: https://issues.apache.org/jira/browse/IGNITE-3584
> Project: Ignite
> Issue Type: Task
> Components: platforms
> Affects Versions: 1.6
> Reporter: Igor Sapego
> Assignee: Igor Sapego
> Labels: cpp
> Fix For: 2.0
>
>
> 1. All methods should be 'static'.
> 2. Methods {{GetTypeName()}}, {{Read()}} and {{GetNull()}} should pass result
> to caller by reference argument and not by return value to avoid copying and
> temporary objects creation.
> 3. For the {{BinaryType<T*>}}: additionally to the mentioned above, remove
> field {{typ}} and add type alias for the non-pointer type instead.
> Explanation:
> Current role of the {{BinaryType<T>}} in C++ is to provide Ignite with the
> information about its template type, to be used during serialization and
> deserialization. Unlike Java version, C++ {{BinaryType}} also used for user
> to provide implementation of {{Read}} and {{Write}} methods, i.e. methods
> that used to serialize and deserialize objects.
> We can not have non-template interface for this class as Write and Read
> methods have templated type in theirs signatures:
> {code}
> void Write(BinaryWriter& writer, const T& obj);
> T Read(BinaryReader& reader);
> {code}
> We can not change template type {{T}} with non-template type as we don't have
> single root class in C++ like {{Object}} class in Java and we also don't have
> any type information at runtime.
> Thus we always need to know template type for the {{BinaryType<T>}} when we
> are instantiating it, thus we can not have any fabrics or any polymorphism
> for this class in C++ and internally we always use default constructor to get
> new instance of such a class.
> So, currently I can not see how having non static methods could be useful for
> this class.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)