提交 730858f9 编写于 作者: Y youngwolf 提交者: youngowlf

Continue last commit.

上级 e281531a
......@@ -24,7 +24,7 @@
#ifdef _MSC_VER
#if _MSC_VER >= 1600
#warning Your compiler is Visual C++ 10.0 or higher, you can use the standard edition to gain some performance improvement.
#pragma message("Your compiler is Visual C++ 10.0 or higher, you can use the standard edition to gain some performance improvement.")
#endif
#elif defined(__GNUC__)
//After a roughly reading from gcc.gnu.org and clang.llvm.org, I believed that the minimum version of GCC and Clang that support c++0x
......
......@@ -157,9 +157,6 @@ public:
protected:
buffer_type buffer;
};
typedef auto_buffer<i_buffer> replaceable_buffer;
//replaceable_packer and replaceable_unpacker used replaceable_buffer as their msg type, so they're replaceable,
//shared_buffer<i_buffer> is available too.
//convert '->' operation to '.' operation
//user need to allocate object, and shared_buffer will free it
......@@ -193,6 +190,9 @@ protected:
};
//not like auto_buffer, shared_buffer is copyable, but auto_buffer is a bit more efficient.
typedef auto_buffer<i_buffer> replaceable_buffer;
//packer or/and unpacker used replaceable_buffer (or shared_buffer) as their msg type will be replaceable.
//packer concept
template<typename MsgType>
class i_packer
......
......@@ -12,11 +12,7 @@
//but file_server only receive talking message, not send talking message proactively), the previous message has been
//sent to file_client, so sending buffer will always be empty, which means we will never operate sending buffer concurrently,
//so need no locks.
#if !defined(_MSC_VER) || _MSC_VER > 1800
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<> //before C++ 14.0, auto_buffer will lead compilation error, who can tell me why?
#else
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<shared_buffer<i_buffer>>
#endif
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<>
//configuration
#include "../include/st_asio_wrapper_server.h"
......
......@@ -10,11 +10,7 @@
//but file_server only receive talking message, not send talking message proactively), the previous message has been
//sent to file_client, so sending buffer will always be empty, which means we will never operate sending buffer concurrently,
//so need no locks.
#if !defined(_MSC_VER) || _MSC_VER > 1800
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<> //before C++ 14.0, auto_buffer will lead compilation error, who can tell me why?
#else
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<shared_buffer<i_buffer>>
#endif
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<>
//configuration
#include "file_socket.h"
......
......@@ -154,9 +154,6 @@ public:
protected:
buffer_type buffer;
};
typedef auto_buffer<i_buffer> replaceable_buffer;
//replaceable_packer and replaceable_unpacker used replaceable_buffer as their msg type, so they're replaceable,
//shared_buffer<i_buffer> is available too.
//convert '->' operation to '.' operation
//user need to allocate object, and shared_buffer will free it
......@@ -193,6 +190,13 @@ protected:
};
//not like auto_buffer, shared_buffer is copyable, but auto_buffer is a bit more efficient.
#if !defined(_MSC_VER) || _MSC_VER > 1800
typedef auto_buffer<i_buffer> replaceable_buffer;
#else
typedef shared_buffer<i_buffer> replaceable_buffer; //before C++ 14.0, auto_buffer will lead compilation error, who can tell me why?
#endif
//packer or/and unpacker used replaceable_buffer as their msg type will be replaceable.
//packer concept
template<typename MsgType>
class i_packer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册