Ejemplo n.º 1
0
void AppClient::decode(const Msg& msg, bool complete)
{
	switch (msg.getPayload().getDataType())
	{
		case DataType::SeriesEnum:
		{
			if (msg.getName() == "RWFFld")
			{
				//APIQA	
				dataDictionary.decodeFieldDictionary(msg.getPayload().getSeries(), filter);

				if (complete)
				{
					fldComplete = true;
				}
			}

			else if (msg.getName() == "RWFEnum")
			{
				//APIQA	
				dataDictionary.decodeEnumTypeDictionary(msg.getPayload().getSeries(), filter);

				if (complete)
				{
					enumComplete = true;
				}
			}

			if (fldComplete && enumComplete)
			{
				cout << endl << "Dictionary download complete" << endl;
				cout << "Dictionary Id : " << dataDictionary.getDictionaryId() << endl;
				cout << "Dictionary field version : " << dataDictionary.getFieldVersion() << endl;
				cout << "Number of dictionary entries : " << dataDictionary.getEntries().size() << endl;

				if ( dumpDictionary )
					cout << dataDictionary << endl;
			}
		}
	}
}