mirror of
https://github.com/edubart/otclient.git
synced 2025-12-29 02:47:12 +01:00
Huge engine change, replace all std::shared_ptrs
Create a new shared pointer type stdext::shared_object_ptr and stdext::shared_obj using boost::intrusive_ptr Advantages: * half memory usage * faster and lightweight Disadvantages: * using weak_ptr is not supported anymore * compiling seems slower
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include <framework/core/timer.h>
|
||||
#include <framework/core/declarations.h>
|
||||
|
||||
class Connection : public std::enable_shared_from_this<Connection>, boost::noncopyable
|
||||
class Connection : public stdext::shared_object
|
||||
{
|
||||
typedef std::function<void(const boost::system::error_code&)> ErrorCallback;
|
||||
typedef std::function<void(uint8*, uint16)> RecvCallback;
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
bool isConnecting() { return m_connecting; }
|
||||
bool isConnected() { return m_connected; }
|
||||
|
||||
ConnectionPtr asConnection() { return self_cast<Connection>(); }
|
||||
protected:
|
||||
void onConnect(const boost::system::error_code& error);
|
||||
void onWrite(const boost::system::error_code& error, size_t);
|
||||
|
||||
Reference in New Issue
Block a user