Interface

Applies to: general, cpp, python

An interface is a contract: the operations a piece of code promises to provide, independent of how those operations are implemented.

struct Sensor {
    virtual double read() const = 0;
};

See also: api, abstraction, virtual-function