MCPcopy Create free account
hub / github.com/boostorg/asio / deregister_handler

Method deregister_handler

example/cpp11/executors/actor.cpp:125–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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>

Callers

nothing calls this directly

Calls 5

eraseMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
is_functionMethod · 0.45

Tested by

no test coverage detected