Skip to content
Snippets Groups Projects
Commit 62b3c7bd authored by Yun Liu's avatar Yun Liu
Browse files

remove warnings for several classes

parent bfdd1e11
Branches
Tags
No related merge requests found
...@@ -45,6 +45,15 @@ public: ...@@ -45,6 +45,15 @@ public:
*/ */
~AudioFile(); ~AudioFile();
// Copy Constructor
AudioFile(const AudioFile& rh):_filename(""), _codec(NULL), _start(false) { *this = rh; }
// Assignment Operator
AudioFile& operator=( const AudioFile& rh){
_debug("DTMFException assignment operator hasn't been implemented yet. Quit!");
exit(0);
}
/** /**
* Load a sound file in memory * Load a sound file in memory
* @param filename The absolute path to the file * @param filename The absolute path to the file
......
...@@ -62,6 +62,18 @@ DTMFException::~DTMFException() throw() ...@@ -62,6 +62,18 @@ DTMFException::~DTMFException() throw()
} }
DTMFException::DTMFException(const DTMFException& rh) throw()
{
*this = rh;
}
DTMFException& DTMFException::operator=(const DTMFException& rh) throw()
{
_debug("DTMFException assignment operator hasn't been implemented yet. Quit!");
exit(0);
}
const char* DTMFException::what() const throw() const char* DTMFException::what() const throw()
{ {
return reason; return reason;
...@@ -90,6 +102,16 @@ DTMFGenerator::~DTMFGenerator() { ...@@ -90,6 +102,16 @@ DTMFGenerator::~DTMFGenerator() {
} }
} }
DTMFGenerator::DTMFGenerator(const DTMFGenerator& rh) : tone("", rh._sampleRate)
{
*this = rh;
}
DTMFGenerator& DTMFGenerator::operator=(const DTMFGenerator& rh)
{
_debug("DTMFGenerator assignment operator hasn't been implemented yet. Quit!");
exit(0);
}
/* /*
* Get n samples of the signal of code code * Get n samples of the signal of code code
......
...@@ -53,6 +53,12 @@ class DTMFException : public std::exception ...@@ -53,6 +53,12 @@ class DTMFException : public std::exception
*/ */
virtual ~DTMFException() throw(); virtual ~DTMFException() throw();
// Copy Constructor
DTMFException(const DTMFException& rh) throw();
// Assignment Operator
DTMFException& operator=( const DTMFException& rh) throw();
/** /**
* @return const char* The error * @return const char* The error
*/ */
...@@ -107,6 +113,12 @@ class DTMFGenerator ...@@ -107,6 +113,12 @@ class DTMFGenerator
*/ */
~DTMFGenerator(); ~DTMFGenerator();
// Copy Constructor
DTMFGenerator(const DTMFGenerator& rh);
// Assignment Operator
DTMFGenerator& operator=( const DTMFGenerator& rh);
/* /*
* Get n samples of the signal of code code * Get n samples of the signal of code code
* @param buffer a SFLDataFormat pointer to an allocated buffer * @param buffer a SFLDataFormat pointer to an allocated buffer
......
...@@ -30,11 +30,10 @@ ...@@ -30,11 +30,10 @@
#define MIN_BUFFER_SIZE 1280 #define MIN_BUFFER_SIZE 1280
// Create a ring buffer with 'size' bytes // Create a ring buffer with 'size' bytes
RingBuffer::RingBuffer(int size) { RingBuffer::RingBuffer(int size): mStart( 0 ), mEnd( 0 )
mBufferSize = (size > MIN_BUFFER_SIZE ? size : MIN_BUFFER_SIZE); , mBufferSize( size > MIN_BUFFER_SIZE ? size : MIN_BUFFER_SIZE )
mStart = 0; , mBuffer (new unsigned char[mBufferSize])
mEnd = 0; {
mBuffer = new unsigned char[mBufferSize];
assert (mBuffer != NULL); assert (mBuffer != NULL);
} }
...@@ -43,6 +42,12 @@ RingBuffer::~RingBuffer() { ...@@ -43,6 +42,12 @@ RingBuffer::~RingBuffer() {
delete[] mBuffer; mBuffer = NULL; delete[] mBuffer; mBuffer = NULL;
} }
// Assignment operator
RingBuffer& RingBuffer::operator=(const RingBuffer& rh) {
_debug("RingBuffer assignment operator hasn't been implemented yet. Quit!");
exit(0);
}
void void
RingBuffer::flush (void) { RingBuffer::flush (void) {
mStart = 0; mStart = 0;
......
...@@ -38,6 +38,13 @@ class RingBuffer { ...@@ -38,6 +38,13 @@ class RingBuffer {
*/ */
~RingBuffer(); ~RingBuffer();
// Copy Constructor
RingBuffer(const RingBuffer& rh): mStart(rh.mStart), mEnd(rh.mEnd), mBufferSize( rh.mBufferSize ), mBuffer ( rh.mBuffer )
{ *this = rh; }
// Assignment operator
RingBuffer& operator=(const RingBuffer& rh);
/** /**
* Reset the counters to 0 * Reset the counters to 0
*/ */
......
...@@ -20,12 +20,28 @@ ...@@ -20,12 +20,28 @@
#include "eventthread.h" #include "eventthread.h"
#include "voiplink.h" #include "voiplink.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "global.h"
EventThread::EventThread (VoIPLink* link) : Thread ()
EventThread::EventThread (VoIPLink* link) : Thread (), _linkthread(link), stopIt(false)
{ {
_linkthread = link;
setCancel(cancelDeferred); setCancel(cancelDeferred);
stopIt = false; }
// Copy Constructor
EventThread::EventThread(const EventThread& rh): _linkthread(NULL), stopIt(false)
{
*this = rh;
}
// Assignment Operator overloading
EventThread& EventThread::operator=(const EventThread& rh)
{
_debug("EventThread assignment operator hasn't been implemented yet. Quit! ");
//exit(0);
} }
EventThread::~EventThread (void) EventThread::~EventThread (void)
......
...@@ -37,7 +37,8 @@ public: ...@@ -37,7 +37,8 @@ public:
*/ */
EventThread (VoIPLink*); EventThread (VoIPLink*);
~EventThread (void); ~EventThread (void);
EventThread(const EventThread& rh); // copy constructor
EventThread& operator=(const EventThread& rh); // assignment operator
virtual void run (); virtual void run ();
virtual void stop(); virtual void stop();
virtual void startLoop(); virtual void startLoop();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment