summaryrefslogtreecommitdiff
path: root/src/sub.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sub.hpp')
-rw-r--r--src/sub.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sub.hpp b/src/sub.hpp
index 4c3bf7f..c50c0bd 100644
--- a/src/sub.hpp
+++ b/src/sub.hpp
@@ -27,6 +27,7 @@
#include "../include/xs.h"
#include "xsub.hpp"
+#include "core.hpp"
namespace xs
{
@@ -36,21 +37,26 @@ namespace xs
class io_thread_t;
class socket_base_t;
- class sub_t : public xsub_t
+ class sub_t : public xsub_t, public core_t
{
public:
sub_t (xs::ctx_t *parent_, uint32_t tid_, int sid_);
~sub_t ();
- protected:
+ private:
+ // Overloaded functions from socket_base_t.
int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
int xsend (xs::msg_t *msg_, int flags_);
int xrecv (xs::msg_t *msg_, int flags_);
bool xhas_in ();
bool xhas_out ();
+ // Overloaded functions from core_t.
+ int filter_subscribed (const unsigned char *data_, size_t size_);
+ int filter_unsubscribed (const unsigned char *data_, size_t size_);
+
// The repository of subscriptions.
struct filter_t
{
@@ -69,8 +75,6 @@ namespace xs
bool has_message;
msg_t message;
- private:
-
// Check whether the message matches at least one subscription.
bool match (xs::msg_t *msg_);