Elektron example 421_marketPrice_programmaticConfig

about DictionanyType

FileDictionary (0): The EMA loads the
dictionaries from the files specified in the
parameters RdmFieldDictionaryFileName and
EnumTypeDefFileName.
ChannelDictionary (1): The EMA downloads
dictionaries by requesting the dictionaries from the
upstream provider.

This is from the Manual, Now look at the code:

innerMap.addKeyAscii( "Dictionary_1", MapEntry::AddEnum,
ElementList()
.addEnum( "DictionaryType", 1 )
.addAscii( "RdmFieldDictionaryFileName", "./RDMFieldDictionary" )
.addAscii( "EnumTypeDefFileName", "./enumtype.def" ).complete() ).complete();

The question: you specify type 1 here, which mean use ChannelDictionary, why do you need provide RdmFieldDictionaryFileName and EnumTypeDefFileName;

Best Answer

  • You are correct. There is no need to provide RdmFieldDictionaryFileName and EnumTypeDefFileName when the DictionaryType is 1 (ChannelDictionary). If the file name configurations are provided while DictionaryType is ChannelDictionary, EMA will just ignore the file names.

    I believe that developer just want to demonstrate how these configurations are programmatically specified.

Answers