shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
This commit is contained in:
@@ -10,7 +10,7 @@ class DataOutputStream;
|
||||
|
||||
class Packet;
|
||||
|
||||
typedef shared_ptr<Packet> (*packetCreateFn)();
|
||||
typedef std::shared_ptr<Packet> (*packetCreateFn)();
|
||||
|
||||
class Packet
|
||||
{
|
||||
@@ -62,10 +62,10 @@ public:
|
||||
|
||||
Packet();
|
||||
|
||||
static shared_ptr<Packet> getPacket(int id);
|
||||
static std::shared_ptr<Packet> getPacket(int id);
|
||||
|
||||
// 4J Added
|
||||
static bool canSendToAnyClient(shared_ptr<Packet> packet);
|
||||
static bool canSendToAnyClient(std::shared_ptr<Packet> packet);
|
||||
|
||||
static void writeBytes(DataOutputStream *dataoutputstream, byteArray bytes);
|
||||
static byteArray readBytes(DataInputStream *datainputstream);
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
static vector<PacketStatistics *> renderableStats;
|
||||
static int renderPos;
|
||||
public:
|
||||
static void recordOutgoingPacket(shared_ptr<Packet> packet);
|
||||
static void recordOutgoingPacket(std::shared_ptr<Packet> packet);
|
||||
static void renderPacketStats(int id);
|
||||
static void renderAllPacketStats();
|
||||
static void renderAllPacketStatsKey();
|
||||
@@ -91,8 +91,8 @@ private :
|
||||
//static int nextPrint;
|
||||
|
||||
public:
|
||||
static shared_ptr<Packet> readPacket(DataInputStream *dis, bool isServer);
|
||||
static void writePacket(shared_ptr<Packet> packet, DataOutputStream *dos);
|
||||
static std::shared_ptr<Packet> readPacket(DataInputStream *dis, bool isServer);
|
||||
static void writePacket(std::shared_ptr<Packet> packet, DataOutputStream *dos);
|
||||
static void writeUtf(const wstring& value, DataOutputStream *dos);
|
||||
static wstring readUtf(DataInputStream *dis, int maxLength);
|
||||
virtual void read(DataInputStream *dis) = 0; // throws IOException = 0; TODO 4J JEV, should this declare a throws?
|
||||
@@ -100,12 +100,12 @@ public:
|
||||
virtual void handle(PacketListener *listener) = 0;
|
||||
virtual int getEstimatedSize() = 0;
|
||||
virtual bool canBeInvalidated();
|
||||
virtual bool isInvalidatedBy(shared_ptr<Packet> packet);
|
||||
virtual bool isInvalidatedBy(std::shared_ptr<Packet> packet);
|
||||
virtual bool isAync();
|
||||
|
||||
// 4J Stu - Brought these functions forward for enchanting/game rules
|
||||
static shared_ptr<ItemInstance> readItem(DataInputStream *dis);
|
||||
static void writeItem(shared_ptr<ItemInstance> item, DataOutputStream *dos);
|
||||
static std::shared_ptr<ItemInstance> readItem(DataInputStream *dis);
|
||||
static void writeItem(std::shared_ptr<ItemInstance> item, DataOutputStream *dos);
|
||||
static CompoundTag *readNbt(DataInputStream *dis);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user