Mapping for classes, interfaces and arrays

Because C doesn't have built in mechanisms for protecting the global namespace, the C mapping attempts to avoid namespace collisions by using struct and method names that incorporate all the naming information from the package, class and method names. For a type Z in package X.Y, the name of the type that C clients use for an object reference is X_Y_Z. X_Y_Z is defined as follows in the X_Y_Z.h header file:


struct X_Y_Z__object;
struct X_Y_Z__array;
typedef struct X_Y_Z__object* X_Y_Z;

This code fragment also shows that struct X_Y_Z__array is used for a multi-dimensional array of X.Y.Z objects. Here are some additional concrete examples of the object and interface reference types derived by the C mapping:


/**
 * Symbol "sidl.BaseClass" (version 0.5.1)
 * 
 * Every class implicitly inherits from <code>BaseClass</code>.  This
 * class implements the methods in <code>BaseInterface</code>.
 */
struct sidl_BaseClass__object;
struct sidl_BaseClass__array;
typedef struct sidl_BaseClass__object* sidl_BaseClass;

/**
 * Symbol "sidl.BaseInterface" (version 0.5.1)
 * 
 * Every interface in <code>SIDL</code> implicitly inherits
 * from <code>BaseInterface</code>, and it is implemented
 * by <code>BaseClass</code> below.
 */
struct sidl_BaseInterface__object;
struct sidl_BaseInterface__array;
typedef struct sidl_BaseInterface__object* sidl_BaseInterface;





babel-0.9.6
users_guide Last Modified 2004-09-08

http://www.llnl.gov/CASC/components
components@llnl.gov