| 123 | // Deregister a handler. Removes only the first matching handler. |
| 124 | template <class Actor, class Message> |
| 125 | void deregister_handler(void (Actor::* mf)(Message, actor_address)) |
| 126 | { |
| 127 | const std::type_info& id = typeid(Message); |
| 128 | for (auto iter = handlers_.begin(); iter != handlers_.end(); ++iter) |
| 129 | { |
| 130 | if ((*iter)->message_id() == id) |
| 131 | { |
| 132 | auto mh = static_cast<mf_message_handler<Actor, Message>*>(iter->get()); |
| 133 | if (mh->is_function(mf)) |
| 134 | { |
| 135 | handlers_.erase(iter); |
| 136 | return; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // Send a message from within a message handler. |
| 143 | template <class Message> |
nothing calls this directly
no test coverage detected