Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B50B18FAC for ; Tue, 26 May 2015 20:44:04 +0000 (UTC) Received: (qmail 3565 invoked by uid 500); 26 May 2015 20:44:04 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 3522 invoked by uid 500); 26 May 2015 20:44:04 -0000 Mailing-List: contact dev-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list dev@ignite.incubator.apache.org Received: (qmail 3511 invoked by uid 99); 26 May 2015 20:44:04 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2015 20:44:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E75CFC093B for ; Tue, 26 May 2015 20:43:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.991 X-Spam-Level: X-Spam-Status: No, score=0.991 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id jgKy3MDMNQqj for ; Tue, 26 May 2015 20:43:47 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id AF51124BBB for ; Tue, 26 May 2015 20:43:47 +0000 (UTC) Received: (qmail 3142 invoked by uid 99); 26 May 2015 20:43:46 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2015 20:43:46 +0000 Received: from zulu.local (unknown [77.234.149.122]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 64B321A046D for ; Tue, 26 May 2015 20:43:46 +0000 (UTC) Message-ID: <5564DAFF.10503@apache.org> Date: Tue, 26 May 2015 22:43:43 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: The Apache Software Foundation User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@ignite.incubator.apache.org Subject: Re: C++ marshalling. References: <556485F8.7090407@gridgain.com> In-Reply-To: Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAADBQTFRF IhsbCy0qZjoVOVRoeFxSAIKBzXQiAKaibYiewnk7nn9z0qCTgL3i87Ep6Kx/+tHBsrE+zgAAAjZJ REFUOMvF0jFoE1EYB/CzjWlqIzaTjqVIBifRRWyG0t5iUqlLyFpCeXBgKg5yq6A4degUDJjoUDpc 1Qt4Ux94B11SOLB0KGS4discpbkORTCn9/m9d3fvLhXnvuHu3f+Xx/veyyfZfLSdZHzgicSfeyw4 JISwdz8FT6M8lM8Ceg385Dlhs+cC9sQCDn0B78QCogzwN+sxfHGOIXBbRGkNAM4cZymGtgNsDPgz cByxon3EEm1TLmvAlghoHOO3CZSa+IQ/vF6JV8tgKOMow78gRgL2/+EIvATOUtB3SSdMg4GXgrbn uk0uLiGdoCHKbX4E+t1FUTqn1AtIdPJebssDQ64YANSQyyaQNyUOFs0ijMsMFnOPTahPLXKYowtY 08MfCP7vR7hRnc5zmPK7CDYYbHcbC7tHuyFA94U/1LYZaJpu/sxACHMwvwZljTLY0TbNk4x+zuEt yC3MfCM6uSIvfwur0itFL4FA2Yal8BzLfnYV4EIGwEPAk7o5zIcnvzHMEjwJrrhAKK7on6IrsfRJ 7A53BhaK+CL7fj6+q/sPeOvcDTtoZTxpUYsFeIknrOXep3p3l7Ua+8sZ5FPQKyKwWi+DfROTU7ny C1/9UhpeY7K287WJCzbsNPQm2S6Yk4PSCNhWM2r3nD0K9liYb6yPgCRJhSzPrxUK0yUBVk1VX0lj s7MzGZyp0wImMK/e8rHbz2soL+O+2r1dxfGsAmBcx0lNjS/RUhlUC7gRn1wGMdQ7Vw1/AReW/RN3 xFWdAAAAAElFTkSuQmCC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Why don't you just use an existing IDL? Something like Thrift or Protobufs or ... there are quite a few of them out there. Inventing your own marshalling is a waste of time. -- Brane On 26.05.2015 22:12, Vladimir Ozerov wrote: > SFINAE could be a way to perform compile-time introspection: > http://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error > > On Tue, May 26, 2015 at 5:40 PM, Denis Magda wrote: > >> Yeap, it's not so easy to marshall/unmarshall data in C++. >> >> Take a look at these slides from NVIDIA: >> >> http://on-demand.gputechconf.com/gtc/2012/presentations/S0377-C++-Data-Marshalling-Best-Practices.pdf >> >> The slides are quite high level but probably they will expose a solution >> to p.2. >> >> -- >> Denis >> >> >> On 5/26/2015 12:09 PM, Vladimir Ozerov wrote: >> >>> Igniters, >>> >>> C++ doesn't have reflection/introspection. For this reason we have to map >>> user structs/classes to their marshal/unmarshal handlers (functions) >>> somehow. >>> >>> Various approaches for this are available: >>> 1) Predefined map [type ID -> marshal/unmarshal functions] which is >>> configured at runtime before Grid is started. >>> 2) Provide serializers in runtime. E.g. the following will set specific >>> serializers on cache projection: >>> ICache* cache = grid.cache(KeySerializer* k, ValSerialzier* v). >>> >>> I think we should start with p.1 as it is flexible and will not require >>> users to change their existing types. The drawback is that user will have >>> to write marshalling logic by hand. But we can introduce some >>> code-generation facility later (e.g. like Gigaspaces does this). >>> >>> Thoughts and ideas are welcomed. >>> >>> Vladimir. >>> >>>