diff --git a/libraries/networking/src/NetworkPacket.cpp b/libraries/networking/src/NetworkPacket.cpp index 69bd0962bf..b2d1a14d77 100644 --- a/libraries/networking/src/NetworkPacket.cpp +++ b/libraries/networking/src/NetworkPacket.cpp @@ -18,38 +18,38 @@ #include "NetworkPacket.h" -void NetworkPacket::copyContents(const SharedNodePointer& node, const QByteArray& packet) { +void NetworkPacket::copyContents(const SharedNodePointer& node, const NLPacket& packet) { if (packet.size() && packet.size() <= MAX_PACKET_SIZE) { _node = node; - _byteArray = packet; + _nlPacket = packet; } else { qCDebug(networking, ">>> NetworkPacket::copyContents() unexpected length = %d", packet.size()); } } -NetworkPacket::NetworkPacket(const NetworkPacket& packet) { - copyContents(packet.getNode(), packet.getByteArray()); +NetworkPacket::NetworkPacket(const NetworkPacket& other) { + copyContents(other._node, other._packet); } -NetworkPacket::NetworkPacket(const SharedNodePointer& node, const QByteArray& packet) { +NetworkPacket::NetworkPacket(const SharedNodePointer& node, const NLPacket& packet) { copyContents(node, packet); }; // copy assignment NetworkPacket& NetworkPacket::operator=(NetworkPacket const& other) { - copyContents(other.getNode(), other.getByteArray()); + copyContents(other._node, other._packet); return *this; } #ifdef HAS_MOVE_SEMANTICS // move, same as copy, but other packet won't be used further -NetworkPacket::NetworkPacket(NetworkPacket && packet) { - copyContents(packet.getNode(), packet.getByteArray()); +NetworkPacket::NetworkPacket(NetworkPacket&& other) { + copyContents(other._node, other._packet); } // move assignment NetworkPacket& NetworkPacket::operator=(NetworkPacket&& other) { - copyContents(other.getNode(), other.getByteArray()); + copyContents(other._node, other._packet); return *this; } #endif diff --git a/libraries/networking/src/NetworkPacket.h b/libraries/networking/src/NetworkPacket.h index caee42f126..92c6a8ba59 100644 --- a/libraries/networking/src/NetworkPacket.h +++ b/libraries/networking/src/NetworkPacket.h @@ -24,20 +24,20 @@ public: NetworkPacket& operator= (const NetworkPacket& other); // copy assignment #ifdef HAS_MOVE_SEMANTICS - NetworkPacket(NetworkPacket&& packet); // move?? // same as copy, but other packet won't be used further + NetworkPacket(NetworkPacket&& other); // move?? // same as copy, but other packet won't be used further NetworkPacket& operator= (NetworkPacket&& other); // move assignment #endif - NetworkPacket(const SharedNodePointer& node, const QByteArray& byteArray); + NetworkPacket(const SharedNodePointer& node, const NLPacket& nlPacket); const SharedNodePointer& getNode() const { return _node; } - const QByteArray& getByteArray() const { return _byteArray; } + const NLPacket& getPacket() const { return _nlPacket; } private: - void copyContents(const SharedNodePointer& node, const QByteArray& byteArray); + void copyContents(const SharedNodePointer& node, const NLPacket& nlPacket); SharedNodePointer _node; - QByteArray _byteArray; + NLPacket _nlPacket; }; #endif // hifi_NetworkPacket_h