// -*- c++ -*- //------------------------------------------------------------------------------ // IdSet.cpp //------------------------------------------------------------------------------ // Copyright (C) 1997-2002 Vladislav Grinchenko // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. //------------------------------------------------------------------------------ #include "assa/Logger.h" #include "assa/IdSet.h" using namespace ASSA; int IdSet:: newid() { register int i; register int current; trace("IdSet::newid"); current = m_next_available_id++; if (m_next_available_id < FD_SETSIZE) { // mark current id as being in use FD_SET(current, &m_id_set_map); // search starting from current position to the end // assuming that m_next_available_id is maintained // to be the lowest available at all times. for (i=current+1; i