[Quickfix-developers] Field name to number conversion - Part 1
Brought to you by:
orenmnero
From: George H. <ge...@so...> - 2008-08-19 22:46:59
|
Marcus, Thank you for the very helpful hint. Below is my code for properly reading the config file and selecting the different keywords. I am specifically looking for the data dictionary. Next, I will process the "Field" Entries in the Data Dictionary and match them with my "interested fields" file. I will crack this problem yet :) Question: Since each "SESSION" might have a different data dictionary specified, how should I attack this? Here is the code: Application application; FIX::Settings::Sections section; bool useDataDictionary = true; FIX::SessionSettings settings; // // This is NOT the Data Dictionary but the config file Dictionary FIX::Dictionary myCFile_Dictionary; FIX::Dictionary dict, Dsection; // // Let's start by setting up the config file settings = FIX::SessionSettings( strCFile ); myCFile_Dictionary = settings.get(); // FIX::FileStoreFactory storeFactory( settings ); FIX::ScreenLogFactory logFactory( settings ); // if ( myCFile_Dictionary.has( FIX::USE_DATA_DICTIONARY ) ) { useDataDictionary = myCFile_Dictionary.getBool( FIX::USE_DATA_DICTIONARY ); std::set < FIX::SessionID > myid = settings.getSessions(); std::set < FIX::SessionID >::iterator i; // // Process the entries in the Data Dictionary looking for the "DataDictionary" and // print what we found for( i = myid.begin(); i != myid.end(); ++i ) { // We loop through "SESSION" entries if( verbose ) { std::cout << "\t[SESSION]" << std::endl; FIX::Dictionary Dsection = settings.get( *i ); // Get the dictionary // std::string sendid = Dsection.getString( FIX::SENDERCOMPID ); std::cout << "\t\tSenderCompID = " << sendid << std::endl; std::string tid = Dsection.getString( FIX::TARGETCOMPID ); std::cout << "\t\tTargetCompID = " << tid << std::endl; std::string path = Dsection.getString( FIX::DATA_DICTIONARY ); std::cout << "\t\tDataDictionary = " << path << std::endl; } } } else { std::cerr << "\tError: Data Dictionary must be specified in order to validate tags\n"; return 1; } -George On Aug 18, 2008, at 3:06 AM, Marcus Monaghan wrote: > Hi George, > > Just thinking slightly out of the box, the fix dictionary file is in > XML. On application start up, you could read in your string fields > from > the config, and then look them up in the Dictionary file to get their > numerical equivalent. > > Regards, > > Marcus Monaghan > Development > > Winterflood Securities Limited > > *** IMPORTANT NOTICE *** > > This message (including any attachments) is confidential and is for > the intended recipient only. If you are not the intended recipient, > please inform the sender and delete any copies from your system. > Internet communications are not secure and therefore Winterflood > Securities Ltd does not accept legal responsibility for any of its > contents (including any attachments) and any view expressed by the > sender as these are not necessarily the views of Winterflood > Securities Ltd. > > > Although all emails sent and received by Winterflood Securities Ltd > are passed through extensive virus scanning technologies, we cannot > guarantee the email (including attachments) is virus free. You > should take whatever measures you deem appropriate within your > organisation to ensure maximum protection. > > Registered Office: The Atrium Building, Cannon Bridge, 25 Dowgate > Hill, London, EC4R 2GA. Registered in England No. 2242204. > > Winterflood Securities Limited is authorised and regulated by the > Financial Services Authority. > |