14 #ifndef hifi_OctreeSendThread_h
15 #define hifi_OctreeSendThread_h
19 #include <GenericThread.h>
21 #include <OctreePacketData.h>
22 #include "OctreeQueryNode.h"
24 class OctreeQueryNode;
27 using AtomicUIntStat = std::atomic<uintmax_t>;
36 void setIsShuttingDown();
37 bool isShuttingDown() {
return _isShuttingDown; }
39 QUuid getNodeUuid()
const {
return _nodeUuid; }
41 static AtomicUIntStat _totalBytes;
42 static AtomicUIntStat _totalWastedBytes;
43 static AtomicUIntStat _totalPackets;
45 static AtomicUIntStat _totalSpecialBytes;
46 static AtomicUIntStat _totalSpecialPackets;
48 static AtomicUIntStat _usleepTime;
49 static AtomicUIntStat _usleepCalls;
53 virtual bool process()
override;
55 virtual bool traverseTreeAndSendContents(SharedNodePointer node, OctreeQueryNode* nodeData,
56 bool viewFrustumChanged,
bool isFullScene);
57 virtual bool traverseTreeAndBuildNextPacketPayload(EncodeBitstreamParams& params,
const QJsonObject& jsonFilters) = 0;
60 QWeakPointer<Node> _node;
66 virtual void preDistributionProcessing() = 0;
67 int handlePacketSend(SharedNodePointer node, OctreeQueryNode* nodeData,
bool dontSuppressDuplicate =
false);
68 int packetDistributor(SharedNodePointer node, OctreeQueryNode* nodeData,
bool viewFrustumChanged);
70 virtual bool hasSomethingToSend(OctreeQueryNode* nodeData) = 0;
71 virtual bool shouldStartNewTraversal(OctreeQueryNode* nodeData,
bool viewFrustumChanged) = 0;
73 int _truePacketsSent { 0 };
74 int _trueBytesSent { 0 };
75 int _packetsSentThisInterval { 0 };
76 bool _isShuttingDown {
false };
Definition: GenericThread.h:23
Handles packing of the data portion of PacketType_OCTREE_DATA messages.
Definition: OctreePacketData.h:93
Threaded processor for sending octree packets to a single client.
Definition: OctreeSendThread.h:30
virtual bool process() override
Implements generic processing behavior for this thread.
Definition: OctreeSendThread.cpp:69
Handles assignments of type OctreeServer - sending octrees to various clients.
Definition: OctreeServer.h:38