mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 02:17:11 +02:00
Compile fixes
This commit is contained in:
parent
1932703fec
commit
d496b33ae6
3 changed files with 13 additions and 9 deletions
|
@ -38,6 +38,7 @@
|
||||||
#include "Node.h"
|
#include "Node.h"
|
||||||
#include "NLPacket.h"
|
#include "NLPacket.h"
|
||||||
#include "PacketHeaders.h"
|
#include "PacketHeaders.h"
|
||||||
|
#include "PacketList.h"
|
||||||
#include "UUIDHasher.h"
|
#include "UUIDHasher.h"
|
||||||
|
|
||||||
const int MAX_PACKET_SIZE = 1450;
|
const int MAX_PACKET_SIZE = 1450;
|
||||||
|
@ -67,6 +68,7 @@ Q_DECLARE_METATYPE(SharedNodePointer)
|
||||||
using namespace tbb;
|
using namespace tbb;
|
||||||
typedef std::pair<QUuid, SharedNodePointer> UUIDNodePair;
|
typedef std::pair<QUuid, SharedNodePointer> UUIDNodePair;
|
||||||
typedef concurrent_unordered_map<QUuid, SharedNodePointer, UUIDHasher> NodeHash;
|
typedef concurrent_unordered_map<QUuid, SharedNodePointer, UUIDHasher> NodeHash;
|
||||||
|
using NLPacketList = PacketList<NLPacket>;
|
||||||
|
|
||||||
typedef quint8 PingType_t;
|
typedef quint8 PingType_t;
|
||||||
namespace PingType {
|
namespace PingType {
|
||||||
|
@ -147,8 +149,8 @@ public:
|
||||||
qint64 sendUnreliablePacket(NLPacket& packet, const HifiSockAddr& sockAddr) {};
|
qint64 sendUnreliablePacket(NLPacket& packet, const HifiSockAddr& sockAddr) {};
|
||||||
qint64 sendPacket(NLPacket&& packet, const SharedNodePointer& destinationNode) {};
|
qint64 sendPacket(NLPacket&& packet, const SharedNodePointer& destinationNode) {};
|
||||||
qint64 sendPacket(NLPacket&& packet, const HifiSockAddr& sockAddr) {};
|
qint64 sendPacket(NLPacket&& packet, const HifiSockAddr& sockAddr) {};
|
||||||
qint64 sendPacketList(PacketList& packetList, const SharedNodePointer& destinationNode) {};
|
qint64 sendPacketList(NLPacketList& packetList, const SharedNodePointer& destinationNode) {};
|
||||||
qint64 sendPacketList(PacketList& packetList, const HifiSockAddr& sockAddr) {};
|
qint64 sendPacketList(NLPacketList& packetList, const HifiSockAddr& sockAddr) {};
|
||||||
|
|
||||||
void (*linkedDataCreateCallback)(Node *);
|
void (*linkedDataCreateCallback)(Node *);
|
||||||
|
|
||||||
|
@ -173,7 +175,7 @@ public:
|
||||||
int updateNodeWithDataFromPacket(const SharedNodePointer& matchingNode, const QByteArray& packet);
|
int updateNodeWithDataFromPacket(const SharedNodePointer& matchingNode, const QByteArray& packet);
|
||||||
int findNodeAndUpdateWithDataFromPacket(const QByteArray& packet);
|
int findNodeAndUpdateWithDataFromPacket(const QByteArray& packet);
|
||||||
|
|
||||||
unsigned broadcastToNodes(PacketList& packetList, const NodeSet& destinationNodeTypes) {};
|
unsigned broadcastToNodes(NLPacketList& packetList, const NodeSet& destinationNodeTypes) {};
|
||||||
SharedNodePointer soloNodeOfType(char nodeType);
|
SharedNodePointer soloNodeOfType(char nodeType);
|
||||||
|
|
||||||
void getPacketStats(float &packetsPerSecond, float &bytesPerSecond);
|
void getPacketStats(float &packetsPerSecond, float &bytesPerSecond);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
/// Storage of not-yet processed inbound, or not yet sent outbound generic UDP network packet
|
/// Storage of not-yet processed inbound, or not yet sent outbound generic UDP network packet
|
||||||
class NetworkPacket {
|
class NetworkPacket {
|
||||||
public:
|
public:
|
||||||
NetworkPacket() { }
|
NetworkPacket();
|
||||||
NetworkPacket(const NetworkPacket& packet); // copy constructor
|
NetworkPacket(const NetworkPacket& packet); // copy constructor
|
||||||
NetworkPacket& operator= (const NetworkPacket& other); // copy assignment
|
NetworkPacket& operator= (const NetworkPacket& other); // copy assignment
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
#ifndef hifi_PacketList_h
|
#ifndef hifi_PacketList_h
|
||||||
#define hifi_PacketList_h
|
#define hifi_PacketList_h
|
||||||
|
|
||||||
#pragma once
|
#include <QIODevice>
|
||||||
|
|
||||||
|
#include "PacketHeaders.h"
|
||||||
|
|
||||||
template <class T> class PacketList : public QIODevice {
|
template <class T> class PacketList : public QIODevice {
|
||||||
public:
|
public:
|
||||||
|
@ -20,7 +22,7 @@ public:
|
||||||
|
|
||||||
virtual bool isSequential() const { return true; }
|
virtual bool isSequential() const { return true; }
|
||||||
|
|
||||||
void startSegment() { _segmentStartIndex = currentPacket->payload().pos(); }
|
void startSegment() { _segmentStartIndex = _currentPacket->payload().pos(); }
|
||||||
void endSegment() { _segmentStartIndex = -1; }
|
void endSegment() { _segmentStartIndex = -1; }
|
||||||
|
|
||||||
void closeCurrentPacket();
|
void closeCurrentPacket();
|
||||||
|
@ -28,7 +30,7 @@ public:
|
||||||
void setExtendedHeader(const QByteArray& extendedHeader) { _extendedHeader = extendedHeader; }
|
void setExtendedHeader(const QByteArray& extendedHeader) { _extendedHeader = extendedHeader; }
|
||||||
protected:
|
protected:
|
||||||
qint64 writeData(const char* data, qint64 maxSize);
|
qint64 writeData(const char* data, qint64 maxSize);
|
||||||
qint64 readData(const char* data, qint64 maxSize) { return 0 };
|
qint64 readData(const char* data, qint64 maxSize) { return 0; };
|
||||||
private:
|
private:
|
||||||
void createPacketWithExtendedHeader();
|
void createPacketWithExtendedHeader();
|
||||||
|
|
||||||
|
@ -40,7 +42,7 @@ private:
|
||||||
|
|
||||||
int _segmentStartIndex = -1;
|
int _segmentStartIndex = -1;
|
||||||
|
|
||||||
QByteArray _extendedHeader = extendedHeader;
|
QByteArray _extendedHeader;
|
||||||
}
|
};
|
||||||
|
|
||||||
#endif // hifi_PacketList_h
|
#endif // hifi_PacketList_h
|
||||||
|
|
Loading…
Reference in a new issue