本文整理汇总了C++中SharedBuffer::readNextBAShort方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedBuffer::readNextBAShort方法的具体用法?C++ SharedBuffer::readNextBAShort怎么用?C++ SharedBuffer::readNextBAShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedBuffer
的用法示例。
在下文中一共展示了SharedBuffer::readNextBAShort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TilesNotice::load( SharedBuffer& buf )
{
// Offset.
m_offset = buf.readNextBALong();
// start lat
m_startLatIdx = buf.readNextBALong();
// end lat
m_endLatIdx = buf.readNextBALong();
// start lon
m_startLonIdx = buf.readNextBALong();
// end lon
m_endLonIdx = buf.readNextBALong();
// Size of m_impRange.
m_nbrLayers = buf.readNextBAShort();
MC2_ASSERT( m_nbrLayers > 0 );
delete [] m_impRange;
m_impRange = new impRange_t[ m_nbrLayers ];
for ( uint32 i = 0; i < m_nbrLayers; ++i ) {
m_impRange[ i ].m_layerID = buf.readNextBAShort();
m_impRange[ i ].m_firstImp = buf.readNextBALong();
m_impRange[ i ].m_lastImp = buf.readNextBALong();
}
}
示例2: innerLoad
void
SFDLoadableHeader::loadRemainingHeader( SharedBuffer& buf )
{
// File size.
m_fileSize = buf.readNextBALong();
// The name.
m_name = buf.readNextString();
mc2dbg << "[SFDLH] m_name = " << m_name << endl;
// Check the file size.
if ( m_fileHandler->getFileSize() != m_fileSize ) {
m_state = failed_to_load;
m_nbrBytesToRead = 0;
innerLoad();
return;
}
// Creation time.
m_creationTime = buf.readNextBALong();
// Null terminated strings?
m_stringsAreNullTerminated = buf.readNextBAByte();
// Longest length of string.
m_maxStringSize = buf.readNextBAByte();
// Nbr initial chars.
byte nbrInitialChars = buf.readNextBAByte();
m_initialCharacters.resize( nbrInitialChars );
// Initial chars.
{for ( byte b = 0; b < nbrInitialChars; ++b ) {
m_initialCharacters[ b ] = buf.readNextBAByte();
}}
// Nbr route ids.
byte nbrRouteIDs = buf.readNextBAByte();
m_routeIDs.reserve( nbrRouteIDs );
{for ( byte b = 0; b < nbrRouteIDs; ++b ) {
uint32 id = buf.readNextBALong();
uint32 creationTime = buf.readNextBALong();
m_routeIDs.push_back( RouteID( id, creationTime ) );
}}
// Number of bits for the string index.
m_strIdxEntrySizeBits = buf.readNextBALong();
// Position for the start of strings index.
m_strIdxStartOffset = buf.readNextBALong();
// Number strings.
m_nbrStrings = buf.readNextBALong();
// Position for the start of string data.
m_strDataStartOffset = buf.readNextBALong();
// Position for the start of the buffers index.
m_bufferIdxStartOffset = buf.readNextBALong();
// Position for the start of the buffer data.
m_bufferDataStartOffset = buf.readNextBALong();
// If to read debug param strings for the multi buffers.
m_readDebugParams = buf.readNextBAByte();
// The tile collections.
uint32 nbrCollections = buf.readNextBAShort();
m_tileCollection.resize( nbrCollections );
{for ( uint32 i = 0; i < nbrCollections; ++i ) {
m_tileCollection[ i ].load( buf );
}}
// All is now loaded.
m_state = loaded_all_header;
m_nbrBytesToRead = 0;
innerLoad();
}