From aa33d0a9282414f1ddd1a902401dfd3c42558e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 26 Jan 2007 12:11:33 +0000 Subject: [PATCH] Got rid of the looper ID stuff - it seems nowhere to be used. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19965 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/LooperList.h | 85 ++++++++------------------------ src/kits/app/LooperList.cpp | 20 +++----- 2 files changed, 28 insertions(+), 77 deletions(-) diff --git a/headers/private/app/LooperList.h b/headers/private/app/LooperList.h index 6ca6fb5eca..9e926b6edf 100644 --- a/headers/private/app/LooperList.h +++ b/headers/private/app/LooperList.h @@ -1,54 +1,26 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: LooperList.h -// Author(s): Erik Jaesler (erik@cgsoftware.com) -// Description: Maintains a global list of all loopers in a given team. -//------------------------------------------------------------------------------ - +/* + * Copyright 2001-2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Erik Jaesler (erik@cgsoftware.com) + */ #ifndef LOOPERLIST_H #define LOOPERLIST_H -// Standard Includes ----------------------------------------------------------- -#include -// System Includes ------------------------------------------------------------- #include #include #include -// Project Includes ------------------------------------------------------------ - -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- +#include class BLooper; + namespace BPrivate { -class BLooperList -{ +class BLooperList { public: BLooperList(); @@ -66,39 +38,33 @@ class BLooperList BLooper* LooperForName(const char* name); BLooper* LooperForPort(port_id port); - struct LooperData - { + private: + struct LooperData { LooperData(); - LooperData(BLooper* loop, uint32 i); + LooperData(BLooper* looper); LooperData(const LooperData& rhs); LooperData& operator=(const LooperData& rhs); BLooper* looper; - uint32 id; }; - private: - static bool EmptySlotPred(LooperData& Data); - struct FindLooperPred - { + static bool EmptySlotPred(LooperData& Data); + struct FindLooperPred { FindLooperPred(const BLooper* loop) : looper(loop) {;} bool operator()(LooperData& Data); const BLooper* looper; }; - struct FindThreadPred - { + struct FindThreadPred { FindThreadPred(thread_id tid) : thread(tid) {;} bool operator()(LooperData& Data); thread_id thread; }; - struct FindNamePred - { + struct FindNamePred { FindNamePred(const char* n) : name(n) {;} bool operator()(LooperData& Data); const char* name; }; - struct FindPortPred - { + struct FindPortPred { FindPortPred(port_id pid) : port(pid) {;} bool operator()(LooperData& Data); port_id port; @@ -107,20 +73,11 @@ class BLooperList void AssertLocked(); BLocker fLock; - uint32 fLooperID; std::vector fData; }; -extern _IMPEXP_BE BLooperList gLooperList; -} +extern BLooperList gLooperList; +} // namespace BPrivate -#endif //LOOPERLIST_H - -/* - * $Log $ - * - * $Id $ - * - */ - +#endif // LOOPERLIST_H diff --git a/src/kits/app/LooperList.cpp b/src/kits/app/LooperList.cpp index 2a64581bef..4fc8eedba1 100644 --- a/src/kits/app/LooperList.cpp +++ b/src/kits/app/LooperList.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -28,8 +28,7 @@ typedef vector::iterator LooperDataIterator; BLooperList::BLooperList() : - fLock("BLooperList lock"), - fLooperID(0) + fLock("BLooperList lock") { } @@ -63,13 +62,10 @@ BLooperList::AddLooper(BLooper* looper) if (!IsLooperValid(looper)) { LooperDataIterator i = find_if(fData.begin(), fData.end(), EmptySlotPred); if (i == fData.end()) { - fData.push_back(LooperData(looper, ++fLooperID)); - looper->fLooperID = fLooperID; + fData.push_back(LooperData(looper)); looper->Lock(); } else { i->looper = looper; - i->id = ++fLooperID; - looper->fLooperID = fLooperID; looper->Lock(); } } @@ -201,13 +197,13 @@ BLooperList::AssertLocked() BLooperList::LooperData::LooperData() - : looper(NULL), id(0) + : looper(NULL) { } -BLooperList::LooperData::LooperData(BLooper* loop, uint32 i) - : looper(loop), id(i) +BLooperList::LooperData::LooperData(BLooper* looper) + : looper(looper) { } @@ -221,10 +217,8 @@ BLooperList::LooperData::LooperData(const LooperData& other) BLooperList::LooperData& BLooperList::LooperData::operator=(const LooperData& other) { - if (this != &other) { + if (this != &other) looper = other.looper; - id = other.id; - } return *this; }