diff --git a/src/dbuffer.hpp b/src/dbuffer.hpp index 573177b1..9a24dbf1 100644 --- a/src/dbuffer.hpp +++ b/src/dbuffer.hpp @@ -111,7 +111,7 @@ namespace zmq return has_msg; } - inline bool probe (bool (*fn)(msg_t &)) + inline bool probe (bool (*fn)(const msg_t &)) { scoped_lock_t lock (sync); return (*fn) (*front); diff --git a/src/msg.cpp b/src/msg.cpp index dfc3239f..906443cf 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -267,7 +267,7 @@ bool zmq::msg_t::is_identity () const return (u.base.flags & identity) == identity; } -bool zmq::msg_t::is_delimiter () +bool zmq::msg_t::is_delimiter () const { return u.base.type == type_delimiter; } diff --git a/src/msg.hpp b/src/msg.hpp index 4516588e..7a47fff9 100644 --- a/src/msg.hpp +++ b/src/msg.hpp @@ -70,7 +70,7 @@ namespace zmq int64_t fd (); void set_fd (int64_t fd_); bool is_identity () const; - bool is_delimiter (); + bool is_delimiter () const; bool is_vsm (); bool is_cmsg (); diff --git a/src/pipe.cpp b/src/pipe.cpp index 38127b79..4c485a0b 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -406,7 +406,7 @@ void zmq::pipe_t::terminate (bool delay_) } } -bool zmq::pipe_t::is_delimiter (msg_t &msg_) +bool zmq::pipe_t::is_delimiter (const msg_t &msg_) { return msg_.is_delimiter (); } diff --git a/src/pipe.hpp b/src/pipe.hpp index a031bbc3..c9a2cade 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -199,7 +199,7 @@ namespace zmq blob_t identity; // Returns true if the message is delimiter; false otherwise. - static bool is_delimiter (msg_t &msg_); + static bool is_delimiter (const msg_t &msg_); // Computes appropriate low watermark from the given high watermark. static int compute_lwm (int hwm_); diff --git a/src/ypipe.hpp b/src/ypipe.hpp index e142e69a..c580ce24 100644 --- a/src/ypipe.hpp +++ b/src/ypipe.hpp @@ -166,7 +166,7 @@ namespace zmq // Applies the function fn to the first elemenent in the pipe // and returns the value returned by the fn. // The pipe mustn't be empty or the function crashes. - inline bool probe (bool (*fn)(T &)) + inline bool probe (bool (*fn)(const T &)) { bool rc = check_read (); zmq_assert (rc); diff --git a/src/ypipe_base.hpp b/src/ypipe_base.hpp index a711778e..a3d67656 100644 --- a/src/ypipe_base.hpp +++ b/src/ypipe_base.hpp @@ -37,7 +37,7 @@ namespace zmq virtual bool flush () = 0; virtual bool check_read () = 0; virtual bool read (T *value_) = 0; - virtual bool probe (bool (*fn)(T &)) = 0; + virtual bool probe (bool (*fn)(const T &)) = 0; }; } diff --git a/src/ypipe_conflate.hpp b/src/ypipe_conflate.hpp index 99a267dc..31d0f3d5 100644 --- a/src/ypipe_conflate.hpp +++ b/src/ypipe_conflate.hpp @@ -107,7 +107,7 @@ namespace zmq // Applies the function fn to the first elemenent in the pipe // and returns the value returned by the fn. // The pipe mustn't be empty or the function crashes. - inline bool probe (bool (*fn)(T &)) + inline bool probe (bool (*fn)(const T &)) { return dbuffer.probe (fn); }