当前位置: 首页>>代码示例>>C++>>正文


C++ Series::getEncoder方法代码示例

本文整理汇总了C++中Series::getEncoder方法的典型用法代码示例。如果您正苦于以下问题:C++ Series::getEncoder方法的具体用法?C++ Series::getEncoder怎么用?C++ Series::getEncoder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Series的用法示例。


在下文中一共展示了Series::getEncoder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: encodeEnumTypeDictionary

void DataDictionaryImpl::encodeEnumTypeDictionary(Series& series, UInt32 verbosity)
{
	if (!_loadedEnumTypeDef)
	{
		throwIueException("The enumerated types dictionary was not loaded");
	}

	SeriesEncoder& seriesEncoder = static_cast<SeriesEncoder&>(const_cast<Encoder&>(series.getEncoder()));

	UInt32 enumTypeDictionarySize = _pRsslDataDictionary->enumTableCount > 0 ? (_pRsslDataDictionary->enumTableCount * DEFAULT_ENUM_TABLE_ENTRY_SIZE ) 
		: DEFAULT_ENCODE_ITERATOR_BUFFER_SIZE;

	EncodeIterator* pEncodeIterator;

	if (!seriesEncoder.hasEncIterator())
	{
		seriesEncoder.acquireEncIterator(enumTypeDictionarySize);
		pEncodeIterator = seriesEncoder._pEncodeIter;
	}
	else
	{
		pEncodeIterator = seriesEncoder._pEncodeIter;
		pEncodeIterator->clear(enumTypeDictionarySize);
	}

	RsslRet ret;

	while ((ret = rsslEncodeEnumTypeDictionary(&pEncodeIterator->_rsslEncIter, _pRsslDataDictionary,
		(RDMDictionaryVerbosityValues)verbosity, &_errorText)) == RSSL_RET_DICT_PART_ENCODED)
	{
		pEncodeIterator->reallocate(pEncodeIterator->_allocatedSize * 2);
	}

	if (ret != RSSL_RET_SUCCESS)
	{
		thomsonreuters::ema::access::EmaString errorText("Failed to encode the enumerated type definition");
		errorText.append(CR).append("Reason='").append(_errorText.data).append("'");

		throwIueException(errorText);
	}

	pEncodeIterator->setEncodedLength(rsslGetEncodedBufferLength(&(pEncodeIterator->_rsslEncIter)));

	seriesEncoder._containerComplete = true;
}
开发者ID:thomsonreuters,项目名称:Elektron-SDK,代码行数:45,代码来源:DataDictionaryImpl.cpp

示例2: encodeFieldDictionary

bool DataDictionaryImpl::encodeFieldDictionary(Series& series, Int32& currentFid, UInt32 verbosity, UInt32 fragmentationSize)
{
	if (!_loadedFieldDictionary)
	{
		throwIueException("The field dictionary information was not loaded");
	}

	SeriesEncoder& seriesEncoder = static_cast<SeriesEncoder&>(const_cast<Encoder&>(series.getEncoder()));

	UInt32 fieldDictionarySize = fragmentationSize != 0 ? fragmentationSize : DEFAULT_FRAGMENTATION_SIZE;

	EncodeIterator* pEncodeIterator;

	if (!seriesEncoder.hasEncIterator())
	{
		seriesEncoder.acquireEncIterator(fieldDictionarySize);
		pEncodeIterator = seriesEncoder._pEncodeIter;
	}
	else
	{
		pEncodeIterator = seriesEncoder._pEncodeIter;
		pEncodeIterator->clear();
		pEncodeIterator->reallocate(fieldDictionarySize);
	}

	RsslRet ret;

	if (pEncodeIterator->_allocatedSize != fieldDictionarySize)
	{
		RsslBuffer* rsslBuffer = pEncodeIterator->_rsslEncBuffer1.data ? &pEncodeIterator->_rsslEncBuffer1 : &pEncodeIterator->_rsslEncBuffer2;

		rsslBuffer->length = fieldDictionarySize;

		RsslRet ret = rsslSetEncodeIteratorBuffer(&pEncodeIterator->_rsslEncIter, rsslBuffer);
		if (ret != RSSL_RET_SUCCESS)
		{
			throwIueException("Failed to set RsslEncodeIterator buffer in DataDictionaryImpl::encodeFieldDictionary(fragmentationSize).");
		}
	}

	ret = rsslEncodeFieldDictionary(&pEncodeIterator->_rsslEncIter, _pRsslDataDictionary, &currentFid, 
		(RDMDictionaryVerbosityValues)verbosity, &_errorText);

	if (ret == RSSL_RET_SUCCESS)
	{
		pEncodeIterator->setEncodedLength(rsslGetEncodedBufferLength(&(pEncodeIterator->_rsslEncIter)));
		seriesEncoder._containerComplete = true;

		return true;
	}
	else if ( ret == RSSL_RET_DICT_PART_ENCODED )
	{
		pEncodeIterator->setEncodedLength(rsslGetEncodedBufferLength(&(pEncodeIterator->_rsslEncIter)));
		seriesEncoder._containerComplete = true;

		return false;
	}

	thomsonreuters::ema::access::EmaString errorText("Failed to encode the field dictionary information with fragementation size ");
	errorText.append(fieldDictionarySize).append(CR).append("Reason='").append(_errorText.data).append("'");

	throwIueException(errorText);

	return false;
}
开发者ID:thomsonreuters,项目名称:Elektron-SDK,代码行数:65,代码来源:DataDictionaryImpl.cpp


注:本文中的Series::getEncoder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。