ignore

[ignore] pointer-member-type pointer-name;

pointer-member-type

Specifies the type of the pointer member of the structure or union.

pointer-name

Specifies the name of the pointer member that is to be ignored during marshalling.

 

Example

typedef struct _DBL_LINK_NODE_TYPE { 

    long value;

    struct _DBL_LINK_NODE_TYPE * next;

    [ignore] struct _DBL_LINK_NODE_TYPE * previous;

} DBL_LINK_NODE_TYPE;

 

Remarks

The ignore attribute designates that a pointer contained in a structure or union and the object indicated by the pointer is not transmitted. The ignore attribute is restricted to pointer members of structures or unions.

The value of a structure member with the ignore attribute is undefined at the destination. An in parameter is not defined at the remote computer. An out parameter is not defined at the local computer.

The ignore attribute allows you to prevent transmisison of data. This is useful in situations such as a double-linked list. The following example includes a double-linked list that introduces data aliasing:

/* IDL file */

typedef struct _DBL_LINK_NODE_TYPE { 

    long value;

    struct _DBL_LINK_NODE_TYPE * next;

    struct _DBL_LINK_NODE_TYPE * previous;

} DBL_LINK_NODE_TYPE;

 

void remote_op([in] DBL_LINK_NODE_TYPE * list_head);

 

/* application */

DBL_LINK_NODE_TYPE * p, * q

 

p = (DBL_LINK_NODE_TYPE *)

    midl_user_allocate(sizeof(DBL_LINK_NODE_TYPE));

q = (DBL_LINK_NODE_TYPE *)

    midl_user_allocate(sizeof(DBL_LINK_NODE_TYPE));

 

p->next = q; 

q->previous = p;

p->previous = q->next = NULL;

..

remote_op(p);

 

Aliasing occurs in the preceding example because the same memory area is available from two different pointers in the function p and p->next->previous.

Note that ignore cannot be used as a type attribute.

See Also

pointers, ptr, ref, unique