本文整理汇总了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;
}
示例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, ¤tFid,
(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;
}