Lookup modifier: Difference between revisions
mNo edit summary |
|||
Line 1: | Line 1: | ||
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]. | 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== | ==Syntax== | ||
<pre> | <pre> | ||
Repository receiver; | Repository receiver; | ||
Environment *env; | Environment *env; | ||
Line 10: | Line 10: | ||
rc = lookup_modifier(receiver, env, id, modifier); | rc = lookup_modifier(receiver, env, id, modifier); | ||
</pre> | </pre> | ||
==Parameters== | ==Parameters== | ||
;receiver (Repository) | ;receiver (Repository):A pointer to an object of class Repository representing SOM's Interface 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. | |||
;env (Environment *) | ;modifier (string):The name of a specific (SOM or user-specified) modifier whose string value is needed. | ||
: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== | ==Returns== | ||
;rc (string) | ;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. | ||
: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). | :When the string value is no longer needed, client code must free the space for the string (using SOMFree). | ||
==Remarks== | ==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. | 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. | 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. | Note: The lookup_modifier method is not stipulated by the CORBA specifications; it is a SOM-unique extension to the Interface Repository. | ||
==Original Class== | ==Original Class== | ||
Repository | Repository | ||
==Example Code== | ==Example Code== | ||
<pre> | <pre> | ||
#include <repostry.h> | #include <repostry.h> | ||
Line 55: | Line 47: | ||
repo = RepositoryNew (); | repo = RepositoryNew (); | ||
filestem = Repository_lookup_modifier (repo, ev, objectId, | filestem = Repository_lookup_modifier (repo, ev, objectId, "filestem"); | ||
if (filestem) { | if (filestem) { | ||
printf | printf | ||
Line 65: | Line 56: | ||
printf ("No filestem modifier could be found for %s\n", | printf ("No filestem modifier could be found for %s\n", | ||
objectId); | objectId); | ||
</pre> | </pre> | ||
==Related Methods== | ==Related Methods== | ||
*[[lookup_id]] | *[[lookup_id]] | ||
*[[lookup_name]] | *[[lookup_name]] | ||
[[Category:SOM IRF]] | [[Category:SOM IRF]] |
Latest revision as of 02:21, 8 November 2021
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);