live
HandlerSet.hh
Go to the documentation of this file.
1 /**********
2 This library is free software; you can redistribute it and/or modify it under
3 the terms of the GNU Lesser General Public License as published by the
4 Free Software Foundation; either version 3 of the License, or (at your
5 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6 
7 This library is distributed in the hope that it will be useful, but WITHOUT
8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10 more details.
11 
12 You should have received a copy of the GNU Lesser General Public License
13 along with this library; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 **********/
16 // Copyright (c) 1996-2021 Live Networks, Inc. All rights reserved.
17 // Basic Usage Environment: for a simple, non-scripted, console application
18 // C++ header
19 
20 #ifndef _HANDLER_SET_HH
21 #define _HANDLER_SET_HH
22 
23 #ifndef _BOOLEAN_HH
24 #include "Boolean.hh"
25 #endif
26 
28 
31  virtual ~HandlerDescriptor();
32 
33 public:
34  int socketNum;
37  void* clientData;
38 
39 private:
40  // Descriptors are linked together in a doubly-linked list:
41  friend class HandlerSet;
42  friend class HandlerIterator;
45 };
46 
47 class HandlerSet {
48 public:
50  virtual ~HandlerSet();
51 
52  void assignHandler(int socketNum, int conditionSet, TaskScheduler::BackgroundHandlerProc* handlerProc, void* clientData);
53  void clearHandler(int socketNum);
54  void moveHandler(int oldSocketNum, int newSocketNum);
55 
56 private:
58 
59 private:
60  friend class HandlerIterator;
62 };
63 
65 public:
67  virtual ~HandlerIterator();
68 
69  HandlerDescriptor* next(); // returns NULL if none
70  void reset();
71 
72 private:
75 };
76 
77 #endif
TaskScheduler::BackgroundHandlerProc * handlerProc
Definition: HandlerSet.hh:36
virtual ~HandlerDescriptor()
HandlerDescriptor * fPrevHandler
Definition: HandlerSet.hh:44
HandlerDescriptor(HandlerDescriptor *nextHandler)
HandlerDescriptor * fNextHandler
Definition: HandlerSet.hh:43
HandlerIterator(HandlerSet &handlerSet)
HandlerSet & fOurSet
Definition: HandlerSet.hh:73
virtual ~HandlerIterator()
HandlerDescriptor * next()
HandlerDescriptor * fNextPtr
Definition: HandlerSet.hh:74
HandlerDescriptor * lookupHandler(int socketNum)
void moveHandler(int oldSocketNum, int newSocketNum)
virtual ~HandlerSet()
void clearHandler(int socketNum)
HandlerDescriptor fHandlers
Definition: HandlerSet.hh:61
void assignHandler(int socketNum, int conditionSet, TaskScheduler::BackgroundHandlerProc *handlerProc, void *clientData)
void BackgroundHandlerProc(void *clientData, int mask)