mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 18:44:00 +02:00
fix for templated read/write in PacketList
This commit is contained in:
parent
b0b8dd2e7d
commit
86a218ad20
2 changed files with 7 additions and 7 deletions
|
@ -551,7 +551,7 @@ std::unique_ptr<NLPacket> LimitedNodeList::constructPingReplyPacket(const QByteA
|
|||
return replyPacket;
|
||||
}
|
||||
|
||||
std::unique_ptr<NLPacket> constructICEPingPacket(PingType_t pingType, const QUuid& iceID) {
|
||||
std::unique_ptr<NLPacket> LimitedNodeList::constructICEPingPacket(PingType_t pingType, const QUuid& iceID) {
|
||||
int packetSize = NUM_BYTES_RFC4122_UUID + sizeof(PingType_t);
|
||||
|
||||
auto icePingPacket = NLPacket::create(PacketType::ICEPing, packetSize);
|
||||
|
@ -562,7 +562,7 @@ std::unique_ptr<NLPacket> constructICEPingPacket(PingType_t pingType, const QUui
|
|||
return icePingPacket;
|
||||
}
|
||||
|
||||
std::unique_ptr<NLPacket> constructICEPingReplyPacket(const QByteArray& pingPacket, const QUuid& iceID) {
|
||||
std::unique_ptr<NLPacket> LimitedNodeList::constructICEPingReplyPacket(const QByteArray& pingPacket, const QUuid& iceID) {
|
||||
// pull out the ping type so we can reply back with that
|
||||
PingType_t pingType;
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ template <class T> std::unique_ptr<NLPacket> PacketList<T>::createPacketWithExte
|
|||
}
|
||||
}
|
||||
|
||||
template<typename T> qint64 Packet::readPrimitive(T* data) {
|
||||
return QIODevice::read(reinterpret_cast<char*>(data), sizeof(T));
|
||||
template<class T> template<typename U> qint64 PacketList<T>::readPrimitive(U* data) {
|
||||
return QIODevice::read(reinterpret_cast<char*>(data), sizeof(U));
|
||||
}
|
||||
|
||||
template<typename T> qint64 Packet::writePrimitive(const T& data) {
|
||||
static_assert(!std::is_pointer<T>::value, "T must not be a pointer");
|
||||
return QIODevice::write(reinterpret_cast<const char*>(&data), sizeof(T));
|
||||
template<class T> template<typename U> qint64 PacketList<T>::writePrimitive(const U& data) {
|
||||
static_assert(!std::is_pointer<U>::value, "T must not be a pointer");
|
||||
return QIODevice::write(reinterpret_cast<const char*>(&data), sizeof(U));
|
||||
}
|
||||
|
||||
template <class T> qint64 PacketList<T>::writeData(const char* data, qint64 maxSize) {
|
||||
|
|
Loading…
Reference in a new issue