sipxportlib  Version 3.3
OsTimerMessage.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 #ifndef _OsTimerMessage_h_
12 #define _OsTimerMessage_h_
13 
14 // SYSTEM INCLUDES
15 
16 // APPLICATION INCLUDES
17 #include "os/OsDefs.h"
18 #include "os/OsBSem.h"
19 #include "os/OsTimer.h"
20 #include "os/OsMsg.h"
21 #include "os/OsStatus.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 // FORWARD DECLARATIONS
31 
32 //:Message used to send timer operation requests
33 class OsTimerMessage : public OsMsg
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
37 
39  {
40  UNSPECIFIED, // Not yet initialized
41  ADD, // Add a new timer
42  REMOVE, // Remove an existing timer
43  SHUTDOWN // Shutdown the timer thread
44  };
49 
50 /* ============================ CREATORS ================================== */
51 
52  OsTimerMessage(OsTimer* pTimer, OsBSem* pSem);
53  //:Constructor for ADD messages
54 
55  OsTimerMessage(int ID, OsBSem* pSem);
56  //:Constructor for REMOVE messages
57 
58  OsTimerMessage(OsBSem* pSem);
59  //:Constructor for SHUTDOWN messages
60 
61  OsTimerMessage(const OsTimerMessage& rOsTimerMessage);
62  //:Copy constructor
63 
64  virtual OsMsg* createCopy(void) const;
65  //:Create a copy of this msg object (which may be of a derived type)
66 
67  virtual
69  //:Destructor
70 
71 /* ============================ MANIPULATORS ============================== */
72 
74  //:Assignment operator
75 
76 /* ============================ ACCESSORS ================================= */
77 
78  virtual int getMsgSize(void) const;
79  //:Return the size of the message in bytes
80  // This is a virtual method so that it will return the accurate size for
81  // the message object even if that object has been upcast to the type of
82  // an ancestor class.
83 
84  int getTimerID(void);
85  //:Get the timer ID (for REMOVE messages)
86 
87  OsTimer* getTimer(void);
88  //:Get the OsTimer (for ADD messages)
89 
90  OsBSem* getSynchSem(void);
91  //:Get the synchronization semaphore (for ADD and REMOVE messages)
92 
93 /* ============================ INQUIRY =================================== */
94 
95 /* //////////////////////////// PROTECTED ///////////////////////////////// */
96 protected:
97 
98 /* //////////////////////////// PRIVATE /////////////////////////////////// */
99 private:
100 
101  int mID;
102  OsTimer* mpTimer;
103  OsBSem* mpSynchSem;
104 
105 };
106 
107 /* ============================ INLINE METHODS ============================ */
108 
109 #endif // _OsTimerMessage_h_
110 
Definition: OsTimerMessage.h:33
virtual ~OsTimerMessage()
Definition: OsTimerMessage.cpp:67
Definition: OsTimerMessage.h:40
Definition: OsTimerMessage.h:43
OsTimer * getTimer(void)
Definition: OsTimerMessage.cpp:108
OsTimerMessage & operator=(const OsTimerMessage &rhs)
Definition: OsTimerMessage.cpp:76
MsgSubType
Definition: OsTimerMessage.h:38
virtual OsMsg * createCopy(void) const
Definition: OsTimerMessage.cpp:61
OsBSem * getSynchSem(void)
Definition: OsTimerMessage.cpp:114
int getTimerID(void)
Definition: OsTimerMessage.cpp:102
virtual int getMsgSize(void) const
Definition: OsTimerMessage.cpp:96
Definition: OsTimer.h:105
Definition: OsTimerMessage.h:41
Definition: OsMsg.h:36
Definition: OsTimerMessage.h:42
OsTimerMessage(OsTimer *pTimer, OsBSem *pSem)
enumcode: UNSPECIFIED - not yet initialized enumcode: ADD - add a new timer. enumcode: REMOVE - remov...
Definition: OsTimerMessage.cpp:27