Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::message_buffer::alloc::con_msg_manager< message > Class Template Reference

#include <alloc.hpp>

Inheritance diagram for websocketpp::message_buffer::alloc::con_msg_manager< message >:
Collaboration diagram for websocketpp::message_buffer::alloc::con_msg_manager< message >:

Public Types

typedef con_msg_manager< messagetype
 
typedef lib::shared_ptr< con_msg_managerptr
 
typedef lib::weak_ptr< con_msg_managerweak_ptr
 
typedef message::ptr message_ptr
 

Public Member Functions

message_ptr get_message ()
 Get an empty message buffer.
 
message_ptr get_message (frame::opcode::value op, size_t size)
 Get a message buffer with specified size and opcode.
 
bool recycle (message *)
 Recycle a message.
 
message_ptr get_message (size_t size) const
 Get a message buffer with specified size.
 
bool recycle (message *msg)
 Recycle a message.
 

Detailed Description

template<typename message>
class websocketpp::message_buffer::alloc::con_msg_manager< message >

A connection message manager that allocates a new message for each request.

Definition at line 160 of file pool.hpp.

Member Typedef Documentation

◆ message_ptr

◆ ptr

template<typename message >
typedef lib::shared_ptr< con_msg_manager > websocketpp::message_buffer::alloc::con_msg_manager< message >::ptr

Definition at line 46 of file alloc.hpp.

◆ type

Definition at line 45 of file alloc.hpp.

◆ weak_ptr

template<typename message >
typedef lib::weak_ptr< con_msg_manager > websocketpp::message_buffer::alloc::con_msg_manager< message >::weak_ptr

Definition at line 47 of file alloc.hpp.

Member Function Documentation

◆ get_message() [1/3]

template<typename message >
message_ptr websocketpp::message_buffer::alloc::con_msg_manager< message >::get_message ( )
inline
Returns
A shared pointer to an empty new message

Definition at line 55 of file alloc.hpp.

55 {
56 return message_ptr(lib::make_shared<message>(type::shared_from_this()));
57 }

◆ get_message() [2/3]

template<typename message >
message_ptr websocketpp::message_buffer::alloc::con_msg_manager< message >::get_message ( frame::opcode::value op,
size_t size )
inline
Parameters
opThe opcode to use
sizeMinimum size in bytes to request for the message payload.
Returns
A shared pointer to a new message with specified size.

Definition at line 66 of file alloc.hpp.

66 {
67 return message_ptr(lib::make_shared<message>(type::shared_from_this(),op,size));
68 }

◆ get_message() [3/3]

template<typename message >
message_ptr websocketpp::message_buffer::alloc::con_msg_manager< message >::get_message ( size_t size) const
inline
Parameters
sizeMinimum size in bytes to request for the message payload.
Returns
A shared pointer to a new message with specified size.

Definition at line 173 of file pool.hpp.

173 {
174 return lib::make_shared<message>(size);
175 }

◆ recycle() [1/2]

template<typename message >
bool websocketpp::message_buffer::alloc::con_msg_manager< message >::recycle ( message * )
inline

This method shouldn't be called. If it is, return false to indicate an error. The rest of the method recycle chain should notice this and free the memory.

Parameters
msgThe message to be recycled.
Returns
true if the message was successfully recycled, false otherwse.

Definition at line 80 of file alloc.hpp.

80 {
81 return false;
82 }

◆ recycle() [2/2]

template<typename message >
bool websocketpp::message_buffer::alloc::con_msg_manager< message >::recycle ( message * msg)
inline

This method shouldn't be called. If it is, return false to indicate an error. The rest of the method recycle chain should notice this and free the memory.

Parameters
msgThe message to be recycled.
Returns
true if the message was successfully recycled, false otherwse.

Definition at line 187 of file pool.hpp.

187 {
188 return false;
189 }

The documentation for this class was generated from the following files: