1 //------------------------------------------------------------------------------
2 // Copyright (c) 2001-2002, OpenBeOS
4 // Permission is hereby granted, free of charge, to any person obtaining a
5 // copy of this software and associated documentation files (the "Software"),
6 // to deal in the Software without restriction, including without limitation
7 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 // and/or sell copies of the Software, and to permit persons to whom the
9 // Software is furnished to do so, subject to the following conditions:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
22 // File Name: MessageRunnerManager.h
23 // Author: Ingo Weinhold (bonefish@users.sf.net)
24 // Description: Manages the registrar side "shadows" of BMessageRunners.
25 //------------------------------------------------------------------------------
27 #ifndef MESSAGE_RUNNER_MANAGER_H
28 #define MESSAGE_RUNNER_MANAGER_H
36 class MessageRunnerManager
{
38 MessageRunnerManager(EventQueue
*eventQueue
);
39 virtual ~MessageRunnerManager();
41 void HandleRegisterRunner(BMessage
*request
);
42 void HandleUnregisterRunner(BMessage
*request
);
43 void HandleSetRunnerParams(BMessage
*request
);
44 void HandleGetRunnerInfo(BMessage
*request
);
52 friend class RunnerEvent
;
55 bool _AddInfo(RunnerInfo
*info
);
56 bool _RemoveInfo(RunnerInfo
*info
);
57 RunnerInfo
*_RemoveInfo(int32 index
);
58 RunnerInfo
*_RemoveInfoWithToken(int32 token
);
59 bool _DeleteInfo(RunnerInfo
*info
, bool eventRemoved
);
61 int32
_CountInfos() const;
63 RunnerInfo
*_InfoAt(int32 index
) const;
64 RunnerInfo
*_InfoForToken(int32 token
) const;
66 bool _HasInfo(RunnerInfo
*info
) const;
68 int32
_IndexOf(RunnerInfo
*info
) const;
69 int32
_IndexOfToken(int32 token
) const;
71 bool _DoEvent(RunnerInfo
*info
);
72 bool _ScheduleEvent(RunnerInfo
*info
);
79 EventQueue
*fEventQueue
;
83 #endif // MESSAGE_RUNNER_MANAGER_H