sipXcallLib home page


TaoEvent.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 _TaoEvent_h_
13 #define _TaoEvent_h_
14 
15 #include <utl/UtlString.h>
16 
17 #include "os/OsEvent.h"
18 #include "os/OsMutex.h"
19 #include "tao/TaoDefs.h"
20 
21 //#define TAO_DEBUG
22 
23 class TaoEvent : public OsEvent
24 {
25 /* //////////////////////////// PUBLIC //////////////////////////////////// */
26 public:
27 
28 /* ============================ CREATORS ================================== */
29  TaoEvent(const int userData=0);
30 
31  TaoEvent(const TaoEvent& rTaoEvent);
32  //:Copy constructor (not implemented for this class)
33 
34  virtual ~TaoEvent();
35 
36 /* ============================ MANIPULATORS ============================== */
37 
38  virtual OsStatus reset(void);
39  //:Reset the event so that it may be signaled again
40  // Return OS_NOT_SIGNALED if the event has not been signaled (or has
41  // already been cleared), otherwise return OS_SUCCESS.
42 
43  virtual OsStatus wait(int msgId, const OsTime& rTimeout=OsTime::OS_INFINITY);
44  //:Wait for the event to be signaled
45  // Return OS_BUSY if the timeout expired, otherwise return OS_SUCCESS.
46 
47  void setMutex(OsMutex* pMutex);
48 
49  void setStringData(UtlString& rStringData);
50 
51  void setIntData(int rIntData);
52 
53  void setIntData2(int rIntData);
54 
55 
56 /* ============================ ACCESSORS ================================= */
57 
58  TaoStatus getStringData(UtlString& data);
59  //:Return the user data specified when this object was constructed.
60  // Always returns OS_SUCCESS.
61 
62  TaoStatus getIntData(int& data);
63 
64  TaoStatus getIntData2(int& data);
65  //:Return the user data specified when this object was constructed.
66  // Always returns OS_SUCCESS.
67 
68 /* //////////////////////////// PRIVATE /////////////////////////////////// */
69 private:
70  UtlString mStringData;
71  int mIntData;
72  int mIntData2;
73  OsMutex* mpMutex;
74 #ifdef TAO_DEBUG
75  int mWaits;
76 #endif
77 
78 
79 };
80 
81 #endif // _TaoEvent_h_
void setStringData(UtlString &rStringData)
Definition: TaoEvent.cpp:43
virtual OsStatus reset(void)
Definition: TaoEvent.cpp:67
UtlString mStringData
Definition: TaoEvent.h:70
Definition: TaoEvent.h:23
TaoEvent(const int userData=0)
Definition: TaoEvent.cpp:28
TaoStatus getIntData2(int &data)
Definition: TaoEvent.cpp:107
TaoStatus getStringData(UtlString &data)
Definition: TaoEvent.cpp:90
virtual OsStatus wait(int msgId, const OsTime &rTimeout=OsTime::OS_INFINITY)
Definition: TaoEvent.cpp:79
TaoStatus getIntData(int &data)
Definition: TaoEvent.cpp:101
TaoStatus
Definition: TaoDefs.h:41
int mIntData2
Definition: TaoEvent.h:72
OsMutex * mpMutex
Definition: TaoEvent.h:73
void setIntData(int rIntData)
Definition: TaoEvent.cpp:52
void setMutex(OsMutex *pMutex)
Definition: TaoEvent.cpp:62
virtual ~TaoEvent()
Definition: TaoEvent.cpp:39
void setIntData2(int rIntData)
Definition: TaoEvent.cpp:57
int mIntData
Definition: TaoEvent.h:71