Overview
C API (Component Interface)
struct EventGetPort { UINT32 flags; Symbol hSet; struct ComponentSpec spec; struct HandledEvent* handledEvent; const char* name; UINT32 index; };

This event accesses a Port on an input Set, returning a handle to the Port and, optionally, associating an event with the Port. Optionally, the content of the Port is validated to ensure it meets the passed Component Specification.

Fields

UINT32 flags IN
None defined (must be zero).
Symbol hSet IN
A handle to the Set which is being queried. Can also be a handle to a Process, in which case the default input set of that Process is targeted.
ComponentSpec spec IN
The SystemML class and release that is required to be supported by the Data on the specified Port. The actual Data object present may not be exactly that specified, but it will support the requested interface.
HandledEvent* handledEvent IN
If not NULL, the event will be attached to the port.
const char* name IN
The name of the Port to retrieve, or NULL (cannot be specified with index).
UINT32 index IN
The index of the Port to retrieve, or INDEX_UNDEFINED (cannot be specified with name).

Return Values

See also SystemML Interface Return Values.

  • E_INVALID_ARG if name is non-NULL and index is not equal to INDEX_UNDEFINED.
  • E_INVALID_ARG if name is NULL and index is equal to INDEX_UNDEFINED.
  • A handle to the specified Port.

Example

Taken from std/data/numeric.

C++ Source Code (against 1199)
void attachSub(Symbol hComponent, const char* name, UINT32 index) { EventGetPort getPort; getPort.hSet = hSet ? hSet : hComponent; // hComponent means use the default set getPort.flags = 0; getPort.spec.cls = "std/2009/data/numeric"; getPort.spec.release = 0; getPort.handledEvent = &hev; getPort.name = name; getPort.index = index; EngineEvent event; event.hCaller = hComponent; event.flags = 0; event.type = ENGINE_EVENT_GET_PORT; event.data = &getPort; hPort = brahms_engineEvent(&event); if (S_ERROR(hPort)) throw hPort; }