From 4a7aad06d95701cf232198093ce396dcdbb53e5b Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:01:47 +0900 Subject: ZeroMQ renamed to Crossroads Signed-off-by: Martin Sustrik --- src/object.cpp | 166 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'src/object.cpp') diff --git a/src/object.cpp b/src/object.cpp index e4e94d9..2d1f5aa 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1,16 +1,16 @@ /* - Copyright (c) 2009-2011 250bpm s.r.o. + Copyright (c) 2009-2012 250bpm s.r.o. Copyright (c) 2007-2009 iMatix Corporation Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file - This file is part of 0MQ. + This file is part of Crossroads project. - 0MQ is free software; you can redistribute it and/or modify it under + Crossroads is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - 0MQ is distributed in the hope that it will be useful, + Crossroads is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -30,33 +30,33 @@ #include "session_base.hpp" #include "socket_base.hpp" -zmq::object_t::object_t (ctx_t *ctx_, uint32_t tid_) : +xs::object_t::object_t (ctx_t *ctx_, uint32_t tid_) : ctx (ctx_), tid (tid_) { } -zmq::object_t::object_t (object_t *parent_) : +xs::object_t::object_t (object_t *parent_) : ctx (parent_->ctx), tid (parent_->tid) { } -zmq::object_t::~object_t () +xs::object_t::~object_t () { } -uint32_t zmq::object_t::get_tid () +uint32_t xs::object_t::get_tid () { return tid; } -zmq::ctx_t *zmq::object_t::get_ctx () +xs::ctx_t *xs::object_t::get_ctx () { return ctx; } -void zmq::object_t::process_command (command_t &cmd_) +void xs::object_t::process_command (command_t &cmd_) { switch (cmd_.type) { @@ -125,51 +125,51 @@ void zmq::object_t::process_command (command_t &cmd_) break; default: - zmq_assert (false); + xs_assert (false); } } -int zmq::object_t::register_endpoint (const char *addr_, endpoint_t &endpoint_) +int xs::object_t::register_endpoint (const char *addr_, endpoint_t &endpoint_) { return ctx->register_endpoint (addr_, endpoint_); } -void zmq::object_t::unregister_endpoints (socket_base_t *socket_) +void xs::object_t::unregister_endpoints (socket_base_t *socket_) { return ctx->unregister_endpoints (socket_); } -zmq::endpoint_t zmq::object_t::find_endpoint (const char *addr_) +xs::endpoint_t xs::object_t::find_endpoint (const char *addr_) { return ctx->find_endpoint (addr_); } -void zmq::object_t::destroy_socket (socket_base_t *socket_) +void xs::object_t::destroy_socket (socket_base_t *socket_) { ctx->destroy_socket (socket_); } -zmq::io_thread_t *zmq::object_t::choose_io_thread (uint64_t affinity_) +xs::io_thread_t *xs::object_t::choose_io_thread (uint64_t affinity_) { return ctx->choose_io_thread (affinity_); } -void zmq::object_t::log (int sid_, const char *text_) +void xs::object_t::log (int sid_, const char *text_) { ctx->log (sid_, text_); } -void zmq::object_t::publish_logs (const char *text_) +void xs::object_t::publish_logs (const char *text_) { ctx->publish_logs (text_); } -void zmq::object_t::send_stop () +void xs::object_t::send_stop () { // 'stop' command goes always from administrative thread to // the current object. command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = this; @@ -177,13 +177,13 @@ void zmq::object_t::send_stop () ctx->send_command (tid, cmd); } -void zmq::object_t::send_plug (own_t *destination_, bool inc_seqnum_) +void xs::object_t::send_plug (own_t *destination_, bool inc_seqnum_) { if (inc_seqnum_) destination_->inc_seqnum (); command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -191,11 +191,11 @@ void zmq::object_t::send_plug (own_t *destination_, bool inc_seqnum_) send_command (cmd); } -void zmq::object_t::send_own (own_t *destination_, own_t *object_) +void xs::object_t::send_own (own_t *destination_, own_t *object_) { destination_->inc_seqnum (); command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -204,14 +204,14 @@ void zmq::object_t::send_own (own_t *destination_, own_t *object_) send_command (cmd); } -void zmq::object_t::send_attach (session_base_t *destination_, +void xs::object_t::send_attach (session_base_t *destination_, i_engine *engine_, bool inc_seqnum_) { if (inc_seqnum_) destination_->inc_seqnum (); command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -220,14 +220,14 @@ void zmq::object_t::send_attach (session_base_t *destination_, send_command (cmd); } -void zmq::object_t::send_bind (own_t *destination_, pipe_t *pipe_, +void xs::object_t::send_bind (own_t *destination_, pipe_t *pipe_, bool inc_seqnum_) { if (inc_seqnum_) destination_->inc_seqnum (); command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -236,10 +236,10 @@ void zmq::object_t::send_bind (own_t *destination_, pipe_t *pipe_, send_command (cmd); } -void zmq::object_t::send_activate_read (pipe_t *destination_) +void xs::object_t::send_activate_read (pipe_t *destination_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -247,11 +247,11 @@ void zmq::object_t::send_activate_read (pipe_t *destination_) send_command (cmd); } -void zmq::object_t::send_activate_write (pipe_t *destination_, +void xs::object_t::send_activate_write (pipe_t *destination_, uint64_t msgs_read_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -260,10 +260,10 @@ void zmq::object_t::send_activate_write (pipe_t *destination_, send_command (cmd); } -void zmq::object_t::send_hiccup (pipe_t *destination_, void *pipe_) +void xs::object_t::send_hiccup (pipe_t *destination_, void *pipe_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -272,10 +272,10 @@ void zmq::object_t::send_hiccup (pipe_t *destination_, void *pipe_) send_command (cmd); } -void zmq::object_t::send_pipe_term (pipe_t *destination_) +void xs::object_t::send_pipe_term (pipe_t *destination_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -283,10 +283,10 @@ void zmq::object_t::send_pipe_term (pipe_t *destination_) send_command (cmd); } -void zmq::object_t::send_pipe_term_ack (pipe_t *destination_) +void xs::object_t::send_pipe_term_ack (pipe_t *destination_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -294,11 +294,11 @@ void zmq::object_t::send_pipe_term_ack (pipe_t *destination_) send_command (cmd); } -void zmq::object_t::send_term_req (own_t *destination_, +void xs::object_t::send_term_req (own_t *destination_, own_t *object_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -307,10 +307,10 @@ void zmq::object_t::send_term_req (own_t *destination_, send_command (cmd); } -void zmq::object_t::send_term (own_t *destination_, int linger_) +void xs::object_t::send_term (own_t *destination_, int linger_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -319,10 +319,10 @@ void zmq::object_t::send_term (own_t *destination_, int linger_) send_command (cmd); } -void zmq::object_t::send_term_ack (own_t *destination_) +void xs::object_t::send_term_ack (own_t *destination_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = destination_; @@ -330,10 +330,10 @@ void zmq::object_t::send_term_ack (own_t *destination_) send_command (cmd); } -void zmq::object_t::send_reap (class socket_base_t *socket_) +void xs::object_t::send_reap (class socket_base_t *socket_) { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = ctx->get_reaper (); @@ -342,10 +342,10 @@ void zmq::object_t::send_reap (class socket_base_t *socket_) send_command (cmd); } -void zmq::object_t::send_reaped () +void xs::object_t::send_reaped () { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = ctx->get_reaper (); @@ -353,10 +353,10 @@ void zmq::object_t::send_reaped () send_command (cmd); } -void zmq::object_t::send_done () +void xs::object_t::send_done () { command_t cmd; -#if defined ZMQ_MAKE_VALGRIND_HAPPY +#if defined XS_MAKE_VALGRIND_HAPPY memset (&cmd, 0, sizeof (cmd)); #endif cmd.destination = NULL; @@ -364,87 +364,87 @@ void zmq::object_t::send_done () ctx->send_command (ctx_t::term_tid, cmd); } -void zmq::object_t::process_stop () +void xs::object_t::process_stop () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_plug () +void xs::object_t::process_plug () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_own (own_t *object_) +void xs::object_t::process_own (own_t *object_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_attach (i_engine *engine_) +void xs::object_t::process_attach (i_engine *engine_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_bind (pipe_t *pipe_) +void xs::object_t::process_bind (pipe_t *pipe_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_activate_read () +void xs::object_t::process_activate_read () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_activate_write (uint64_t msgs_read_) +void xs::object_t::process_activate_write (uint64_t msgs_read_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_hiccup (void *pipe_) +void xs::object_t::process_hiccup (void *pipe_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_pipe_term () +void xs::object_t::process_pipe_term () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_pipe_term_ack () +void xs::object_t::process_pipe_term_ack () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_term_req (own_t *object_) +void xs::object_t::process_term_req (own_t *object_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_term (int linger_) +void xs::object_t::process_term (int linger_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_term_ack () +void xs::object_t::process_term_ack () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_reap (class socket_base_t *socket_) +void xs::object_t::process_reap (class socket_base_t *socket_) { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_reaped () +void xs::object_t::process_reaped () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::process_seqnum () +void xs::object_t::process_seqnum () { - zmq_assert (false); + xs_assert (false); } -void zmq::object_t::send_command (command_t &cmd_) +void xs::object_t::send_command (command_t &cmd_) { ctx->send_command (cmd_.destination->get_tid (), cmd_); } -- cgit v1.2.3