Discriminator

Discriminator

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].

References



Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • discriminator — discriminatór s. n., pl. discriminatoáre Trimis de siveco, 10.08.2004. Sursa: Dicţionar ortografic  DISCRIMINATÓR s.n. (Telec.) Demodulator de frecvenţă. [< fr. discriminateur]. Trimis de LauraGellner, 22.02.2005. Sursa: DN  DISCRIMINATÓR s …   Dicționar Român

  • Discriminator — Dis*crim i*na tor, n. [LL.] One who discriminates. [1913 Webster] …   The Collaborative International Dictionary of English

  • discriminator — [di skrim′i nāt΄ər] n. 1. one that discriminates 2. Radio a circuit for demodulating frequency modulated or phase modulated carrier waves …   English World dictionary

  • discriminator — diskriminatorius statusas T sritis automatika atitikmenys: angl. discriminator vok. Diskriminator, m rus. дискриминатор, m pranc. discriminateur, m …   Automatikos terminų žodynas

  • discriminator — diskriminatorius statusas T sritis fizika atitikmenys: angl. discriminator vok. Diskriminator, m rus. дискриминатор, m pranc. discriminateur, m …   Fizikos terminų žodynas

  • discriminator — noun Date: 1828 one that discriminates; especially a circuit that can be adjusted to accept or reject signals of different characteristics (as amplitude or frequency) …   New Collegiate Dictionary

  • discriminator — /di skrim euh nay teuhr/, n. 1. a person or thing that discriminates. 2. Electronics. a circuit in which the output is a function of some variation of an input signal from a fixed characteristic. [1820 30; < LL; see DISCRIMINATE, TOR] * * * …   Universalium

  • discriminator — noun a) A person who discriminates or differentiates b) Any of several electronic devices that convert some property of a signal into an amplitude whose value is proportional to the difference between the value of the input signal and that of a… …   Wiktionary

  • discriminator — dis·crim·i·na·tor (dis krimґĭ na″tər) a circuit in which output is a function of how the input signal compares with one or more standard or reference signals …   Medical dictionary

  • discriminator — n. person or thing able to recognize differences; person or thing that shows discernment; one who discriminates …   English contemporary dictionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”