en:docs:tk:som:progg

C Mapping

IBM SOM development was based on CORBA 1.1 specifications. But in later CORBA standards some changes (and incompatibilities) was introduced:

  1. Most of CORBA C mapping now has CORBA_ prefix (CORBA 1.2 p.79 4.11 CORBA Module).
  2. Up to CORBA 1.2 CORBA_Environment mapped to second argument of method function. But CORBA 2.0 changed this to last argument (CORBA 2.0 p.14-5 14.3 Mapping for Interfaces).
  3. Interface Repository interfaces was changed in CORBA 2.0. Description structure not contains member 'name' but member 'kind' with different type. (CORBA 2.0 p.6-10 6.5.3 Contained).
  4. CORBA 2.1 introduces wide chars (CORBA 2.1 p.1-17 wchar/wstring…
  5. CORBA 3 changed idl file names. (https://www.omg.org/spec/CORBA/3.3)

somFree supports C Language Mapping Specification to be CORBA 2+ compatible. But it still support CORBA 1.1 C Mapping. To switch back to CORBA 1.1 Mapping use CORBA1MAPPING define.

Exceptions

Base somFree classes (SOMObject, SOMClass, SOMClassMgr) is only classes which not uses exceptions for error handling.

Other classes provided by the somFree Toolkit (including those in the Persistence, Replication, DSOM, and Interface Repository frameworks, and the utility classes and metaclasses) handle errors via exceptions. Rather than invoking SOMError with an error code, their methods return exceptions via the (CORBA_Environment *) inout parameter required by these methods. The following sections describe the exception declarations, the standard exceptions, and how to set and get exception information in an CORBA_Environment structure. Refer C Language Mapping 1.16 and 1.22 for more information.