Discriminator

In distributed computing, a discriminator is a typed tag field present in OMG IDL discriminated union type and value definitions that determines which union member is selected in the current union instance.[1][2] Unlike in some conventional programming languages offering support for unions, discriminator in IDL is not identical to selected field name. Here is an example of IDL union type definition:

union Register switch (char) 
{
    case 'a':
    case 'b': short AX;

    case 'c': long EAX;

    default:  octet AL;
};

Effective value of the Register type may contain AX as selected field, but discriminator value may be either 'a' or 'b' and it is stored in memory separately. Therefore, IDL logically separates information about currently selected field name and union effective value from information about current discriminator value. In the example above, discriminator value may be anything of the following: 'a', 'b', 'c', as well as all other characters belonging to the IDL char type, since the default branch specified in the example Register type allows use of the remaining characters as well.

Other languages

The Microsoft Interface Definition Language also supports tagged unions, allowing to choose the discriminator via an attribute in an enclosing structure or function.[3]

gollark: Indeed, bee (etc.).
gollark: https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode seems like it would allow you to supply raw audio data.
gollark: It says you can use other nodes to meddle with volume and such.
gollark: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
gollark: It says you can also use sound files.

References


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.