diff --git a/src/client.hpp b/src/client.hpp index 31239e31..55922c9b 100644 --- a/src/client.hpp +++ b/src/client.hpp @@ -31,7 +31,6 @@ #define __ZMQ_CLIENT_HPP_INCLUDED__ #include "socket_base.hpp" -#include "session_base.hpp" #include "fq.hpp" #include "lb.hpp" @@ -41,7 +40,6 @@ class ctx_t; class msg_t; class pipe_t; class io_thread_t; -class socket_base_t; class client_t : public socket_base_t { diff --git a/src/clock.cpp b/src/clock.cpp index dadf9e57..bd245438 100644 --- a/src/clock.cpp +++ b/src/clock.cpp @@ -57,11 +57,6 @@ #endif #if defined ZMQ_HAVE_OSX -#include -#include -#include -#include - int alt_clock_gettime (int clock_id, timespec *ts) { clock_serv_t cclock; diff --git a/src/clock.hpp b/src/clock.hpp index 3cef6538..b3f2eb55 100644 --- a/src/clock.hpp +++ b/src/clock.hpp @@ -33,17 +33,19 @@ #include "stdint.hpp" #if defined ZMQ_HAVE_OSX -#include -#include -#include -#include -int alt_clock_gettime (int clock_id, timespec *ts); +// TODO this is not required in this file, but condition_variable.hpp includes +// clock.hpp to get these definitions #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 #endif #ifndef HAVE_CLOCK_GETTIME #define HAVE_CLOCK_GETTIME #endif + +#include +#include +#include +#include #endif namespace zmq diff --git a/src/condition_variable.hpp b/src/condition_variable.hpp index 8108777b..d65378fb 100644 --- a/src/condition_variable.hpp +++ b/src/condition_variable.hpp @@ -30,7 +30,6 @@ #ifndef __ZMQ_CONDITON_VARIABLE_HPP_INCLUDED__ #define __ZMQ_CONDITON_VARIABLE_HPP_INCLUDED__ -#include "clock.hpp" #include "err.hpp" #include "mutex.hpp" diff --git a/src/decoder.hpp b/src/decoder.hpp index 8cf663cd..46be55f7 100644 --- a/src/decoder.hpp +++ b/src/decoder.hpp @@ -37,7 +37,6 @@ #include "decoder_allocators.hpp" #include "err.hpp" #include "i_decoder.hpp" -#include "msg.hpp" #include "stdint.hpp" namespace zmq diff --git a/src/dish.hpp b/src/dish.hpp index fc6444cf..3af46c43 100644 --- a/src/dish.hpp +++ b/src/dish.hpp @@ -31,13 +31,12 @@ #define __ZMQ_DISH_HPP_INCLUDED__ #include -#include #include "socket_base.hpp" #include "session_base.hpp" #include "dist.hpp" #include "fq.hpp" -#include "trie.hpp" +#include "msg.hpp" namespace zmq { diff --git a/src/dist.hpp b/src/dist.hpp index 4f171ecc..f7d0245c 100644 --- a/src/dist.hpp +++ b/src/dist.hpp @@ -33,7 +33,6 @@ #include #include "array.hpp" -#include "pipe.hpp" namespace zmq { diff --git a/src/encoder.hpp b/src/encoder.hpp index b7703806..64320166 100644 --- a/src/encoder.hpp +++ b/src/encoder.hpp @@ -42,8 +42,8 @@ #include #include "err.hpp" -#include "msg.hpp" #include "i_encoder.hpp" +#include "msg.hpp" namespace zmq { diff --git a/src/fq.hpp b/src/fq.hpp index 6dd2f2ea..0386a862 100644 --- a/src/fq.hpp +++ b/src/fq.hpp @@ -32,11 +32,12 @@ #include "array.hpp" #include "blob.hpp" -#include "pipe.hpp" -#include "msg.hpp" namespace zmq { +class msg_t; +class pipe_t; + // Class manages a set of inbound pipes. On receive it performs fair // queueing so that senders gone berserk won't cause denial of // service for decent senders. diff --git a/src/gather.hpp b/src/gather.hpp index 0efed02c..9d05869a 100644 --- a/src/gather.hpp +++ b/src/gather.hpp @@ -31,7 +31,6 @@ #define __ZMQ_GATHER_HPP_INCLUDED__ #include "socket_base.hpp" -#include "session_base.hpp" #include "fq.hpp" namespace zmq @@ -39,7 +38,6 @@ namespace zmq class ctx_t; class pipe_t; class msg_t; -class io_thread_t; class gather_t : public socket_base_t { diff --git a/src/io_thread.hpp b/src/io_thread.hpp index 08fd67c5..5fcc4896 100644 --- a/src/io_thread.hpp +++ b/src/io_thread.hpp @@ -30,8 +30,6 @@ #ifndef __ZMQ_IO_THREAD_HPP_INCLUDED__ #define __ZMQ_IO_THREAD_HPP_INCLUDED__ -#include - #include "stdint.hpp" #include "object.hpp" #include "poller.hpp" diff --git a/src/lb.hpp b/src/lb.hpp index ba5e0bc7..c18399b5 100644 --- a/src/lb.hpp +++ b/src/lb.hpp @@ -31,10 +31,12 @@ #define __ZMQ_LB_HPP_INCLUDED__ #include "array.hpp" -#include "pipe.hpp" namespace zmq { +class msg_t; +class pipe_t; + // This class manages a set of outbound pipes. On send it load balances // messages fairly among the pipes. diff --git a/src/mechanism_base.hpp b/src/mechanism_base.hpp index a0eafdab..dfcd4fb9 100644 --- a/src/mechanism_base.hpp +++ b/src/mechanism_base.hpp @@ -34,6 +34,8 @@ namespace zmq { +class msg_t; + class mechanism_base_t : public mechanism_t { protected: diff --git a/src/norm_engine.hpp b/src/norm_engine.hpp index c3ce9296..5b241038 100644 --- a/src/norm_engine.hpp +++ b/src/norm_engine.hpp @@ -15,6 +15,7 @@ namespace zmq { class io_thread_t; +class msg_t; class session_base_t; class norm_engine_t : public io_object_t, public i_engine diff --git a/src/null_mechanism.cpp b/src/null_mechanism.cpp index 70fa958b..59367061 100644 --- a/src/null_mechanism.cpp +++ b/src/null_mechanism.cpp @@ -36,7 +36,6 @@ #include "err.hpp" #include "msg.hpp" #include "session_base.hpp" -#include "wire.hpp" #include "null_mechanism.hpp" zmq::null_mechanism_t::null_mechanism_t (session_base_t *session_, diff --git a/src/options.cpp b/src/options.cpp index 5628fb60..036b382d 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -29,6 +29,7 @@ #include "precompiled.hpp" #include +#include #include "options.hpp" #include "err.hpp" diff --git a/src/options.hpp b/src/options.hpp index e4a96ca2..dd0a6823 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -32,7 +32,6 @@ #include #include -#include #include #include "atomic_ptr.hpp" @@ -41,6 +40,7 @@ #include "tcp_address.hpp" #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED +#include #include #endif #ifdef ZMQ_HAVE_LOCAL_PEERCRED diff --git a/src/own.hpp b/src/own.hpp index 8c2732fc..82bcf297 100644 --- a/src/own.hpp +++ b/src/own.hpp @@ -31,7 +31,6 @@ #define __ZMQ_OWN_HPP_INCLUDED__ #include -#include #include "object.hpp" #include "options.hpp" diff --git a/src/pipe.hpp b/src/pipe.hpp index 63f1b7db..9c9d9192 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -30,7 +30,6 @@ #ifndef __ZMQ_PIPE_HPP_INCLUDED__ #define __ZMQ_PIPE_HPP_INCLUDED__ -#include "msg.hpp" #include "ypipe_base.hpp" #include "config.hpp" #include "object.hpp" @@ -40,7 +39,7 @@ namespace zmq { -class object_t; +class msg_t; class pipe_t; // Create a pipepair for bi-directional transfer of messages. diff --git a/src/plain_server.hpp b/src/plain_server.hpp index c9352ab6..ba335e4d 100644 --- a/src/plain_server.hpp +++ b/src/plain_server.hpp @@ -30,7 +30,6 @@ #ifndef __ZMQ_PLAIN_SERVER_HPP_INCLUDED__ #define __ZMQ_PLAIN_SERVER_HPP_INCLUDED__ -#include "mechanism.hpp" #include "options.hpp" #include "zap_client.hpp" diff --git a/src/proxy.cpp b/src/proxy.cpp index 3e30e4d1..abf2615a 100644 --- a/src/proxy.cpp +++ b/src/proxy.cpp @@ -33,6 +33,7 @@ #include "poller.hpp" #include "proxy.hpp" #include "likely.hpp" +#include "msg.hpp" #if defined ZMQ_POLL_BASED_ON_POLL && !defined ZMQ_HAVE_WINDOWS \ && !defined ZMQ_HAVE_AIX diff --git a/src/radio.hpp b/src/radio.hpp index da8a4de8..c311e128 100644 --- a/src/radio.hpp +++ b/src/radio.hpp @@ -36,14 +36,12 @@ #include "socket_base.hpp" #include "session_base.hpp" -#include "mtrie.hpp" -#include "array.hpp" #include "dist.hpp" +#include "msg.hpp" namespace zmq { class ctx_t; -class msg_t; class pipe_t; class io_thread_t; diff --git a/src/raw_decoder.hpp b/src/raw_decoder.hpp index 81759b22..4cd0b1b3 100644 --- a/src/raw_decoder.hpp +++ b/src/raw_decoder.hpp @@ -30,7 +30,6 @@ #ifndef __ZMQ_RAW_DECODER_HPP_INCLUDED__ #define __ZMQ_RAW_DECODER_HPP_INCLUDED__ -#include "err.hpp" #include "msg.hpp" #include "i_decoder.hpp" #include "stdint.hpp" diff --git a/src/raw_encoder.cpp b/src/raw_encoder.cpp index 2c0c58c0..fa510963 100644 --- a/src/raw_encoder.cpp +++ b/src/raw_encoder.cpp @@ -30,8 +30,7 @@ #include "precompiled.hpp" #include "encoder.hpp" #include "raw_encoder.hpp" -#include "likely.hpp" -#include "wire.hpp" +#include "msg.hpp" zmq::raw_encoder_t::raw_encoder_t (size_t bufsize_) : encoder_base_t (bufsize_) diff --git a/src/raw_encoder.hpp b/src/raw_encoder.hpp index 8606ea61..5467a540 100644 --- a/src/raw_encoder.hpp +++ b/src/raw_encoder.hpp @@ -33,11 +33,8 @@ #include #include #include -#include -#include "err.hpp" -#include "msg.hpp" -#include "i_encoder.hpp" +#include "encoder.hpp" namespace zmq { diff --git a/src/select.hpp b/src/select.hpp index 6553df66..0c30e82c 100644 --- a/src/select.hpp +++ b/src/select.hpp @@ -48,7 +48,6 @@ #include "ctx.hpp" #include "fd.hpp" -#include "thread.hpp" #include "poller_base.hpp" namespace zmq diff --git a/src/server.hpp b/src/server.hpp index c4125de9..c0796a68 100644 --- a/src/server.hpp +++ b/src/server.hpp @@ -36,12 +36,12 @@ #include "session_base.hpp" #include "stdint.hpp" #include "blob.hpp" -#include "msg.hpp" #include "fq.hpp" namespace zmq { class ctx_t; +class msg_t; class pipe_t; // TODO: This class uses O(n) scheduling. Rewrite it to use O(1) algorithm. diff --git a/src/session_base.hpp b/src/session_base.hpp index ae9f3a71..586fa261 100644 --- a/src/session_base.hpp +++ b/src/session_base.hpp @@ -30,7 +30,6 @@ #ifndef __ZMQ_SESSION_BASE_HPP_INCLUDED__ #define __ZMQ_SESSION_BASE_HPP_INCLUDED__ -#include #include #include "own.hpp" @@ -41,9 +40,7 @@ namespace zmq { -class pipe_t; class io_thread_t; -class socket_base_t; struct i_engine; struct address_t; diff --git a/src/socket_base.hpp b/src/socket_base.hpp index 5655819c..296b49f6 100644 --- a/src/socket_base.hpp +++ b/src/socket_base.hpp @@ -39,10 +39,8 @@ #include "blob.hpp" #include "stdint.hpp" #include "poller.hpp" -#include "atomic_counter.hpp" #include "i_poll_events.hpp" #include "i_mailbox.hpp" -#include "stdint.hpp" #include "clock.hpp" #include "pipe.hpp" diff --git a/src/socket_poller.hpp b/src/socket_poller.hpp index eb79a7ea..4e508e5c 100644 --- a/src/socket_poller.hpp +++ b/src/socket_poller.hpp @@ -47,7 +47,6 @@ #endif #include -#include #include "socket_base.hpp" #include "signaler.hpp" diff --git a/src/stream_engine.hpp b/src/stream_engine.hpp index 2544f6c1..1ab9c039 100644 --- a/src/stream_engine.hpp +++ b/src/stream_engine.hpp @@ -40,6 +40,7 @@ #include "options.hpp" #include "socket_base.hpp" #include "metadata.hpp" +#include "msg.hpp" namespace zmq { @@ -51,7 +52,6 @@ enum }; class io_thread_t; -class msg_t; class session_base_t; class mechanism_t; diff --git a/src/udp_address.hpp b/src/udp_address.hpp index 1d240f1d..6c412e16 100644 --- a/src/udp_address.hpp +++ b/src/udp_address.hpp @@ -35,6 +35,8 @@ #include #endif +#include + #include "ip_resolver.hpp" namespace zmq diff --git a/src/udp_engine.cpp b/src/udp_engine.cpp index 53e9a653..75cd4b4d 100644 --- a/src/udp_engine.cpp +++ b/src/udp_engine.cpp @@ -40,9 +40,9 @@ along with this program. If not, see . #endif #endif +#include "udp_address.hpp" #include "udp_engine.hpp" #include "session_base.hpp" -#include "v2_protocol.hpp" #include "err.hpp" #include "ip.hpp" diff --git a/src/udp_engine.hpp b/src/udp_engine.hpp index 1a02c524..02e39886 100644 --- a/src/udp_engine.hpp +++ b/src/udp_engine.hpp @@ -5,7 +5,6 @@ #include "io_object.hpp" #include "i_engine.hpp" #include "address.hpp" -#include "udp_address.hpp" #include "msg.hpp" #define MAX_UDP_MSG 8192 diff --git a/src/v1_encoder.cpp b/src/v1_encoder.cpp index e9ce9696..672071fa 100644 --- a/src/v1_encoder.cpp +++ b/src/v1_encoder.cpp @@ -30,7 +30,7 @@ #include "precompiled.hpp" #include "encoder.hpp" #include "v1_encoder.hpp" -#include "likely.hpp" +#include "msg.hpp" #include "wire.hpp" zmq::v1_encoder_t::v1_encoder_t (size_t bufsize_) : diff --git a/src/v2_encoder.cpp b/src/v2_encoder.cpp index 63362301..8efc4c5b 100644 --- a/src/v2_encoder.cpp +++ b/src/v2_encoder.cpp @@ -30,6 +30,7 @@ #include "precompiled.hpp" #include "v2_protocol.hpp" #include "v2_encoder.hpp" +#include "msg.hpp" #include "likely.hpp" #include "wire.hpp" diff --git a/src/xpub.hpp b/src/xpub.hpp index c3f0d6cc..c552732e 100644 --- a/src/xpub.hpp +++ b/src/xpub.hpp @@ -31,12 +31,10 @@ #define __ZMQ_XPUB_HPP_INCLUDED__ #include -#include #include "socket_base.hpp" #include "session_base.hpp" #include "mtrie.hpp" -#include "array.hpp" #include "dist.hpp" namespace zmq