OnixS C++ FIX Engine  4.3.0
API Documentation
Dictionary-independent mode usage

Both of FAST decoders (OnixS::FIX::FAST::Decoder and OnixS::FIX::FAST::EventBasedDecoder) could be initialized in dictionary-independent mode. This means that there is no need to specify FIX Dictionary for a Decoder's constructor. The decoder will generate appropriate dictionary basing on the FAST template content. Generated Dictionary will be accessible via OnixS::FIX::FAST::Decoder::fixDictionary and becomes permanent for the Engine (until OnixS::FIX::Engine::shutdown called).

It is quite similar to using of the OnixS::FIX::FAST::Decoder::generateFixDictionary method, but the dictionary identifier is chosen by the decoder itself on the base of FAST template content.

Note
The single instance of the dictionary will be created even if there are several instances of decoders that were initialized by the same FAST template.
using namespace OnixS::FIX;
using namespace OnixS::FIX::FAST;
std::string generatedDictionaryId;
EngineSettings settings;
Engine::init(settings);
std::ifstream templatesStream("templates/FastTemplates_FDMM.xml");
assert(templatesStream);
const std::string xmlFastTemplates((std::istreambuf_iterator<char>(templatesStream)), std::istreambuf_iterator<char>());
const bool DecodeEachMessageIndependently = true;
assert(!xmlFastTemplates.empty());
{
// Initialize decoder in dictionary-independent mode.
FAST::Decoder decoder(xmlFastTemplates, DecodeEachMessageIndependently, InputDataTraits::CouldContainPartialMessages);
// Access the generated dictionary.
Dictionary dictionary = decoder.fixDictionary();
// Store dictionary identifier
generatedDictionaryId = dictionary.id();
//
// ... Decoding details are the same as in previous samples
//
}
// Access generated dictionary using identifier much later after decoding session.
Dictionary dictionary(generatedDictionaryId.c_str());