Commit 3165a0a0 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #7842: use NON_COPYABLE macro

parent 20060fae
......@@ -178,7 +178,7 @@ DBUS_CPP_REQUIRED_VERSION=0.6.0-pre1
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AC_MSG_ERROR([You need the DBus-c++ libraries (version $DBUS_CPP_REQUIRED_VERSION or better)]))
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor"
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -Wfatal-errors"
AC_CHECK_LIB([expat], XML_ParserCreate_MM,
[AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)],
......
......@@ -36,6 +36,7 @@
#include <vector>
#include "global.h"
#include "noncopyable.h"
#include "config/config.h"
#include "config/serializable.h"
......@@ -292,11 +293,7 @@ class Account : public Serializable {
}
private:
// copy constructor
Account(const Account& rh);
// assignment operator
Account& operator= (const Account& rh);
NON_COPYABLE(Account);
/**
* Helper function used to load the default codec order from the codec factory
......
......@@ -34,6 +34,7 @@
#include "eventthread.h"
#include "audio/samplerateconverter.h"
#include "managerimpl.h"
#include "noncopyable.h"
#include "dbus/configurationmanager.h"
class AlsaThread : public ost::Thread {
......@@ -47,9 +48,7 @@ class AlsaThread : public ost::Thread {
virtual void run();
private:
AlsaThread(const AlsaThread& at);
AlsaThread& operator= (const AlsaThread& at);
NON_COPYABLE(AlsaThread);
AlsaLayer* alsa_;
};
......
......@@ -33,6 +33,7 @@
#define _ALSA_LAYER_H
#include "audio/audiolayer.h"
#include "noncopyable.h"
#include <alsa/asoundlib.h>
class RingBuffer;
......@@ -167,12 +168,7 @@ class AlsaLayer : public AudioLayer {
*/
int indexRing_;
// Copy Constructor
AlsaLayer(const AlsaLayer& rh);
// Assignment Operator
AlsaLayer& operator= (const AlsaLayer& rh);
NON_COPYABLE(AlsaLayer);
/**
* Drop the pending frames and close the capture device
......
......@@ -41,6 +41,7 @@
#include "ringbuffer.h"
#include "dcblocker.h"
#include "samplerateconverter.h"
#include "noncopyable.h"
/**
* @file audiolayer.h
......@@ -55,21 +56,10 @@ class Time;
class AudioLayer {
private:
//copy constructor
AudioLayer(const AudioLayer& rh);
// assignment operator
const AudioLayer& operator= (const AudioLayer& rh);
NON_COPYABLE(AudioLayer);
public:
/**
* Constructor
*/
AudioLayer();
/**
* Destructor
*/
virtual ~AudioLayer();
/**
......@@ -151,7 +141,6 @@ class AudioLayer {
SamplerateConverter *converter_;
private:
/**
* Time of the last incoming call notification
*/
......
......@@ -34,6 +34,7 @@
#define __AUDIOLOOP_H__
#include "global.h" // for SFLDataFormat
#include "noncopyable.h"
/**
* @file audioloop.h
......@@ -85,12 +86,7 @@ class AudioLoop {
unsigned int sampleRate_;
private:
// Copy Constructor
AudioLoop(const AudioLoop& rh);
// Assignment Operator
const AudioLoop& operator= (const AudioLoop& rh);
NON_COPYABLE(AudioLoop);
};
#endif // __AUDIOLOOP_H__
......
......@@ -31,9 +31,10 @@
#ifndef __AUDIORECORDER_H_
#define __AUDIORECORDER_H_
#include <string>
#include <cc++/thread.h>
#include "audiorecord.h"
#include <string>
#include "noncopyable.h"
class MainBuffer;
......@@ -55,13 +56,10 @@ class AudioRecorder : public ost::Thread {
virtual void run();
private:
AudioRecorder(const AudioRecorder& ar);
AudioRecorder& operator= (const AudioRecorder& ar);
NON_COPYABLE(AudioRecorder);
std::string recorderId_;
MainBuffer *mbuffer_;
AudioRecord *arecord_;
};
......
......@@ -27,8 +27,8 @@
* as that of the covered work.
*/
#ifndef __AUDIO_RTP_RECORD_HANDLER_H__
#define __AUDIO_RTP_RECORD_HANDLER_H__
#ifndef AUDIO_RTP_RECORD_HANDLER_H__
#define AUDIO_RTP_RECORD_HANDLER_H__
#include <cstddef>
using std::ptrdiff_t;
......@@ -37,6 +37,7 @@ using std::ptrdiff_t;
#include <list>
class SIPCall;
#include "noncopyable.h"
#include "audio/codecs/audiocodec.h"
#include "audio/samplerateconverter.h"
#include "audio/noisesuppress.h"
......@@ -96,9 +97,7 @@ class AudioRtpRecord {
std::string callId_;
unsigned int dtmfPayloadType_;
private:
/* non copyable */
AudioRtpRecord(const AudioRtpRecord &);
AudioRtpRecord & operator=(const AudioRtpRecord &);
NON_COPYABLE(AudioRtpRecord);
};
......@@ -184,4 +183,4 @@ class AudioRtpRecordHandler {
}
#endif // __AUDIO_RTP_RECORD_HANDLER_H__
#endif // AUDIO_RTP_RECORD_HANDLER_H__
......@@ -39,6 +39,7 @@
#include <cstddef>
#include "audio_rtp_session.h"
#include "noncopyable.h"
using std::ptrdiff_t;
#include <ccrtp/rtp.h>
......@@ -80,9 +81,7 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP
bool running;
private:
AudioRtpThread(const AudioRtpThread &);
AudioRtpThread& operator=(const AudioRtpThread &);
NON_COPYABLE(AudioRtpThread);
AudioSymmetricRtpSession *rtpSession;
};
SpeexEchoCancel echoCanceller;
......
......@@ -32,7 +32,7 @@
#include <cstdio>
#include <celt/celt.h>
#include <stdexcept>
#include "noncopyable.h"
class Celt : public sfl::AudioCodec {
......@@ -89,8 +89,7 @@ class Celt : public sfl::AudioCodec {
celt_decoder_ctl(dec_, CELT_SET_PREDICTION(2));
}
Celt(const Celt&);
Celt& operator= (const Celt&);
NON_COPYABLE(Celt);
~Celt() {
celt_encoder_destroy(enc_);
......
......@@ -31,6 +31,7 @@
#include "audiocodec.h"
#include "noncopyable.h"
#include <cassert>
#include <stdexcept>
......@@ -60,10 +61,6 @@ class Gsm : public sfl::AudioCodec {
throw std::runtime_error("ERROR: encode_gsm_create\n");
}
Gsm(const Gsm&);
Gsm& operator= (const Gsm&);
virtual ~Gsm() {
gsm_destroy(decode_gsmhandle_);
gsm_destroy(encode_gsmhandle_);
......@@ -85,6 +82,7 @@ class Gsm : public sfl::AudioCodec {
}
private:
NON_COPYABLE(Gsm);
gsm decode_gsmhandle_;
gsm encode_gsmhandle_;
};
......
......@@ -31,6 +31,7 @@
#include "global.h"
#include "audiocodec.h"
#include "noncopyable.h"
#include <cstdio>
#include <speex/speex.h>
#include <cassert>
......@@ -89,8 +90,7 @@ class Speex : public sfl::AudioCodec {
speex_decoder_ctl(speex_dec_state_, SPEEX_GET_FRAME_SIZE, &speex_frame_size_);
}
Speex(const Speex&);
Speex& operator= (const Speex&);
NON_COPYABLE(Speex);
~Speex() {
// Destroy the decoder struct
......
......@@ -32,7 +32,8 @@
#define NOISESUPPRESS_H
#include <speex/speex_preprocess.h>
#include "global.h"
#include "global.h" // for SFLDataFormat
#include "noncopyable.h"
class NoiseSuppress {
public:
......@@ -41,8 +42,7 @@ class NoiseSuppress {
void process(SFLDataFormat *data, int samples);
private:
NoiseSuppress(const NoiseSuppress&);
NoiseSuppress& operator=(const NoiseSuppress&);
NON_COPYABLE(NoiseSuppress);
int smplPerFrame_;
SpeexPreprocessState *noiseState_;
......
......@@ -33,6 +33,7 @@
#include <pulse/pulseaudio.h>
#include <string>
#include "noncopyable.h"
/**
* This data structure contains the different king of audio streams available
......@@ -69,12 +70,7 @@ class AudioStream {
bool isReady();
private:
// Copy Constructor
AudioStream(const AudioStream& rh);
// Assignment Operator
AudioStream& operator=(const AudioStream& rh);
NON_COPYABLE(AudioStream);
/**
* Mandatory asynchronous callback on the audio stream state
......
......@@ -29,15 +29,15 @@
* as that of the covered work.
*/
#ifndef _PULSE_LAYER_H
#define _PULSE_LAYER_H
#include "audio/audiolayer.h"
#include <pulse/pulseaudio.h>
#include <pulse/stream.h>
#ifndef PULSE_LAYER_H_
#define PULSE_LAYER_H_
#include <list>
#include <string>
#include <pulse/pulseaudio.h>
#include <pulse/stream.h>
#include "audio/audiolayer.h"
#include "noncopyable.h"
class AudioStream;
......@@ -78,11 +78,7 @@ class PulseLayer : public AudioLayer {
const pa_sink_info *i,
int eol, void *userdata);
// Copy Constructor
PulseLayer(const PulseLayer& rh);
// Assignment Operator
PulseLayer& operator= (const PulseLayer& rh);
NON_COPYABLE(PulseLayer);
/**
* Create the audio streams into the given context
......@@ -126,5 +122,5 @@ class PulseLayer : public AudioLayer {
friend class AudioLayerTest;
};
#endif // _PULSE_LAYER_H_
#endif // PULSE_LAYER_H_
......@@ -22,9 +22,9 @@
#ifndef __RING_BUFFER__
#define __RING_BUFFER__
#include "../call.h"
#include <fstream>
#include "../call.h"
#include "noncopyable.h"
typedef std::map<std::string, int> ReadPointer;
......@@ -133,11 +133,7 @@ class RingBuffer {
void debug();
private:
// Copy Constructor
RingBuffer(const RingBuffer& rh);
// Assignment operator
RingBuffer& operator= (const RingBuffer& rh);
NON_COPYABLE(RingBuffer);
/** Pointer on the last data */
int endPos_;
......
......@@ -32,10 +32,10 @@
#define _SAMPLE_RATE_H
#include <samplerate.h>
#include <math.h>
#include <cmath>
#include "global.h"
#include "noncopyable.h"
class SamplerateConverter {
public:
......@@ -70,11 +70,7 @@ class SamplerateConverter {
private:
// Copy Constructor
SamplerateConverter(const SamplerateConverter& rh);
// Assignment Operator
SamplerateConverter& operator= (const SamplerateConverter& rh);
NON_COPYABLE(SamplerateConverter);
/* temporary buffers */
float * floatBufferIn_;
......
......@@ -69,9 +69,7 @@ class RawFile : public AudioFile {
RawFile(const std::string& name, sfl::AudioCodec* codec, unsigned int sampleRate = 8000);
private:
// noncopyable
RawFile(const RawFile& rh);
RawFile& operator= (const RawFile& rh);
NON_COPYABLE(RawFile);
/** Your preferred codec */
sfl::AudioCodec* audioCodec_;
......
......@@ -37,8 +37,8 @@
#define DTMFGENERATOR_H
#include <stdexcept>
#include <string.h>
#include <string>
#include "noncopyable.h"
#include "tone.h"
#define NUM_TONES 16
......@@ -94,17 +94,9 @@ class DTMFGenerator {
*/
DTMFGenerator(unsigned int sampleRate);
/**
* Destructor
*/
~DTMFGenerator();
// Copy Constructor
DTMFGenerator(const DTMFGenerator& rh);
// Assignment Operator
DTMFGenerator& operator= (const DTMFGenerator& rh);
NON_COPYABLE(DTMFGenerator);
/*
* Get n samples of the signal of code code
......
......@@ -58,10 +58,7 @@ class TelephoneTone {
Tone* getCurrentTone();
private:
// Copy Constructor
TelephoneTone(const TelephoneTone& rh);
// Assignment Operator
TelephoneTone& operator= (const TelephoneTone& rh);
NON_COPYABLE(TelephoneTone);
static COUNTRYID getCountryId(const std::string& countryName);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment