sipxmedialib  Version 3.3
MpToneResourceMsg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 #ifndef _MpToneResourceMsg_h_
12 #define _MpToneResourceMsg_h_
13 
14 // SYSTEM INCLUDES
15 
16 // APPLICATION INCLUDES
17 #include "os/OsMsg.h"
18 #include "mp/MpResourceMsg.h"
19 #include "utl/UtlString.h"
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
32 {
33  /* //////////////////////////// PUBLIC //////////////////////////////////// */
34 public:
35 
36  /* ============================ CREATORS ================================== */
38 
39 
41  inline MpToneResourceMsg(const UtlString& msgDestName, int toneCode);
42 
44  inline MpToneResourceMsg(const MpToneResourceMsg& rMpResourceMsg);
45 
47  inline OsMsg* createCopy(void) const;
48 
50  inline ~MpToneResourceMsg();
51 
53 
54  /* ============================ MANIPULATORS ============================== */
56 
57 
59  inline MpToneResourceMsg& operator=(const MpToneResourceMsg& rhs);
60 
62  inline void setToneCode(int toneCode);
68  /* ============================ ACCESSORS ================================= */
70 
71 
73  inline int getToneCode(void) const;
79 
80  /* ============================ INQUIRY =================================== */
82 
83 
85 
86  /* //////////////////////////// PROTECTED ///////////////////////////////// */
87 protected:
88 
89  /* //////////////////////////// PRIVATE /////////////////////////////////// */
90 private:
91  int mToneCode;
92 };
93 
94 /* ============================ INLINE METHODS ============================ */
95 
96 MpToneResourceMsg::MpToneResourceMsg(const UtlString& msgDestName,
97  int toneCode)
98 : MpResourceMsg(MPRM_START_TONE, msgDestName)
99 , mToneCode(toneCode)
100 {
101 }
102 
104 : MpResourceMsg(rMpResourceMsg)
105 , mToneCode(rMpResourceMsg.mToneCode)
106 {};
107 
108 OsMsg* MpToneResourceMsg::createCopy(void) const
109 {
110  return new MpToneResourceMsg(*this);
111 }
112 
114 {
115  /* No work required */
116 }
117 
120 {
121  if (this == &rhs)
122  return *this; // handle the assignment to self case
123 
124  MpResourceMsg::operator=(rhs); // assign fields for parent class
125  mToneCode = rhs.mToneCode;
126  return *this;
127 }
128 
130 {
131  mToneCode = toneCode;
132 }
133 
135 {
136  return mToneCode;
137 }
138 
139 #endif // _MpToneResourceMsg_h_
MpResourceMsg & operator=(const MpResourceMsg &rhs)
Assignment operator.
Definition: MpResourceMsg.cpp:60
Message object used to communicate with the media processing task.
Definition: MpResourceMsg.h:30
void setToneCode(int toneCode)
Set the tone that is associated with this resource.
Definition: MpToneResourceMsg.h:129
int mToneCode
The tone to play/stop/etc.
Definition: MpToneResourceMsg.h:91
MpToneResourceMsg & operator=(const MpToneResourceMsg &rhs)
Assignment operator.
Definition: MpToneResourceMsg.h:119
Message object used to communicate with the media processing task.
Definition: MpToneResourceMsg.h:31
OsMsg * createCopy(void) const
Create a copy of this msg object (which may be of a derived type)
Definition: MpToneResourceMsg.h:108
MpToneResourceMsg(const UtlString &msgDestName, int toneCode)
Constructor.
Definition: MpToneResourceMsg.h:96
int getToneCode(void) const
Get the tone that is associated with this resource.
Definition: MpToneResourceMsg.h:134
~MpToneResourceMsg()
Destructor.
Definition: MpToneResourceMsg.h:113
MprToneGen: Start a tone.
Definition: MpResourceMsg.h:43