Basic approach

Aside from a few notable exceptions, such as the PODS header file, pods.h, and podspod.h, the source files for PODS are Interface Definition Language (IDL) files. The vast majority of header files in M-Business Anywhere are generated from the IDL files. This API reference documents the details of calling each method in each interface, through the method's associated macro.

As you work with this documentation, the header files, and the IDL files, you will notice that there is a pattern between what you see in the IDL file and what is documented in the C Syntax heading for any particular method. As you become more comfortable with PODS, you may want to try using the IDL files as your primary documentation. In particular, you will find any developer comments in the IDL files, rather than in the generated header files.

Using only the IDL file, you can derive the syntax for calling any given method through its macro by following the steps below. If the IDL definitions are from the W3C DOM spec, see Differences for ADOMDOMImplementation object methods.

To derive the syntax for calling any given method through its macro
  1. Open the IDL file that contains the method you want to use.

    For an example, we will look at several methods in the podssubmissionmgr.idl file.

  2. Locate the interface definition section for the interface containing the method you want to use.

    Some IDL files (and corresponding header files) contain multiple interface definitions. In our example, we will look at several methods in the PODSSubmission interface. The relevant lines from that file are listed below:

    ... 
    interface PODSSubmission : PODSObject 
    { 
        attribute PODSString            status; 
    ... 
        readonly attribute PODSUInt32 submissionElementCount; 
    ... 
        PODSSubmissionElement
               submissionElementForName(
               PODSString name); 
    ...
  3. Locate the line for the method you want to use

    The details of the steps for deriving method syntax from the method's line in the IDL file differ slightly, depending on the way the line appears in the file. The three lines in the example above, from the PODSSubmission interface definition in the podssubmissionmgr.idl file, illustrate each of these cases.

  4. Derive the syntax for the method you want to use as follows:

    If the first term in the IDL file line is attribute, then there are two associated methods, a get and a set. The first method line in our example is of this type:

    attribute PODSString status

    • Drop the attribute term:

      PODSString status;

    • Make the first letter of the method name uppercase and prefix it with get (or set, as appropriate):

      PODSString getStatus;

    • Prefix this method name with PODS:

      PODSString PODSgetStatus;

    • Add parentheses following the method name:

      PODSString PODSgetStatus( );

    • Inside the parentheses, add a pointer to the object named in the object definition statement:

      PODSString PODSgetStatus(PODSSubmission*);

    • To the right of the object pointer, add a variable referring to the object itself:

      PODSString PODSgetStatus(PODSSubmission* sub);

    If the first term in the IDL file line is readonly attribute, then there is only one associated method, a get. The second method line in our example is of this type:

    readonly attribute PODSUInt32 submissionElementCount;

    • Drop the readonly attribute term:

      PODSUInt32 submissionElementCount;

    • Make the first letter of the method name uppercase and prefix it with get:

      PODSUInt32 getSubmissionElementCount;

    • Prefix this method name with PODS:

      PODSUInt32 PODSgetSubmissionElementCount;

    • Add parentheses following the method name:

      PODSUInt32 PODSgetSubmissionElementCount( );

    • Inside the parentheses, add a pointer to the object named in the object definition statement:

      PODSUInt32 PODSgetSubmissionElementCount(PODSSubmission*);

    • To the right of the object pointer, add a variable referring to the object itself:

      PODSUInt32 PODSgetSubmissionElementCount(PODSSubmission* sub);

    If the first term in the IDL file line is something other than attribute or readonly attribute, then the associated method is neither a set nor a get. The third method line in our example is of this type:

    PODSSubmissionElement submissionElementForName(PODSString name);

    • Prefix the method name with PODS—do not capitalize the first letter of the method name:

      PODSSubmissionElement PODSsubmissionElementForName(PODSString name);

    • Inside the parentheses, add a pointer to the object named in the object definition statement as the very first argument:

      PODSSubmissionElement PODSsubmissionElementForName(PODSSubmission* PODSString name);

    • To the right of the object pointer, add a variable referring to the object itself, followed by a comma:

      PODSSubmissionElement PODSsubmissionElementForName(PODSSubmission* sub, PODSString name);

  5. If there are additional arguments to the right of the object pointer (not present in the three examples above), there are two additional changes you may need to make to have the correct syntax:

    • If no variable is supplied in the IDL file, as is the case with attributes, you must add one.

    • If the argument is an object, you must make the object name into a pointer by adding an asterisk (*) to its right. This is true only for types specified as interface at the top of the file (or in included files). If the type is specified as typedef, an asterisk is not required.