

They call the lower-level fork and execve system calls, respectively. The fork and execve functions in glibc are examples of this. Many library functions, such as those in the C Standard Library, act as interfaces for abstraction of system calls. Public class Test implements LinkedList, HashSet Library functions and system calls

See Method for further implementation details.

Below is an example of part of a Java class that "inherits" from LinkedList and HashSet. In a programming language that does not support multiple inheritance of base classes, wrapper functions can be used to simulate it. It may rename parameters, combine parameters, set defaults for parameters, and the like. It is not deliverable code, but is not throwaway code either, being typically retained for use in regression testing.Īn interface adaptor is a kind of wrapper function that simplifies, tailors, or amplifies the interface to a code module, with the intent of making it more intelligible or relevant to the user. All calls to the original function can be replaces with calls to the wrapper, allowing the programmer to forget about error checking once the wrapper is written.Ī test driver is a kind of wrapper function that exercises a code module, typically calling it repeatedly, with different settings or parameters, in order to rigorously pursue each possible path. Wrapper functions can be used to write error checking routines for pre-existing system functions without increasing the length of a code by a large amount by repeating the same error check for each call to the function. This is especially useful when using existing library code. Wrapper functions can be used to adapt an existing class or object to have a different interface. In case the third party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.Īdapting class/object interfaces A wrapper can be written for each of the third party functions and used in the native application. Wrapper functions are useful in the development of applications that use third-party library functions. An example of this is the MouseAdapter and similar classes in the Java AWT library. Wrapper functions can be used to make writing computer programs easier. Wrapper functions are a means of delegation and can be used for a number of purposes. Wrapper functions are used to make writing computer programs easier by abstracting away the details of a subroutine's underlying implementation.

For wrapper methods in feature selection, see Feature selection § Wrapper method.Ī wrapper function is a function (another word for a subroutine) in a software library or a computer program whose main purpose is to call a second subroutine or a system call with little or no additional computation.
