Skip to content

Commit

Permalink
Usage of deprecated error code removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
eao197 committed May 23, 2022
1 parent a012114 commit bfb8778
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dev/so_5_extra/error_ranges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ const int asio_one_thread_errors = 21000;
*/
const int mboxes_unique_subscribers_errors = 21100;

//! Starting point for errors of mboxes::round_robin submodule.
/*!
* \since
* v.1.5.1.1
*/
const int mboxes_round_robin_errors = 21200;

} /* namespace errors */

} /* namespace extra */
Expand Down
21 changes: 19 additions & 2 deletions dev/so_5_extra/mboxes/round_robin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#pragma once

#include <so_5_extra/error_ranges.hpp>

#include <so_5/impl/msg_tracing_helpers.hpp>
#include <so_5/impl/message_limit_internals.hpp>

Expand All @@ -16,6 +18,19 @@ namespace mboxes {

namespace round_robin {

namespace errors {

/*!
* \brief An attempt to set delivery filter to round_robin mbox.
*
* \since
* v.1.0.1
*/
const int rc_delivery_filter_cannot_be_used_on_round_robin_mbox =
so_5::extra::errors::mboxes_round_robin_errors;

} /* namespace errors */

namespace details {

//
Expand Down Expand Up @@ -291,9 +306,11 @@ class mbox_template_t
const delivery_filter_t & /*filter*/,
agent_t & /*subscriber*/ ) override
{
using namespace so_5::extra::mboxes::round_robin::errors;

SO_5_THROW_EXCEPTION(
rc_delivery_filter_cannot_be_used_on_mpsc_mbox,
"set_delivery_filter is called for MPSC-mbox" );
rc_delivery_filter_cannot_be_used_on_round_robin_mbox,
"set_delivery_filter is called for round_robin-mbox" );
}

void
Expand Down

0 comments on commit bfb8778

Please sign in to comment.