Пример #1
0
void Value_Raw::To( I_PacketSnd* inPacket, bool inBlock ) const
{
	argused1(inBlock);

	FixParamCount fixParamCount( inPacket );
	
	bool IsNull = bool( m_pStart == nullptr );
	inPacket->put_BoolParam(IsNull);
	
	if( !IsNull )
	{
		vuint32 Len = vuint32(m_pEnd - m_pStart);
		inPacket->put_ULongParam(Len);
		if( Len )
		{
			inPacket->put_BinaryParam(reinterpret_cast<void*>(m_pStart), Len);
		}
	}
}
Пример #2
0
void ArraySet::To( 
	I_PacketSnd*	inPacket,
	bool		  	inBlock ) const
{
	argused1(inBlock);
	
	FixParamCount fixParamCount( inPacket );
	
	// Type of set.
	inPacket->put_UCharParam(vuint8(1));

	if( mpStart )
	{
		vuint32 allocLen  = static_cast<vuint32>((mpStorageEnd - mpStart) * sizeof(vuint32));
		vuint32 actualLen = static_cast<vuint32>((mpFinish - mpStart)     * sizeof(vuint32));

		// 1) Allocated len (in bytes).
		inPacket->put_ULongParam(allocLen);

		if( actualLen > 0 )
		{
			// 2) Actual len (in bytes).
			inPacket->put_ULongParam(actualLen);
			
			// 3) Data of actual len.
			inPacket->put_BinaryParam( mpStart, actualLen );

			// 4) 'Sorted' flag.
			inPacket->put_BoolParam(mIsSorted);
		}
		else
		{
			inPacket->put_ULongParam(0UL);
		}
	}
	else
	{
		inPacket->put_ULongParam(0UL);
	}
}