28#ifndef WEBSOCKETPP_MESSAGE_BUFFER_ALLOC_HPP
29#define WEBSOCKETPP_MESSAGE_BUFFER_ALLOC_HPP
36namespace message_buffer {
86 if (!msg->recycle()) {
100template <
typename con_msg_manager>
103 typedef lib::shared_ptr<message>
ptr;
118 return m_extension_data;
138 typename con_msg_manager::ptr shared = m_manager.lock();
141 return shared->(recycle(
this));
150 std::string m_header;
151 std::string m_extension_data;
152 std::string m_payload;
159template <
typename message>
162 typedef lib::shared_ptr<con_msg_manager>
ptr;
163 typedef lib::weak_ptr<con_msg_manager>
weak_ptr;
174 return lib::make_shared<message>(size);
194template <
typename con_msg_manager>
204 return lib::make_shared<con_msg_manager>();
message_ptr get_message(size_t size) const
Get a message buffer with specified size.
bool recycle(message *msg)
Recycle a message.
lib::weak_ptr< con_msg_manager > weak_ptr
lib::shared_ptr< con_msg_manager > ptr
con_msg_man_ptr get_manager() const
Get a pointer to a connection message manager.
con_msg_manager::ptr con_msg_man_ptr
Represents a buffer for a single WebSocket message.
bool recycle()
Recycle the message.
const std::string & get_header() const
const std::string & get_extension_data() const
con_msg_manager::weak_ptr con_msg_man_ptr
lib::shared_ptr< message > ptr
frame::opcode::value get_opcode() const
con_msg_man_type::ptr con_msg_man_ptr
const std::string & get_payload() const
message(con_msg_man_ptr manager, size_t size=128)
void message_deleter(T *msg)
Custom deleter for use in shared_ptrs to message.
Namespace for the WebSocket++ project.
#define T(meth, val, expected)