From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,da047bd41d707e54 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!news.belwue.de!peernews!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Oliver Kowalke Newsgroups: comp.lang.ada Subject: Re: networking support? Date: Sat, 20 Dec 2008 00:05:39 +0100 Organization: 1&1 Internet AG Message-ID: References: <494a17a9$0$30226$9b4e6d93@newsspool1.arcor-online.net> <494a4655$0$30220$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: drsd-4db3551d.pool.einsundeins.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: online.de 1229727803 3121 77.179.85.29 (19 Dec 2008 23:03:23 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Fri, 19 Dec 2008 23:03:23 +0000 (UTC) User-Agent: KNode/0.10.9 Xref: g2news1.google.com comp.lang.ada:3051 Date: 2008-12-20T00:05:39+01:00 List-Id: Maciej Sobczak wrote: > On 18 Gru, 13:47, Georg Bauhaus wrote: > >> How would your program benefit from first wrapping system >> functions (that use C conventions) in C++ classes only for >> having to match Ada's O-O types and C++'s O-O types in >> a second step? >> Seems like an artificial setup to me. > > Except that a lot of things in the C world (especially in the system > APIs) are defined in header files as preprocessor constants, optional > or even unofficial structure fields or field order within a struct - > all this means that the binary layout of data structures is a big > question mark. This problem is particularly notorious with network > services. > There is no way to reasonably interface with all this mess from Ada > and having a wrapper layer that fixes some of this optional/unofficial/ > ordering stuff for the Ada part is a valid option. > Now the question is how thick this adapter layer should be - and here > a layer that does a bit of lifetime management or error reporting in > addition to just parameter passing is also a valid solution. > Then you might discover that all the work that is done in this > adapting layer can be reused in C++ projects as well (it is a low- > hanging fruit, so why not benefit from it?) and you end up with a > regular C++ library that encapsulates some system services and is used > from the Ada program. > There is nothing artifical in it - it starts with a fundamental > feasibility issues and ends up with simple economy. my intention was to call some boost libraries (www.boost.org). I'm not sure if C++-templates can be accessed/used by Ada. regards, Oliver