//
// Copyright (c) 2009-2014,2017 LAAS/CNRS
// All rights reserved.
//
// Permission to use, copy, modify,  and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE  SOFTWARE  IS  PROVIDED  "AS  IS" AND  THE  AUTHOR  DISCLAIMS  ALL
// WARRANTIES  WITH  REGARD  TO   THIS  SOFTWARE  INCLUDING  ALL  IMPLIED
// WARRANTIES  OF MERCHANTABILITY  AND  FITNESS. IN  NO  EVENT SHALL  THE
// AUTHOR BE  LIABLE FOR ANY SPECIAL, DIRECT,  INDIRECT, OR CONSEQUENTIAL
// DAMAGES OR ANY DAMAGES WHATSOEVER  RESULTING FROM LOSS OF USE, DATA OR
// PROFITS,  WHETHER  IN  AN  ACTION  OF CONTRACT,  NEGLIGENCE  OR  OTHER
// TORTIOUS  ACTION, ARISING  OUT OF  OR IN  CONNECTION WITH  THE  USE OR
// PERFORMANCE OF THIS SOFTWARE.
//
//                                      Anthony Mallet on Fri Jun 25 2010
//

ifdef::sidebartoc[]
include::_Sidebar.adoc[]
endif::[]

GenoM IDL mappings
------------------

`genom3` IDL is independent of the programming language used to
implement the services and internals of a component. In order to use
the `genom3` generated source code, it is necessary for programmers to
know how to access the service parameters and ports from their
programming languages. This chapter defines the mapping of `genom3`
IDL constructs to the supported programming languages.

The mapping between `genom3` IDL and a programming language diverges
from the OMG CORBA standard.  This is unfortunate, because this might
lead to some confusion for the developers used to OMG CORBA, but it
was necessary to define mappings well targetting real-time
platforms. The design strategy that guided the definition of those
mappings was to try to have contiguous memory segments, that do not
require memory management primitives, for most of the data types.
Only unbounded string and sequences do not follow this scheme.

`genom3` currently implements mappings for the `C` and `C++`
languages.

=== `C` mappings: From IDL types to `C` types

* link:c{outfilesuffix}#scoped_name[Scoped name]
* link:c{outfilesuffix}#constant[Constant]
* link:c{outfilesuffix}#basic_type[Basic type]
* link:c{outfilesuffix}#enumerated_type[Enumerated type]
* link:c{outfilesuffix}#string[String]
* link:c{outfilesuffix}#array[Array]
* link:c{outfilesuffix}#struct[Struct]
* link:c{outfilesuffix}#union[Union]
* link:c{outfilesuffix}#sequence[Sequence]
* link:c{outfilesuffix}#optional[Optional]
* link:c{outfilesuffix}#port[Port]
* link:c{outfilesuffix}#remote[Remote]
* link:c{outfilesuffix}#native[Native]
* link:c{outfilesuffix}#exception[Exception]

=== `{cpp}` mappings: From IDL types to `{cpp}` types

* link:c++{outfilesuffix}#scoped_name[Scoped name]
* link:c++{outfilesuffix}#constant[Constant]
* link:c++{outfilesuffix}#basic_type[Basic type]
* link:c++{outfilesuffix}#enumerated_type[Enumerated type]
* link:c++{outfilesuffix}#string[String]
* link:c++{outfilesuffix}#array[Array]
* link:c++{outfilesuffix}#struct[Struct]
* link:c++{outfilesuffix}#union[Union]
* link:c++{outfilesuffix}#sequence[Sequence]
* link:c++{outfilesuffix}#optional[Optional]
* link:c++{outfilesuffix}#port[Port]
* link:c++{outfilesuffix}#remote[Remote]
* link:c++{outfilesuffix}#native[Native]
* link:c++{outfilesuffix}#exception[Exception]
