//
//   COMPONENT_NAME: some
//
//   ORIGINS: 27
//
//
//    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996 
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//
//#  @(#) somc/scmethod.idl 2.8 5/9/96 15:31:16 [12/22/96 21:12:09]


#ifndef scmethod_idl
#define scmethod_idl

#include <sccommon.idl>
interface SOMTClassEntryC;
interface SOMTParameterEntryC;
interface SOMTDataEntryC;
interface SOMTStructEntryC;

interface SOMTMethodEntryC : SOMTCommonEntryC
{
  readonly attribute boolean somtIsVarargs;
  // Returns 1 (true) if this method definition has a variable length
  // parameter list.

  readonly attribute SOMTMethodEntryC somtOriginalMethod;
  // If this is an override method definition (<SOMTOverrideMethodE>)
  // then this is the method definition entry that orginially
  // introduced the method.

  readonly attribute SOMTClassEntryC somtOriginalClass;
  // If this is an override method definition (<SOMTOverrideMethodE>)
  // then this is the class definition entry that orginially
  // introduced the method.

  readonly attribute SOMTEntryC somtMethodGroup;
  // The group this method is defined in within a class definition.

  readonly attribute boolean somtIsPrivateMethod;
  // Whether or not the method is private.

  readonly attribute boolean somtIsOneway;
  // Whether or not the method is oneway.

  readonly attribute short somtArgCount;
  // The number of arguments for the method.

  SOMTParameterEntryC somtGetFirstParameter();
  
  // Returns the first formal parameter entry for this method if it
  // has one and NULL otherwise.  Note: the target object parameter is
  // not included, therefore the first parameter is really the second
  // parameter from a SOM runtime perspective.

  SOMTParameterEntryC somtGetNextParameter();
  
  // Returns the next formal parameter entry for this method if it has
  // one and NULL otherwise.

  string somtGetIDLParamList(in string buffer);
  // Returns the formal parameter list (in IDL syntax) for this method.
  // The parameter list is built in <buffer> and the address of <buffer>
  // is returned.
  // Parameters are delimited with newlines.
  // The method receiver and any implicit method arguments are NOT included.

  string somtGetShortCParamList(in string buffer, 
                      in string selfParm, 
                      in string varargsParm);
  
  // Returns the formal parameter list (in ANSI C function prototype
  // form, with types) for this method. The parameter list is built in 
  // <buffer> and the address of <buffer> is returned.
  // Parameters are delimited with newlines.
  // If this method takes a variable number of arguments then the
  // final parameter substring is replaced by <varargsParm>, unless
  // <varargsParm> is NULL in which case the final parameter is
  // removed.
  // If <selfParm> is not null then it is added as an initial
  // parameter. (The <selfParm> string may actually contain multiple
  // parameters, delimited by newline characters.)
  // The method receiver and any implicit method arguments are NOT
  // included.
  // The types of the method parameters are given in C form (with pointer
  // stars, where needed) rather than in the IDL form.

  string somtGetFullCParamList(in string buffer, in string varargsParm);
  // Same as somtGetShortCParamList except that the method receiver and
  // any implicit method arguments (Environment and Context) are included.
  // The types of the method parameters are given in C form (with pointer
  // stars, where needed) rather than in the IDL form.

  string somtGetShortParamNameList(in string buffer, 
                       in string selfParm, 
                       in string varargsParm);
  
  // Returns the parameter list for this method in call form (without
  // types). The argument list is built in <buffer> and the address of 
  // <buffer> is returned. Parameters are delimited with newlines.
  // If this method takes a variable number of arguments then the
  // final parameter is replaced by <varargsParm>, unless
  // <varargsParm> is NULL in which case the final parameter is removed.
  // If <selfParm> is not null then it is added as an initial
  // parameter. (The <selfParm> string may actually contain multiple
  // parameters, delimited by newline characters.)
  // The method receiver and any implicit method arguments are NOT
  // included.

  string somtGetFullParamNameList(in string buffer, in string varargsParm);
  // Same as somtGetParamNameList except that the method receiver and
  // any implicit method arguments (Environment and Context) are included.

  SOMTParameterEntryC somtGetNthParameter(in short n);
  // Returns the object representing the nth explicit method parameter.

  SOMTStructEntryC somtGetFirstException();
  // The first exception this method raises.
  SOMTStructEntryC somtGetNextException();
 // The next exception this method raises,
 // relative to the previous call to this method or to
 // somtGetFirstException.

  readonly attribute string *somtContextArray;
  // An array of the context string-literals for the method.

  readonly attribute string somtCReturnType;
  // The C datatype the method returns. This may not correspond to the
  // IDL data type (in particular, pointer stars may be added).

#ifdef __SOMIDL__
  implementation {

    releaseorder: _get_somtIsVarargs, _get_somtOriginalMethod, 
                  _get_somtOriginalClass, _get_somtMethodGroup, 
                  somtGetFirstParameter, somtGetNextParameter, 
                  somtGetArgList, somtGetParmList, 
                  _get_somtIsPrivateMethod, _get_somtIsOneway, 
                  _get_somtArgCount, somtGetFirstException, 
                  somtGetNextException, _get_somtContextArray, 
                  somtGetShortCPrototype, somtGetFullCPrototype, 
                  somtGetShortParmList, somtGetFullParmList, 
                  somtGetNthParameter, _get_somtCReturnType, 
                  somtGetIDLParamList, somtGetShortCParamList, 
                  somtGetFullCParamList, somtGetShortParamNameList, 
                  somtGetFullParamNameList;


    //# Class Modifiers
    majorversion = 2;
    minorversion = 1;
    filestem = scmethod;
#ifdef _WIN32
    dllname = "some.dll";
#endif
    callstyle = oidl; 
  
    //# Internal Instance Variables
    SOMTParameterEntryC nextParameter;     
  
    //# Method Modifiers
    somtSetSymbolsOnEntry: override;
    somDumpSelfInt: override;
  
    //# Attribute Modifiers
    somtIsVarargs: nodata;
    somtOriginalClass: nodata;
    somtOriginalMethod: nodata;
    somtMethodGroup: nodata;
    somtIsPrivateMethod: nodata;
    somtIsOneway: nodata;
    somtArgCount: nodata;
    somtContextArray: nodata;
    somtCReturnType: nodata;
  
  };
#endif /* __SOMIDL__ */
};


#endif  /* scmethod_idl */
