sipXcallLib home page


PsHookswDev.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 #ifndef _PsHookswDev_h_
13 #define _PsHookswDev_h_
14 
15 // SYSTEM INCLUDES
16 
17 // APPLICATION INCLUDES
18 #include "os/OsDefs.h"
19 #include "os/OsBSem.h"
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 
29 // FORWARD DECLARATIONS
30 class PsHookswTask;
31 
32 //:Base class for the phone set hook switch device
33 // Platform-specific hook switch classes are all derived from this class.
35 {
36 /* //////////////////////////// PUBLIC //////////////////////////////////// */
37 public:
38 
39 /* ============================ CREATORS ================================== */
40 
41  static PsHookswDev* getHookswDev(PsHookswTask* pHookswTask=NULL);
42  //:Return a pointer to the hookswitch device, creating it if necessary.
43 
44  virtual
45  ~PsHookswDev();
46  //:Destructor
47 
48 /* ============================ MANIPULATORS ============================== */
49 
50  virtual void disableIntr(void) = 0;
51  //:Disable hook switch interrupts
52 
53  virtual void enableIntr(UtlBoolean lookForOffHook) = 0;
54  //:Enable hook switch interrupts
55 
56 /* ============================ ACCESSORS ================================= */
57 
58 /* ============================ INQUIRY =================================== */
59 
60  virtual UtlBoolean isOffHook(void) = 0;
61  //:Return TRUE if the hookswitch is "off hook", otherwise FALSE.
62 
63  virtual UtlBoolean isOnHook(void) = 0;
64  //:Return TRUE if the hookswitch is "on hook", otherwise FALSE.
65 
66 /* //////////////////////////// PROTECTED ///////////////////////////////// */
67 protected:
68  static PsHookswDev* spInstance; // pointer to the single instance of
69  // the PsHookswDev class
70  static OsBSem sLock; // semaphore used to ensure that there
71  // is only one instance of this class
73 
74  PsHookswDev(PsHookswTask* pHookswTask);
75  //:Constructor
76 
77 /* //////////////////////////// PRIVATE /////////////////////////////////// */
78 private:
79 
80  PsHookswDev(const PsHookswDev& rPsHookswDev);
81  //:Copy constructor (not implemented for this class)
82 
83  PsHookswDev& operator=(const PsHookswDev& rhs);
84  //:Assignment operator (not implemented for this class)
85 
86 };
87 
88 /* ============================ INLINE METHODS ============================ */
89 
90 #endif // _PsHookswDev_h_
static PsHookswDev * spInstance
Definition: PsHookswDev.h:68
PsHookswDev(PsHookswTask *pHookswTask)
Definition: PsHookswDev.cpp:112
Definition: PsHookswDev.h:34
PsHookswDev & operator=(const PsHookswDev &rhs)
virtual void enableIntr(UtlBoolean lookForOffHook)=0
Definition: PsHookswTask.h:41
virtual ~PsHookswDev()
Definition: PsHookswDev.cpp:98
PsHookswTask * mpHookswTask
Definition: PsHookswDev.h:72
static PsHookswDev * getHookswDev(PsHookswTask *pHookswTask=NULL)
Definition: PsHookswDev.cpp:41
virtual void disableIntr(void)=0
static OsBSem sLock
Definition: PsHookswDev.h:70
virtual UtlBoolean isOnHook(void)=0
virtual UtlBoolean isOffHook(void)=0