mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Move qdeclare/qregister calls to their respective class header
This commit is contained in:
parent
4dddb508a8
commit
21e9d30bbe
5 changed files with 9 additions and 7 deletions
|
@ -13,6 +13,8 @@
|
|||
|
||||
using namespace udt;
|
||||
|
||||
static int packetMetaTypeId = qRegisterMetaType<Packet*>("Packet*");
|
||||
|
||||
int Packet::localHeaderSize(bool isPartOfMessage) {
|
||||
return sizeof(Packet::SequenceNumberAndBitField) +
|
||||
(isPartOfMessage ? sizeof(Packet::MessageNumberAndBitField) + sizeof(MessagePartNumber) : 0);
|
||||
|
|
|
@ -88,7 +88,9 @@ private:
|
|||
mutable PacketPosition _packetPosition { PacketPosition::ONLY };
|
||||
mutable MessagePartNumber _messagePartNumber { 0 };
|
||||
};
|
||||
|
||||
|
||||
} // namespace udt
|
||||
|
||||
Q_DECLARE_METATYPE(udt::Packet*);
|
||||
|
||||
#endif // hifi_Packet_h
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
using namespace udt;
|
||||
|
||||
static int packetListMetaTypeId = qRegisterMetaType<PacketList*>("PacketList*");
|
||||
|
||||
std::unique_ptr<PacketList> PacketList::create(PacketType packetType, QByteArray extendedHeader,
|
||||
bool isReliable, bool isOrdered) {
|
||||
auto packetList = std::unique_ptr<PacketList>(new PacketList(packetType, extendedHeader,
|
||||
|
|
|
@ -118,4 +118,6 @@ template<typename T> std::unique_ptr<T> PacketList::takeFront() {
|
|||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(udt::PacketList*);
|
||||
|
||||
#endif // hifi_PacketList_h
|
||||
|
|
|
@ -24,16 +24,10 @@
|
|||
|
||||
using namespace udt;
|
||||
|
||||
Q_DECLARE_METATYPE(Packet*);
|
||||
Q_DECLARE_METATYPE(PacketList*);
|
||||
|
||||
Socket::Socket(QObject* parent) :
|
||||
QObject(parent),
|
||||
_synTimer(new QTimer(this))
|
||||
{
|
||||
qRegisterMetaType<Packet*>("Packet*");
|
||||
qRegisterMetaType<PacketList*>("PacketList*");
|
||||
|
||||
connect(&_udpSocket, &QUdpSocket::readyRead, this, &Socket::readPendingDatagrams);
|
||||
|
||||
// make sure our synchronization method is called every SYN interval
|
||||
|
|
Loading…
Reference in a new issue