Next Previous Up Top Contents Index

A.4.25 Mapping overview

A.4.25.3 Rule 3: Lisp functions corresponding to IDL types

IDL defines many kinds of types: unions, structs, interfaces, and exceptions. We can think of each of these types, informally, as denoting entities with named slots. For example, the named slots of astruct,union, orexception are its members; the named slots of aninterface are its attributes.

For each IDL type, there is an associated constructor function that creates a value of that type and there are accessors for each member.

The constructor Function

The constructor function corresponding to a type is identical to the (fully scoped) name of the type. It takes keyword initialization arguments whose names are the names of the named members of that type; these initialize the given members.

Accessing the Members

Each named slot defines two functions: a reader and a writer. The reader has the same name as the named slot. The writer uses the standard(setf name) convention familiar to Lisp users. Of course, the home package of the reader is, as for all such function names, the packageOP.

Note: In applying Rule 3, remember that not all of the associated functions make sense for all of the types. For example, there is obviously no constructor function defined for an interface, nor are there writer functions defined for attributes declared readonly.


Developing Component Software with CORBA - 22 Jan 1999

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker