Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES)
set (Boost_USE_MULTITHREADED TRUE)
set (Boost_ADDITIONAL_VERSIONS "1.39.0" "1.40.0" "1.41.0" "1.42.0" "1.43.0" "1.44.0" "1.46.1") # todo: someone who knows better spesify these!

find_package (Boost 1.39.0 COMPONENTS "${WEBSOCKETPP_BOOST_LIBS}")
find_package (Boost 1.39.0 COMPONENTS ${WEBSOCKETPP_BOOST_LIBS})

if (Boost_FOUND)
# Boost is a project wide global dependency.
Expand Down
6 changes: 5 additions & 1 deletion websocketpp/endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ class endpoint : public config::transport_type, public config::endpoint_base {


/// Destructor
~endpoint<connection,config>() {}
#if __cplusplus >= 202002L
~endpoint() {}
#else
~endpoint<connection,config>() {}
#endif

#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
// no copy constructor because endpoints are not copyable
Expand Down
52 changes: 51 additions & 1 deletion websocketpp/logger/basic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,50 +58,100 @@ namespace log {
template <typename concurrency, typename names>
class basic {
public:
#if __cplusplus >= 202002L
basic(channel_type_hint::value h =
channel_type_hint::access)
: m_static_channels(0xffffffff)
, m_dynamic_channels(0)
, m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {}
#else
basic<concurrency,names>(channel_type_hint::value h =
channel_type_hint::access)
: m_static_channels(0xffffffff)
, m_dynamic_channels(0)
, m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {}
#endif

#if __cplusplus >= 202002L
basic(std::ostream * out)
: m_static_channels(0xffffffff)
, m_dynamic_channels(0)
, m_out(out) {}
#else
basic<concurrency,names>(std::ostream * out)
: m_static_channels(0xffffffff)
, m_dynamic_channels(0)
, m_out(out) {}
#endif

#if __cplusplus >= 202002L
basic(level c, channel_type_hint::value h =
channel_type_hint::access)
: m_static_channels(c)
, m_dynamic_channels(0)
, m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {}
#else
basic<concurrency,names>(level c, channel_type_hint::value h =
channel_type_hint::access)
: m_static_channels(c)
, m_dynamic_channels(0)
, m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {}
#endif

#if __cplusplus >= 202002L
basic(level c, std::ostream * out)
: m_static_channels(c)
, m_dynamic_channels(0)
, m_out(out) {}
#else
basic<concurrency,names>(level c, std::ostream * out)
: m_static_channels(c)
, m_dynamic_channels(0)
, m_out(out) {}
#endif

/// Destructor
#if __cplusplus >= 202002L
~basic() {}
#else
~basic<concurrency,names>() {}
#endif

/// Copy constructor
#if __cplusplus >= 202002L
basic(basic const & other)
: m_static_channels(other.m_static_channels)
, m_dynamic_channels(other.m_dynamic_channels)
, m_out(other.m_out)
{}
#else
basic<concurrency,names>(basic<concurrency,names> const & other)
: m_static_channels(other.m_static_channels)
, m_dynamic_channels(other.m_dynamic_channels)
, m_out(other.m_out)
{}

#endif

#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
// no copy assignment operator because of const member variables
basic<concurrency,names> & operator=(basic<concurrency,names> const &) = delete;
#endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_

#ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
/// Move constructor
#if __cplusplus >= 202002L
basic(basic && other)
: m_static_channels(other.m_static_channels)
, m_dynamic_channels(other.m_dynamic_channels)
, m_out(other.m_out)
{}
#else
basic<concurrency,names>(basic<concurrency,names> && other)
: m_static_channels(other.m_static_channels)
, m_dynamic_channels(other.m_dynamic_channels)
, m_out(other.m_out)
{}
#endif

#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
// no move assignment operator because of const member variables
Expand Down
14 changes: 12 additions & 2 deletions websocketpp/logger/syslog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,34 @@ template <typename concurrency, typename names>
class syslog : public basic<concurrency, names> {
public:
typedef basic<concurrency, names> base;

/// Construct the logger
/**
* @param hint A channel type specific hint for how to construct the logger
*/
#if __cplusplus >= 202002L
syslog(channel_type_hint::value hint =
channel_type_hint::access)
: basic<concurrency,names>(hint), m_channel_type_hint(hint) {}
#else
syslog<concurrency,names>(channel_type_hint::value hint =
channel_type_hint::access)
: basic<concurrency,names>(hint), m_channel_type_hint(hint) {}
#endif

/// Construct the logger
/**
* @param channels A set of channels to statically enable
* @param hint A channel type specific hint for how to construct the logger
*/
#if __cplusplus >= 202002L
syslog(level channels, channel_type_hint::value hint =
channel_type_hint::access)
: basic<concurrency,names>(channels, hint), m_channel_type_hint(hint) {}
#else
syslog<concurrency,names>(level channels, channel_type_hint::value hint =
channel_type_hint::access)
: basic<concurrency,names>(channels, hint), m_channel_type_hint(hint) {}

#endif
/// Write a string message to the given channel
/**
* @param channel The channel to write to
Expand Down
22 changes: 21 additions & 1 deletion websocketpp/roles/server_endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,44 @@ class server : public endpoint<connection<config>,config> {
endpoint_type::m_alog->write(log::alevel::devel, "server constructor");
}

/// Destructor
/// Destructor
#if __cplusplus >= 202002L
~server() {}
#else
~server<config>() {}
#endif

#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
// no copy constructor because endpoints are not copyable
#if __cplusplus >= 202002L
server(server &) = delete;
#else
server<config>(server<config> &) = delete;
#endif

// no copy assignment operator because endpoints are not copyable
#if __cplusplus >= 202002L
server & operator=(server const &) = delete;
#else
server<config> & operator=(server<config> const &) = delete;
#endif
#endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_

#ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
/// Move constructor
#if __cplusplus >= 202002L
server(server && o) : endpoint<connection<config>,config>(std::move(o)) {}
#else
server<config>(server<config> && o) : endpoint<connection<config>,config>(std::move(o)) {}
#endif

#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
// no move assignment operator because of const member variables
#if __cplusplus >= 202002L
server & operator=(server &&) = delete;
#else
server<config> & operator=(server<config> &&) = delete;
#endif
#endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_

#endif // _WEBSOCKETPP_MOVE_SEMANTICS_
Expand Down