The dictionary examples, described above, refer to engine-wide dictionaries. This means, that specific dictionaries changes will affect each Engine session with only this FIX protocol dictionary. Nevertheless, sometimes there is a need to use different FIX dictionaries in different FIX sessions within the same engine. The OnixS C++ FIX Engine supports such per session dictionaries in the following manner.
To focus the scope of a dictionary definition from engine-wise to a session level, the dictionary definition must be enhanced with additional attribute
idattribute, then C++ FIX Engine will not use it for all sessions. Instead of this, such a dictionary can be used for specific sessions only.
In a source code, an instance of the OnixS::FIX::Dictionary class must be created. Its constructor accepts only one parameter, which identifies the dictionary a user would like to use for the session. The value of this parameter must be the same as in the XML description. Once an instance of OnixS::FIX::Dictionary is created, the FIX session can be initialized. The OnixS::FIX::Session initialization is performed in the usual way with the single difference only: instead of supplying the version of the FIX protocol, the instance of the appropriate Dictionary class must be passed. After that the created session will operate, using specified FIX dictionary.
To send messages of certain dictionary, the instance of the OnixS::FIX:Dictionary class must be supplied during Message construction.