Jump to content

Lookup modifier

From EDM2

Returns the value of a given SOM modifier for a specified object [that is, for an object that is a component of an IDL interface (class) definition maintained within the Interface Repository].

Syntax

 
Repository       receiver;
Environment     *env;
RepositoryId     id;
string           modifier;
string           rc;

rc = lookup_modifier(receiver, env, id, modifier);

Parameters

receiver (Repository)
A pointer to an object of class Repository representing SOM's Interface Repository.
env (Environment *)
A pointer where the method can return exception information if an error is encountered.
id (RepositoryId)
The RepositoryId of the object whose modifier value is needed.
modifier (string)
The name of a specific (SOM or user-specified) modifier whose string value is needed.

Returns

rc (string)
The lookup_modifier method returns the string value of the given SOM modifier for an object with the specified RepositoryId, if it exists. If an existing modifier has no value, a zero-length string value is returned. If the object cannot be found, then NULL (or zero) is returned.
When the string value is no longer needed, client code must free the space for the string (using SOMFree).

Remarks

The lookup_modifier method returns the string value of the given SOM modifier for an object with the specified RepositoryId within the Interface Repository. For a discussion of SOM modifiers, see the topic "Modifier statements" in Chapter 4, "SOM IDL and The SOM Compiler," of the SOM Toolkit User's Guide.

If the object with the given RepositoryId does not exist or does not possess the modifier, then NULL (or zero) is returned. If the object exists but the specified modifier does not have a value, a zero-length string value is returned.

Note: The lookup_modifier method is not stipulated by the CORBA specifications; it is a SOM-unique extension to the Interface Repository.

Original Class

Repository

Example Code

  
#include <repostry.h>

...

Repository repo;
Environment *ev;
RepositoryId objectId;
string filestem;i

...

repo = RepositoryNew ();
filestem = Repository_lookup_modifier (repo, ev, objectId,
                                                     "filestem");
if (filestem) {
    printf
        ("The %s object's filestem modifier has the value \"%s\"\n",
            objectId, filestem);
    SOMFree (filestem);
} else
    printf ("No filestem modifier could be found for %s\n",
            objectId);

Related Methods