uint32 DestinationsProviderPublic::getFavoritesAllData(uint16 startIdx, uint16 endIdx, uint32 dst) const { if (dst == MsgBufferEnums::ADDR_DEFAULT) { dst = m_defaultDst; } uint32 src = m_owner->getRequestId(); MsgBuffer *buf = new MsgBuffer(dst, src, MsgBufferEnums::GET_FAVORITES_ALL_DATA_REQ, 64); buf->writeNextUnaligned16bit(startIdx); buf->writeNextUnaligned16bit(endIdx); m_queue->insert(buf); return src; } // DestinationsProviderPublic::getFavoritesAllData
uint32 DestinationsProviderPublic::sortFavorites(GuiProtEnums::SortingType sortingOrder, uint32 dst) const { if (dst == MsgBufferEnums::ADDR_DEFAULT) { dst = m_defaultDst; } uint32 src = m_owner->getRequestId(); MsgBuffer *buf = new MsgBuffer(dst, src, MsgBufferEnums::SORT_FAVORITES_REQ, 64); buf->writeNextUnaligned16bit(sortingOrder); m_queue->insert(buf); return src; }
uint32 DestinationsConsumerPublic::getFavoritesReply( vector<GuiFavorite*>& guiFavorites, uint32 dst ) const { if (dst == MsgBufferEnums::ADDR_DEFAULT) { dst = m_defaultDst; } uint32 src = m_owner->getRequestId(); uint32 bufferSize = guiFavorites.size() * GuiFavorite::MAX_GUI_FAV_SIZE + 2; MsgBuffer *buf = new MsgBuffer(dst, src, MsgBufferEnums::GET_FAVORITES_REPLY, bufferSize); buf->writeNextUnaligned16bit(guiFavorites.size()); for (uint16 i = 0; i < guiFavorites.size(); i++){ guiFavorites[i]->serialize(buf); } m_queue->insert(buf); return src; } // DestinationsConsumerPublic::getFavoritesReply
uint32 DestinationsConsumerPublic::getFavoritesAllDataReply( vector<Favorite*>& favorites, uint32 dst ) const { if (dst == MsgBufferEnums::ADDR_DEFAULT) { dst = m_defaultDst; } uint32 src = m_owner->getRequestId(); uint32 bufferSize = 2; uint16 i = 0; for ( i = 0 ; i < favorites.size() ; ++i ) { bufferSize += favorites[ i ]->getSize(); } MsgBuffer *buf = new MsgBuffer(dst, src, MsgBufferEnums::GET_FAVORITES_ALL_DATA_REPLY, bufferSize); buf->writeNextUnaligned16bit(favorites.size()); for ( i = 0 ; i < favorites.size() ; ++i ) { favorites[ i ]->serialize( buf ); } m_queue->insert(buf); return src; } // DestinationsConsumerPublic::getFavoritesAllDataReply