O(1) socket removal

This commit is contained in:
Martin Sustrik
2009-09-02 16:16:25 +02:00
parent f92de9b2a9
commit 4914e5c9d1
3 changed files with 26 additions and 7 deletions

View File

@@ -42,7 +42,8 @@ zmq::socket_base_t::socket_base_t (app_thread_t *parent_) :
pending_term_acks (0),
ticks (0),
app_thread (parent_),
shutting_down (false)
shutting_down (false),
index (-1)
{
}
@@ -379,6 +380,17 @@ void zmq::socket_base_t::detach_outpipe (class writer_t *pipe_)
out_pipes.pop_back ();
}
void zmq::socket_base_t::set_index (int index_)
{
index = index_;
}
int zmq::socket_base_t::get_index ()
{
zmq_assert (index != -1);
return index;
}
void zmq::socket_base_t::process_own (owned_t *object_)
{
io_objects.insert (object_);