Unverified Commit ba13aad9 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #45

Refactor nested to concatenated namespaces
parents 48099efc dd249e2b
......@@ -11,6 +11,17 @@ using std::find_if;
using std::string;
using std::vector;
void split(const string& str, const string& separator, vector<string>& dest) {
size_t current, previous = 0;
current = str.find(separator);
while (current != std::string::npos) {
dest.emplace_back(str.substr(previous, current - previous));
previous = current + separator.size();
current = str.find(separator, previous);
}
dest.push_back(str.substr(previous, current - previous));
}
void trim(string& str) {
auto not_space = [](char c) { return isspace(c) == 0; };
str.erase(str.begin(), find_if(str.begin(), str.end(), not_space));
......@@ -71,7 +82,7 @@ int main(int argc, char** argv) {
line.pop_back();
line.erase(line.begin(), find(line.begin(), line.end(), ' '));
trim(line);
namespaces.emplace_back(line);
split(line, "::", namespaces);
}
}
// Sanity checking.
......
#include <iostream>
using namespace std;
int main() {
# ifdef __clang__
cout << __clang_major__
<< "."
<< __clang_minor__;
# elif defined(__GNUC__)
cout << __GNUC__
<< "."
<< __GNUC_MINOR__;
# else
cout << "0.0";
# endif
return 0;
}
......@@ -26,8 +26,7 @@
#include "caf/stateful_actor.hpp"
#include "caf/unit.hpp"
namespace caf {
namespace bb {
namespace caf::bb {
/// @relates container_source
template <class Container>
......@@ -98,5 +97,4 @@ behavior container_source(container_source_type<Container>* self, Container xs,
/// Convenience function for spawning container sources.
} // namespace bb
} // namespace caf
} // namespace caf::bb
......@@ -27,8 +27,7 @@
#include "caf/string_algorithms.hpp"
#include "caf/unit.hpp"
namespace caf {
namespace bb {
namespace caf::bb {
/// @relates stream_reader
template <class InputStream>
......@@ -99,5 +98,4 @@ void stream_reader(stream_source_type<InputStream>* self,
unit(src.ptr()->add_outbound_path(sinks)...);
}
} // namespace bb
} // namespace caf
} // namespace caf::bb
......@@ -30,8 +30,7 @@
#include "caf/string_algorithms.hpp"
#include "caf/unit.hpp"
namespace caf {
namespace policy {
namespace caf::policy {
/// Parses whitespace-separated integers from input strings to 'ValueType' and
/// pushes generated integers to a downstream.
......@@ -72,5 +71,4 @@ public:
}
};
} // namespace policy
} // namespace caf
} // namespace caf::policy
......@@ -102,8 +102,8 @@ CAF_TEST(stream_to_sinks) {
auto snk1 = sys.spawn(container_sink);
auto snk2 = sys.spawn(container_sink);
auto snk3 = sys.spawn(container_sink);
auto src
= sys.spawn(bb::container_source<container_type, actor, actor, actor>,
auto src = sys
.spawn(bb::container_source<container_type, actor, actor, actor>,
test_container, snk1, snk2, snk3);
auto mon = sys.spawn(container_monitor);
self->send(mon, join_atom::value, src);
......
......@@ -104,8 +104,8 @@ CAF_TEST(stream_to_sink) {
std::vector<value_type> test_container{1, 2, 3, 4, 5, 6, 7, 78,
1254, 1, 20, 4, 56, 78, 95};
auto sink = sys.spawn(stream_reader_sink);
auto src
= sys.spawn(bb::stream_reader<policy::tokenized_integer_reader<value_type>,
auto src = sys.spawn(bb::stream_reader<
policy::tokenized_integer_reader<value_type>,
stream_type, actor>,
std::move(ptr_test_stream), sink);
auto mon = sys.spawn(stream_monitor);
......@@ -125,8 +125,8 @@ CAF_TEST(stream_to_sinks) {
auto snk1 = sys.spawn(stream_reader_sink);
auto snk2 = sys.spawn(stream_reader_sink);
auto snk3 = sys.spawn(stream_reader_sink);
auto src
= sys.spawn(bb::stream_reader<policy::tokenized_integer_reader<value_type>,
auto src = sys.spawn(bb::stream_reader<
policy::tokenized_integer_reader<value_type>,
stream_type, actor, actor, actor>,
std::move(ptr_test_stream), snk1, snk2, snk3);
auto mon = sys.spawn(stream_monitor);
......@@ -146,8 +146,8 @@ CAF_TEST(error_stream_to_sink) {
std::unique_ptr<stream_type> ptr_test_stream{
new stream_type(test_stringvalues)};
auto sink = sys.spawn(stream_reader_sink);
auto src
= sys.spawn(bb::stream_reader<policy::tokenized_integer_reader<value_type>,
auto src = sys.spawn(bb::stream_reader<
policy::tokenized_integer_reader<value_type>,
stream_type, actor>,
std::move(ptr_test_stream), sink);
auto mon = sys.spawn(stream_monitor);
......
......@@ -21,12 +21,10 @@
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/fwd.hpp"
namespace caf {
namespace detail {
namespace caf::detail {
void convert(const ip_endpoint& src, sockaddr_storage& dst);
error convert(const sockaddr_storage& src, ip_endpoint& dst);
} // namespace detail
} // namespace caf
} // namespace caf::detail
......@@ -20,8 +20,7 @@
#include "caf/detail/socket_sys_includes.hpp"
namespace caf {
namespace detail {
namespace caf::detail {
inline auto addr_of(sockaddr_in& what) -> decltype(what.sin_addr)& {
return what.sin_addr;
......@@ -47,5 +46,4 @@ inline auto port_of(sockaddr_in6& what) -> decltype(what.sin6_port)& {
return what.sin6_port;
}
} // namespace detail
} // namespace caf
} // namespace caf::detail
......@@ -20,8 +20,7 @@
#include "caf/config.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -41,5 +40,4 @@ using socket_size_type = unsigned;
#endif // CAF_WINDOWS
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -21,8 +21,7 @@
#include "caf/actor_proxy.hpp"
#include "caf/net/endpoint_manager.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Implements a simple proxy forwarding all operations to a manager.
class actor_proxy_impl : public actor_proxy {
......@@ -42,5 +41,4 @@ private:
endpoint_manager_ptr dst_;
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -26,9 +26,7 @@
#include "caf/net/stream_socket.hpp"
#include "caf/node_id.hpp"
namespace caf {
namespace net {
namespace backend {
namespace caf::net::backend {
/// Minimal backend for unit testing.
/// @warning this backend is *not* thread safe.
......@@ -75,6 +73,4 @@ private:
proxy_registry proxies_;
};
} // namespace backend
} // namespace net
} // namespace caf
} // namespace caf::net::backend
......@@ -50,9 +50,7 @@
#include "caf/span.hpp"
#include "caf/unit.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// An implementation of BASP as an application layer protocol.
class application {
......@@ -211,6 +209,4 @@ private:
std::unique_ptr<hub_type> hub_;
};
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -20,9 +20,7 @@
#include <string>
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// @addtogroup BASP
......@@ -48,6 +46,4 @@ std::string to_string(connection_state x);
/// @}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -21,9 +21,7 @@
#include <cstddef>
#include <cstdint>
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// @addtogroup BASP
......@@ -36,6 +34,4 @@ constexpr size_t header_size = 13;
/// @}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -23,9 +23,7 @@
#include "caf/fwd.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// BASP-specific error codes.
enum class ec : uint8_t {
......@@ -51,6 +49,4 @@ std::string to_string(ec x);
/// @relates ec
error make_error(ec x);
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -28,9 +28,7 @@
#include "caf/net/basp/constants.hpp"
#include "caf/net/basp/message_type.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// @addtogroup BASP
......@@ -91,6 +89,4 @@ typename Inspector::result_type inspect(Inspector& f, header& x) {
/// @}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -26,9 +26,7 @@
#include "caf/fwd.hpp"
#include "caf/mailbox_element.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// Enforces strict order of message delivery, i.e., deliver messages in the
/// same order as if they were deserialized by a single thread.
......@@ -76,6 +74,4 @@ public:
std::vector<actor_msg> pending;
};
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -21,9 +21,7 @@
#include <cstdint>
#include <string>
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// @addtogroup BASP
......@@ -75,6 +73,4 @@ std::string to_string(message_type);
/// @}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -33,9 +33,7 @@
#include "caf/net/basp/header.hpp"
#include "caf/node_id.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
template <class Subtype>
class remote_message_handler {
......@@ -80,6 +78,4 @@ public:
}
};
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -32,9 +32,7 @@
#include "caf/node_id.hpp"
#include "caf/resumable.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
/// Deserializes payloads for BASP messages asynchronously.
class worker : public detail::abstract_worker,
......@@ -113,6 +111,4 @@ private:
buffer_type payload_;
};
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -21,8 +21,7 @@
#include "caf/net/network_socket.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// A datagram-oriented network communication endpoint.
struct datagram_socket : network_socket {
......@@ -41,5 +40,4 @@ error allow_connreset(datagram_socket x, bool new_value);
variant<size_t, sec>
check_datagram_socket_io_res(std::make_signed<size_t>::type res);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -22,10 +22,7 @@
// -- hard-coded default values for various CAF options ------------------------
namespace caf {
namespace defaults {
namespace middleman {
namespace caf::defaults::middleman {
/// Maximum number of cached buffers for sending payloads.
extern const size_t max_payload_buffers;
......@@ -33,7 +30,4 @@ extern const size_t max_payload_buffers;
/// Maximum number of cached buffers for sending headers.
extern const size_t max_header_buffers;
} // namespace middleman
} // namespace defaults
} // namespace caf
} // namespace caf::defaults::middleman
......@@ -34,8 +34,7 @@
#include "caf/net/socket_manager.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Manages a communication endpoint.
class endpoint_manager : public socket_manager {
......@@ -104,5 +103,4 @@ protected:
using endpoint_manager_ptr = intrusive_ptr<endpoint_manager>;
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -25,8 +25,7 @@
#include "caf/detail/overload.hpp"
#include "caf/net/endpoint_manager.hpp"
namespace caf {
namespace net {
namespace caf::net {
template <class Transport>
class endpoint_manager_impl : public endpoint_manager {
......@@ -132,5 +131,4 @@ private:
uint64_t next_timeout_id_;
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -28,8 +28,7 @@
#include "caf/unit.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
class endpoint_manager_queue {
public:
......@@ -201,5 +200,4 @@ public:
using type = intrusive::fifo_inbox<policy>;
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -20,8 +20,7 @@
#include "caf/fwd.hpp"
namespace caf {
namespace net {
namespace caf::net {
struct this_host {
/// Initializes the network subsystem.
......@@ -31,5 +30,4 @@ struct this_host {
static void cleanup();
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -23,9 +23,7 @@
#include "caf/fwd.hpp"
namespace caf {
namespace net {
namespace ip {
namespace caf::net::ip {
/// Returns all IP addresses of `host` (if any).
std::vector<ip_address> resolve(string_view host);
......@@ -43,6 +41,4 @@ std::vector<ip_address> local_addresses(ip_address host);
/// Returns the hostname of this device.
std::string hostname();
} // namespace ip
} // namespace net
} // namespace caf
} // namespace caf::net::ip
......@@ -22,8 +22,7 @@
#include "caf/net/endpoint_manager.hpp"
#include "caf/net/endpoint_manager_impl.hpp"
namespace caf {
namespace net {
namespace caf::net {
template <class Transport>
endpoint_manager_ptr make_endpoint_manager(const multiplexer_ptr& mpx,
......@@ -32,5 +31,4 @@ endpoint_manager_ptr make_endpoint_manager(const multiplexer_ptr& mpx,
return make_counted<impl>(mpx, sys, std::move(trans));
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -25,8 +25,7 @@
#include "caf/fwd.hpp"
#include "caf/net/fwd.hpp"
namespace caf {
namespace net {
namespace caf::net {
class middleman : public actor_system::module {
public:
......@@ -119,5 +118,4 @@ private:
std::thread mpx_thread_;
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -24,8 +24,7 @@
#include "caf/net/fwd.hpp"
#include "caf/proxy_registry.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Technology-specific backend for connecting to and managing peer
/// connections.
......@@ -63,5 +62,4 @@ private:
/// @relates middleman_backend
using middleman_backend_ptr = std::unique_ptr<middleman_backend>;
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -34,8 +34,7 @@ struct pollfd;
} // extern "C"
namespace caf {
namespace net {
namespace caf::net {
/// Multiplexes any number of ::socket_manager objects with a ::socket.
class multiplexer : public std::enable_shared_from_this<multiplexer> {
......@@ -128,5 +127,4 @@ using multiplexer_ptr = std::shared_ptr<multiplexer>;
/// @relates multiplexer
using weak_multiplexer_ptr = std::weak_ptr<multiplexer>;
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -28,8 +28,7 @@
#include "caf/net/socket.hpp"
#include "caf/net/socket_id.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// A bidirectional network communication endpoint.
struct network_socket : socket {
......@@ -83,5 +82,4 @@ void shutdown_write(network_socket x);
/// @relates network_socket
void shutdown(network_socket x);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -20,8 +20,7 @@
#include <string>
namespace caf {
namespace net {
namespace caf::net {
/// Values for representing bitmask of I/O operations.
enum class operation {
......@@ -49,5 +48,4 @@ constexpr operation operator~(operation x) {
std::string to_string(operation x);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -24,8 +24,7 @@
#include "caf/net/fwd.hpp"
#include "caf/span.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Implements an interface for packet writing in application-layers.
class packet_writer {
......@@ -56,5 +55,4 @@ protected:
virtual void write_impl(span<buffer_type*> buffers) = 0;
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -23,8 +23,7 @@
#include "caf/byte.hpp"
#include "caf/span.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Implements the interface for transport and application policies and
/// dispatches member functions either to `object` or `parent`.
......@@ -93,5 +92,4 @@ make_packet_writer_decorator(Object& object, Parent& parent) {
return {object, parent};
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -26,8 +26,7 @@
#include "caf/net/socket.hpp"
#include "caf/net/socket_id.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// A unidirectional communication endpoint for inter-process communication.
struct pipe_socket : socket {
......@@ -63,5 +62,4 @@ variant<size_t, sec> read(pipe_socket x, span<byte>);
variant<size_t, sec>
check_pipe_socket_io_res(std::make_signed<size_t>::type res);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -26,8 +26,7 @@
#include "caf/net/pipe_socket.hpp"
#include "caf/net/socket_manager.hpp"
namespace caf {
namespace net {
namespace caf::net {
class pollset_updater : public socket_manager {
public:
......@@ -63,5 +62,4 @@ private:
size_t buf_size_;
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -24,8 +24,7 @@
#include "caf/config.hpp"
namespace caf {
namespace net {
namespace caf::net {
enum class receive_policy_flag : unsigned { at_least, at_most, exactly };
......@@ -57,5 +56,4 @@ public:
}
};
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -27,8 +27,7 @@
#include "caf/fwd.hpp"
#include "caf/net/socket_id.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// An internal endpoint for sending or receiving data. Can be either a
/// ::network_socket, ::pipe_socket, ::stream_socket, or ::datagram_socket.
......@@ -89,5 +88,4 @@ error child_process_inherit(socket x, bool new_value);
/// @relates socket
error nonblocking(socket x, bool new_value);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -20,8 +20,7 @@
#include "caf/net/socket_id.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Closes the guarded socket when destroyed.
template <class Socket>
......@@ -78,5 +77,4 @@ socket_guard<Socket> make_socket_guard(Socket sock) {
return socket_guard<Socket>{sock};
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -24,8 +24,7 @@
#include "caf/config.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -51,5 +50,4 @@ constexpr socket_id invalid_socket_id = -1;
/// @relates socket
using signed_socket_id = std::make_signed<socket_id>::type;
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -25,8 +25,7 @@
#include "caf/net/socket.hpp"
#include "caf/ref_counted.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Manages the lifetime of a single socket and handles any I/O events on it.
class socket_manager : public ref_counted {
......@@ -95,5 +94,4 @@ protected:
using socket_manager_ptr = intrusive_ptr<socket_manager>;
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -21,8 +21,7 @@
#include "caf/fwd.hpp"
#include "caf/net/network_socket.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// A connection-oriented network communication endpoint for bidirectional byte
/// streams.
......@@ -78,5 +77,4 @@ variant<size_t, sec> write(stream_socket x,
variant<size_t, sec>
check_stream_socket_io_res(std::make_signed<size_t>::type res);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -23,8 +23,7 @@
#include "caf/net/network_socket.hpp"
#include "caf/uri.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Represents a TCP acceptor in listening mode.
struct tcp_accept_socket : network_socket {
......@@ -58,5 +57,4 @@ make_tcp_accept_socket(const uri::authority_type& node,
/// @relates tcp_accept_socket
expected<tcp_stream_socket> accept(tcp_accept_socket x);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -23,8 +23,7 @@
#include "caf/net/stream_socket.hpp"
#include "caf/uri.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// Represents a TCP connection.
struct tcp_stream_socket : stream_socket {
......@@ -46,5 +45,4 @@ expected<tcp_stream_socket> make_connected_tcp_stream_socket(ip_endpoint node);
expected<tcp_stream_socket>
make_connected_tcp_stream_socket(const uri::authority_type& node);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -21,8 +21,7 @@
#include "caf/fwd.hpp"
#include "caf/net/network_socket.hpp"
namespace caf {
namespace net {
namespace caf::net {
/// A datagram-oriented network communication endpoint for bidirectional
/// byte transmission.
......@@ -83,5 +82,4 @@ variant<size_t, sec> write(udp_datagram_socket x, span<const byte> buf,
variant<size_t, sec>
check_udp_datagram_socket_io_res(std::make_signed<size_t>::type res);
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -22,8 +22,7 @@
#include "caf/expected.hpp"
#include "caf/logger.hpp"
namespace caf {
namespace net {
namespace caf::net {
actor_proxy_impl::actor_proxy_impl(actor_config& cfg, endpoint_manager_ptr dst)
: super(cfg), sf_(dst->serialize_fun()), dst_(std::move(dst)) {
......@@ -50,5 +49,4 @@ void actor_proxy_impl::kill_proxy(execution_unit* ctx, error rsn) {
cleanup(std::move(rsn), ctx);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -41,9 +41,7 @@
#include "caf/string_algorithms.hpp"
#include "caf/type_erased_tuple.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
application::application(proxy_registry& proxies)
: proxies_(proxies), queue_{new message_queue}, hub_{new hub_type} {
......@@ -397,6 +395,4 @@ error application::generate_handshake(std::vector<byte>& buf) {
defaults::middleman::app_identifiers));
}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -23,8 +23,7 @@
#include "caf/ipv6_endpoint.hpp"
#include "caf/sec.hpp"
namespace caf {
namespace detail {
namespace caf::detail {
void convert(const ip_endpoint& src, sockaddr_storage& dst) {
memset(&dst, 0, sizeof(sockaddr_storage));
......@@ -60,5 +59,4 @@ error convert(const sockaddr_storage& src, ip_endpoint& dst) {
return none;
}
} // namespace detail
} // namespace caf
} // namespace caf::detail
......@@ -22,8 +22,7 @@
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/logger.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -60,5 +59,4 @@ check_datagram_socket_io_res(std::make_signed<size_t>::type res) {
return static_cast<size_t>(res);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -18,16 +18,10 @@
#include "caf/net/defaults.hpp"
namespace caf {
namespace defaults {
namespace middleman {
namespace caf::defaults::middleman {
const size_t max_payload_buffers = 100;
const size_t max_header_buffers = 10;
} // namespace middleman
} // namespace defaults
} // namespace caf
} // namespace caf::defaults::middleman
......@@ -22,14 +22,10 @@
#include "caf/error.hpp"
#include "caf/string_view.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
error make_error(ec x) {
return {static_cast<uint8_t>(x), atom("basp")};
}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -24,8 +24,7 @@
#include "caf/sec.hpp"
#include "caf/send.hpp"
namespace caf {
namespace net {
namespace caf::net {
endpoint_manager::endpoint_manager(socket handle, const multiplexer_ptr& parent,
actor_system& sys)
......@@ -87,5 +86,4 @@ bool endpoint_manager::enqueue(endpoint_manager_queue::element* ptr) {
}
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -24,9 +24,7 @@
#include "caf/detail/network_order.hpp"
#include "caf/span.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
namespace {
......@@ -69,6 +67,4 @@ void to_bytes(header x, std::vector<byte>& buf) {
to_bytes_impl(x, buf.data());
}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -25,8 +25,7 @@
#include "caf/net/socket.hpp"
#include "caf/none.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -53,5 +52,4 @@ void this_host::cleanup() {
#endif // CAF_WINDOWS
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -54,9 +54,7 @@ using std::pair;
using std::string;
using std::vector;
namespace caf {
namespace net {
namespace ip {
namespace caf::net::ip {
namespace {
......@@ -251,6 +249,4 @@ std::string hostname() {
return buf;
}
} // namespace ip
} // namespace net
} // namespace caf
} // namespace caf::net::ip
......@@ -20,9 +20,7 @@
#include <iterator>
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
message_queue::message_queue() : next_id(0), next_undelivered(0) {
// nop
......@@ -72,6 +70,4 @@ uint64_t message_queue::new_id() {
return next_id++;
}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
......@@ -38,8 +38,7 @@
# include "caf/detail/socket_sys_includes.hpp"
#endif // CAF_WINDOWS
namespace caf {
namespace net {
namespace caf::net {
#ifndef POLLRDHUP
# define POLLRDHUP POLLHUP
......@@ -283,5 +282,4 @@ void multiplexer::write_to_pipe(uint8_t opcode, const socket_manager_ptr& mgr) {
mgr->deref();
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -29,9 +29,7 @@
#include "caf/raise_error.hpp"
#include "caf/send.hpp"
namespace caf {
namespace net {
namespace backend {
namespace caf::net::backend {
test::test(middleman& mm)
: middleman_backend("test"), mm_(mm), proxies_(mm.system(), *this) {
......@@ -101,6 +99,4 @@ test::peer_entry& test::get_peer(const node_id& id) {
return emplace(id, sockets->first, sockets->second);
}
} // namespace backend
} // namespace net
} // namespace caf
} // namespace caf::net::backend
......@@ -18,8 +18,7 @@
#include "caf/net/endpoint_manager_queue.hpp"
namespace caf {
namespace net {
namespace caf::net {
endpoint_manager_queue::element::~element() {
// nop
......@@ -74,5 +73,4 @@ endpoint_manager_queue::message::~message() {
// nop
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -27,8 +27,7 @@
#include "caf/send.hpp"
#include "caf/uri.hpp"
namespace caf {
namespace net {
namespace caf::net {
middleman::middleman(actor_system& sys) : sys_(sys) {
mpx_ = std::make_shared<multiplexer>();
......@@ -103,5 +102,4 @@ middleman_backend* middleman::backend(string_view scheme) const noexcept {
return nullptr;
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -18,8 +18,7 @@
#include "caf/net/middleman_backend.hpp"
namespace caf {
namespace net {
namespace caf::net {
middleman_backend::middleman_backend(std::string id) : id_(std::move(id)) {
// nop
......@@ -29,5 +28,4 @@ middleman_backend::~middleman_backend() {
// nop
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -18,12 +18,10 @@
#include "caf/net/packet_writer.hpp"
namespace caf {
namespace net {
namespace caf::net {
packet_writer::~packet_writer() {
// nop
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -55,8 +55,7 @@ uint16_t port_of(sockaddr& what) {
} // namespace
namespace caf {
namespace net {
namespace caf::net {
#if defined(CAF_MACOS) || defined(CAF_IOS) || defined(CAF_BSD)
# define CAF_HAS_NOSIGPIPE_SOCKET_FLAG
......@@ -81,7 +80,6 @@ error allow_udp_connreset(network_socket x, bool new_value) {
}
#else // CAF_WINDOWS
error allow_sigpipe(network_socket x, bool new_value) {
# ifdef CAF_HAS_NOSIGPIPE_SOCKET_FLAG
int value = new_value ? 0 : 1;
......@@ -193,5 +191,4 @@ void shutdown(network_socket x) {
::shutdown(x.id, 2);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -34,8 +34,7 @@
#include "caf/span.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -102,5 +101,4 @@ check_pipe_socket_io_res(std::make_signed<size_t>::type res) {
return check_stream_socket_io_res(res);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -23,8 +23,7 @@
#include "caf/span.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
pollset_updater::pollset_updater(pipe_socket read_handle,
const multiplexer_ptr& parent)
......@@ -72,5 +71,4 @@ void pollset_updater::handle_error(sec) {
// nop
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -27,8 +27,7 @@
#include "caf/sec.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -180,5 +179,4 @@ error nonblocking(socket x, bool new_value) {
#endif // CAF_WINDOWS
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -21,8 +21,7 @@
#include "caf/config.hpp"
#include "caf/net/multiplexer.hpp"
namespace caf {
namespace net {
namespace caf::net {
socket_manager::socket_manager(socket handle, const multiplexer_ptr& parent)
: handle_(handle), mask_(operation::none), parent_(parent) {
......@@ -68,5 +67,4 @@ void socket_manager::register_writing() {
ptr->register_writing(this);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -31,8 +31,7 @@
# include <sys/uio.h>
#endif
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -234,5 +233,4 @@ check_stream_socket_io_res(std::make_signed<size_t>::type res) {
return static_cast<size_t>(res);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -31,8 +31,7 @@
#include "caf/net/tcp_stream_socket.hpp"
#include "caf/sec.hpp"
namespace caf {
namespace net {
namespace caf::net {
namespace {
......@@ -145,5 +144,4 @@ expected<tcp_stream_socket> accept(tcp_accept_socket x) {
return tcp_stream_socket{sock};
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -29,8 +29,7 @@
#include "caf/sec.hpp"
#include "caf/variant.hpp"
namespace caf {
namespace net {
namespace caf::net {
namespace {
......@@ -96,5 +95,4 @@ make_connected_tcp_stream_socket(const uri::authority_type& node) {
return make_error(sec::cannot_connect_to_node, to_string(node));
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -29,8 +29,7 @@
#include "caf/net/socket_guard.hpp"
#include "caf/span.hpp"
namespace caf {
namespace net {
namespace caf::net {
#ifdef CAF_WINDOWS
......@@ -191,5 +190,4 @@ check_udp_datagram_socket_io_res(std::make_signed<size_t>::type res) {
return static_cast<size_t>(res);
}
} // namespace net
} // namespace caf
} // namespace caf::net
......@@ -24,9 +24,7 @@
#include "caf/proxy_registry.hpp"
#include "caf/scheduler/abstract_coordinator.hpp"
namespace caf {
namespace net {
namespace basp {
namespace caf::net::basp {
// -- constructors, destructors, and assignment operators ----------------------
......@@ -60,6 +58,4 @@ resumable::resume_result worker::resume(execution_unit* ctx, size_t) {
return resumable::awaiting_message;
}
} // namespace basp
} // namespace net
} // namespace caf
} // namespace caf::net::basp
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment