sipxportlib  Version 3.3
OsEventMsg.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 _OsEventMsg_h_
13 #define _OsEventMsg_h_
14 
15 // SYSTEM INCLUDES
16 
17 // APPLICATION INCLUDES
18 #include "os/OsDefs.h"
19 #include "os/OsMsg.h"
20 #include "os/OsStatus.h"
21 #include "os/OsTime.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 
31 // FORWARD DECLARATIONS
32 class OsQueuedEvent;
33 
34 //:Message used to send event notifications
35 class OsEventMsg : public OsMsg
36 {
37 /* //////////////////////////// PUBLIC //////////////////////////////////// */
38 public:
39 
41  {
42  UNSPECIFIED, // Not yet initialized
43  NOTIFY // Event notification
44  };
47 
48 /* ============================ CREATORS ================================== */
49 
50  OsEventMsg(const unsigned char subType, const OsQueuedEvent& rEvent,
51  const intptr_t eventData, const OsTime& rTimestamp);
52  //:Constructor
53 
54  OsEventMsg(const OsEventMsg& rOsEventMsg);
55  //:Copy constructor
56 
57  virtual OsMsg* createCopy(void) const;
58  //:Create a copy of this msg object (which may be of a derived type)
59 
60  virtual
61  ~OsEventMsg();
62  //:Destructor
63 
64 /* ============================ MANIPULATORS ============================== */
65 
66  OsEventMsg& operator=(const OsEventMsg& rhs);
67  //:Assignment operator
68 
69 /* ============================ ACCESSORS ================================= */
70 
71  virtual int getMsgSize() const;
72  //:Return the size of the message in bytes
73  // This is a virtual method so that it will return the accurate size for
74  // the message object even if that object has been upcast to the type of
75  // an ancestor class.
76 
77  virtual OsStatus getEventData(intptr_t& rEventData) const;
78  //:Return the event data that was signaled by the notifier task
79  // Always returns OS_SUCCESS.
80 
81  virtual OsStatus getTimestamp(OsTime& rTimestamp) const;
82  //:Return the timestamp associated with this event
83  // Always returns OS_SUCCESS.
84 
85  virtual OsStatus getUserData(intptr_t& rUserData) const;
86  //:Return the user data specified when the OsQueuedEvent was constructed
87  // Always returns OS_SUCCESS.
88 
89 /* ============================ INQUIRY =================================== */
90 
91 /* //////////////////////////// PROTECTED ///////////////////////////////// */
92 protected:
93 
94 /* //////////////////////////// PRIVATE /////////////////////////////////// */
95 private:
96 
97  intptr_t mEventData;
98  intptr_t mUserData;
99  OsTime mTimestamp;
100 
101 };
102 
103 /* ============================ INLINE METHODS ============================ */
104 
105 #endif // _OsEventMsg_h_
106 
Definition: OsEventMsg.h:35
virtual int getMsgSize() const
Definition: OsEventMsg.cpp:88
Definition: OsEventMsg.h:42
Queued events are used to send event notifications using a message queue.
Definition: OsQueuedEvent.h:57
OsEventMsg & operator=(const OsEventMsg &rhs)
Definition: OsEventMsg.cpp:68
OsStatus
Definition: OsStatus.h:27
Definition: OsEventMsg.h:43
virtual OsMsg * createCopy(void) const
Definition: OsEventMsg.cpp:53
virtual ~OsEventMsg()
Definition: OsEventMsg.cpp:59
Definition: OsTime.h:37
virtual OsStatus getEventData(intptr_t &rEventData) const
Definition: OsEventMsg.cpp:95
virtual OsStatus getTimestamp(OsTime &rTimestamp) const
Definition: OsEventMsg.cpp:103
Definition: OsMsg.h:36
MsgSubType
Definition: OsEventMsg.h:40
virtual OsStatus getUserData(intptr_t &rUserData) const
Definition: OsEventMsg.cpp:111
OsEventMsg(const unsigned char subType, const OsQueuedEvent &rEvent, const intptr_t eventData, const OsTime &rTimestamp)
enumcode: UNSPECIFIED - not yet initialized enumcode: NOTIFY - event notification.
Definition: OsEventMsg.cpp:29
_W64 signed int intptr_t
Definition: stdint.h:118