Concepts: Handle & Session

Handle

In order to provide a uniform interface for accessing various object types, so-called handles are made available. All objects that can be manipulated by the API are referenced via handles, i.e. an object type is assigned to each handle. Using these handles, objects such as projects, pages, and components can be accessed. Most functions of the API expect such handles as parameters and they will also return a handle. A handle is a 32-bit-signed integer. Negative handles are invalid (apart from a few exceptions).

In order to avoid memory leaks, all generated handles should be released with the eplCloseObject function as soon as they are not needed any more.

The different object types are defined in the "EplanApiObjTypes.h" file and have the EPL_OBJECTTYPE_ prefix. The object type of a handle can be determined via the eplGetType API function.

Session

Each handle belongs to exactly one session. A handle is only valid within a session. If a session is closed via the eplDestroySession function, all handles of this session are released. If several programs access the same data, each program gets its own session.