home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / cntxt.idl < prev    next >
Text File  |  1996-12-24  |  6KB  |  167 lines

  1. //#  @(#) 2.18 src/somd/cntxt.idl, somd, som3.0 9/26/96 14:01:23 [12/24/96 07:39:22]
  2.  
  3. //
  4. //   COMPONENT_NAME: somd
  5. //
  6. //   ORIGINS: 27
  7. //
  8. //
  9. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996 
  10. //   All Rights Reserved
  11. //   Licensed Materials - Property of IBM
  12. //   US Government Users Restricted Rights - Use, duplication or
  13. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. //
  15.  
  16. //  IDL specification for the CORBA Context Object.
  17. //  A Context object contains a list of properties, each consisting of a name
  18. //  and a string value associated with that name.  Context properties represent
  19. //  information about the client, environment, or circumstances of a request
  20. //  that are inconvenient to pass as parameters.
  21.  
  22.  
  23.  
  24. #ifndef context_idl
  25. #define context_idl
  26.  
  27. #include <somobj.idl>
  28. #include <somdtype.idl>
  29.  
  30. interface NVList;
  31.  
  32. interface Context : SOMObject
  33. {
  34.   ORBStatus set_one_value(in Identifier prop_name, in string value);
  35.  
  36.   //  This method sets or adds a single context object property. If prop_name
  37.   //  does not exist in the property list, it is added. If prop_name
  38.   //  does exist, its value is changed.
  39.   //  A nonzero return result indicates failure.
  40.   //
  41.  
  42.   ORBStatus set_values(in NVList values);
  43.  
  44.   //  This method sets or changes one or more property values in the context
  45.   //  object. If a prop_name specified in the NVList does not exist in the
  46.   //  Context object property list, it is added. If a prop_name specified in
  47.   //  the NVList does exist in the Context object property list, its value
  48.   //  is changed.
  49.   //  A nonzero return result indicates failure.
  50.   //
  51.  
  52.   ORBStatus get_values(in  Identifier start_scope,
  53.                        in  Flags op_flags,
  54.                        in  Identifier prop_name,
  55.                        out NVList values);
  56.  
  57.   //  This method retrieves the specified context property value(s). If
  58.   //  prop_name has a trailing wildcard ("*"), then all matching properties
  59.   //  and their values are returned. The returned NVList (values) is the 
  60.   //  responsibility of the caller.
  61.   //
  62.   //  If no matching properties are found, and error is returned the property
  63.   //  list (values) contains no property values.
  64.   //  A nonzero return result indicates failure.
  65.   //
  66.   //  start_scope indicates the context object level at which to initiate the search
  67.   //  for the specified properties (e.g. "_USER", "_SYSTEM"). If the property
  68.   //  is not found at the indicated level, the search continues up the context
  69.   //  object tree until a match is found or all context objects in the chain
  70.   //  have been searched.
  71.   //
  72.   //  If start_scope name is NULL, the search begins with the target Context
  73.   //  object. If the specified start_scope name is not found, an exception is
  74.   //  returned.
  75.   //
  76.   //  The op_flags may specify CTX_RESTRICT_SCOPE, indicating that searching
  77.   //  is to be limited to the specified search scope or Context object.
  78.  
  79.   ORBStatus delete_values(in Identifier prop_name);
  80.  
  81.   //  This method deletes the specified property value(s) from the context
  82.   //  object.  If prop_name has a trailing wildcard character ("*"), then
  83.   //  all property names which match will be deleted.
  84.   //
  85.   //  Search scope is always limited to the target context object.
  86.   //
  87.   //  If no matching property is found, an exception is returned.
  88.   //  A nonzero return result indicates failure.
  89.   //
  90.  
  91.   ORBStatus create_child(in  Identifier ctx_name,
  92.                          out Context child_ctx);
  93.  
  94.   //
  95.   //  This method creates a child context object.
  96.   //
  97.   //  The returned context object is chained to its parent context. That is,
  98.   //  searches on the child context object will look in the parent context
  99.   //  (and so on, up the context tree), if necessary, for matching property
  100.   //  names.
  101.   //  A nonzero return result indicates failure.
  102.   //
  103.   //  The ctx_name parameter indicates the name of the child Context object.
  104.   //  The child_ctx parameter is used to return the new child Context object.
  105.   //
  106.  
  107.   ORBStatus destroy(in Flags flags);
  108.  
  109.   //  This operation deletes the indicated context object.
  110.   //  The following "flags" may be specified:
  111.   //
  112.   //  CTX_DELETE_DESCENDENTS    Deletes the indicated context object and all
  113.   //                            of its descendent context objects as well.
  114.   //
  115.   //  An exception is returned if there are one or more child context objects
  116.   //  and the CTX_DELETE_DESCENDENTS flag was not set.
  117.   //  A nonzero return result indicates failure.
  118.   //
  119.  
  120.  
  121. #ifdef __SOMIDL__
  122.  
  123.   implementation
  124.   {
  125.     releaseorder: set_one_value, set_values, get_values,
  126.                   delete_values, create_child, destroy,
  127.                   _get_context_name, _set_context_name,
  128.                   _get_context_parent, _set_context_parent,
  129.                   _get_properties, _set_properties;
  130.  
  131.     //# Class Modifiers
  132.     callstyle=idl;
  133.     dllname = "somd.dll";
  134.     majorversion = 2;
  135.     minorversion = 2;
  136.     functionprefix = context_;
  137.  
  138.     //# Method Modifiers
  139.     somDefaultInit: override;
  140.     somDestruct: override;
  141.  
  142.     //# Passthrus
  143.     #define COMMON_H_PASSTHRU \
  144.       "" \
  145.       "/*" \
  146.       " * Context flags" \
  147.       " */" \
  148.       "#define CTX_DELETE_DESCENDENTS      0x00000200" \
  149.       "#define CTX_RESTRICT_SCOPE          0x00000400" \
  150.       ""
  151.     passthru C_xh_after = COMMON_H_PASSTHRU;
  152.     passthru C_h_after  = COMMON_H_PASSTHRU
  153.       ""
  154.       "/* alias for CORBA compatibility */"
  155.       "#ifndef Context_delete"
  156.       "#define Context_delete Context_destroy"
  157.       "#endif"
  158.       ""
  159.       ; /* end C_h_passthru */
  160.   };
  161.  
  162. #endif /* __SOMIDL__ */
  163.  
  164. };
  165.  
  166. #endif  /* context_idl */
  167.