5.2.4.1 Names Library Interface Pseudo OMG IDL

Note:

This information is taken from the CORBAservices: Common Object Services Specification, pp. 3-14 to18. Revised Edition: March 31, 1995. Updated: November 1997. Used with permission by OMG.

To allow the representation of names to evolve without affecting existing client applications, it is desirable to hide the representation of names from the client application. Ideally, names themselves would be objects; however, names must be lightweight entities that are efficient to create, manipulate, and transmit. As such, names are presented to programs through the names library.

The names library implements names as pseudo-objects. A client application makes calls on a pseudo-object in the same way it makes calls on an ordinary object. Library names are described in pseudo-IDL (to suggest the appropriate language binding). C++ client applications use the same client language bindings for pseudo-IDL (PIDL) as they use for IDL.

Pseudo-object references cannot be passed across OMG IDL interfaces. As described in Chapter 3 of the CORBAservices: Common Object Services Specification, in the section “The CosNaming Module,” the CORBAservices Naming Service supports the NamingContext OMG IDL interface. The names library supports an operation to convert a library name into a value that can be passed to the name service through the NamingContext interface.

Note:

It is not a requirement to use the names library in order to use the CORBAservices Naming Service.

The names library consists of two pseudo-IDL interfaces, the LNameComponent interface and the LName interface, as shown in the following code snippet.

interface LNameComponent { // PIDL
        const short MAX_LNAME_STRLEN = 128;
        exception NotSet {};
        exception OverFlow {};
        string get_id
        raises(NotSet);
        void set_id(in string i)
        raises(OverFlow);
        string get_kind()
        raises(NotSet);
        void set_kind(in string k)
        raises(OverFlow);
        void destroy();
};
interface LName { // PIDL
        exception NoComponent {};
        exception OverFlow {};
        exception InvalidName {};
        LName insert_component(in unsigned long i,
                in LNameComponent n)
        raises(NoComponent, OverFlow);
        LNameComponent get_component(in unsigned long i)
        raises(NoComponent);
        LNameComponent delete_component(in unsigned long i)
        raises(NoComponent);
        unsigned long num_components();
        boolean equal(in LName ln);
        boolean less_than(in LName ln);
        Name to_idl_form()
        raises(InvalidName);
        void from_idl_form(in Name n);
        void destroy();
};
LName create_lname(); // C/C++
LNameComponent create_lname_component(); // C/C++