PODSPodNew( )

Creates and returns a new PODSPod object. Allocates memory for the POD and tells M-Business Client about this POD. Your implementation may also perform any other initialization functions that your POD requires.

Interface

Not part of any interface

IDL definition

Not applicable

JavaScript synopsis

Not applicable

C synopsis
PODSPod* PODSPodNew(PODSAvantGo* podsavantgo)
Parameters
  • podsavantgo   The PODSAvantGo object.

Returns

None

Remarks

This is a required function that must allocate enough memory for the PODSPod structure. PODSPodNew( ) is where a POD would normally register any document sources, object sources, and event handlers. You may perform any other necessary initialization tasks in this function. For example, if your server routinely accesses a database, you might set up access to that database in this method. The simplest way of allocating memory is to make this call:

PODSPod* pod = (PODSPod *) MemPtrNew(sizeof(PODSPod));

Your POD may require more memory than the PODSPod structure provides. For example, you might need to store the handle of an open database that the POD uses. In this case, you can subclass PODSPod by defining a structure that contains both the PODSPod and the extra fields you need:

typedef MyPod 
{ 
    PODSPod base; 
    UInt    dbHandle; 
};

.... 
PODSPod* podSPodNew(PODSAvantGo*podsavantgo) { 
    MyPod *pod = (MyPod *)MemPtrNew(sizeof(MyPod)); 
   .... 
    return (PODSPod *)pod; 
}

To set up the POD’s function table, see Implementing the PODSObject object.

See also

PODSObject object's destroy( )