6. The API

_images/api_main_flow.png

A generic interface handling all applied spectral wave formulations

In this section we define the official API to be utilized in application programs.

In general the API provides an abstract base class defining a generic syntax for how to obtain kinematics and to extract metadata.

Specialized classes are derived from the base class in order to implement actual algorithms for a specific wave formulation. For an actual shape type, as defined in the theory section, there might be several specialized classes based on different implementations and algorithms.

The API provides a special constructor which allocate and initialize an instance of a proper specialized class based on the content of the actual SWD and an optional request for specific implementation.

When the specific instance has been initialized, the generic syntax from the base class applies in the application program is independent on the actual wave formulation.

Examples of using the API are located in the programming application section. It is recommended to study those examples before investigating the API.

The language specific API’s are very similar: