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

* #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);
......
......@@ -29,12 +29,13 @@
* as that of the covered work.
*/
#ifndef __CONF_CONFIG_H__
#define __CONF_CONFIG_H__
#ifndef CONF_CONFIG_H__
#define CONF_CONFIG_H__
#include <map>
#include <string>
#include <list>
#include "noncopyable.h"
/**
* @file config.h
......@@ -81,8 +82,7 @@ class ConfigTreeIterator {
friend class ConfigTree;
ConfigTreeIterator(ConfigTree *configTree) : tree_(configTree), endToken_(), iter_(), iterItem_() {}
ConfigTreeIterator(const Conf::ConfigTreeIterator&);
ConfigTreeIterator& operator= (const Conf::ConfigTreeIterator&);
NON_COPYABLE(ConfigTreeIterator);
ConfigTree* tree_;
TokenList endToken_;
......@@ -171,9 +171,7 @@ class ConfigTree {
friend class ConfigTreeIterator;
// noncopyable
ConfigTree(const ConfigTree &other);
ConfigTree& operator=(const ConfigTree &other);
NON_COPYABLE(ConfigTree);
public:
ConfigTreeIterator createIterator() {
return ConfigTreeIterator(this);
......
......@@ -34,6 +34,7 @@
#include <yaml.h>
#include <stdexcept>
#include <string>
#include "noncopyable.h"
#include "yamlnode.h"
namespace Conf {
......@@ -83,6 +84,7 @@ class YamlEmitter {
private:
NON_COPYABLE(YamlEmitter);
void addMappingItem(int mappingid, std::string key, YamlNode *node);
std::string filename;
......
......@@ -27,8 +27,8 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef _DBUS_CPP_WRAPPER_H_
#define _DBUS_CPP_WRAPPER_H_
#ifndef DBUS_CPP_WRAPPER_H_
#define DBUS_CPP_WRAPPER_H_
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
......@@ -38,4 +38,4 @@
#pragma GCC diagnostic warning "-Wshadow"
#pragma GCC diagnostic warning "-Wunused-parameter"
#endif // _DBUS_CPP_WRAPPER_H_
#endif // DBUS_CPP_WRAPPER_H_
......@@ -32,6 +32,7 @@
#define __DBUSMANAGERIMPL_H__
#include "dbus_cpp.h"
#include "noncopyable.h"
class ConfigurationManager;
class CallManager;
......@@ -54,6 +55,7 @@ class DBusManager {
void exit();
private:
NON_COPYABLE(DBusManager);
CallManager* callManager_;
ConfigurationManager* configurationManager_;
Instance* instanceManager_;
......
......@@ -32,6 +32,7 @@
#define __EVENT_THREAD_H__
#include <cc++/thread.h>
#include "noncopyable.h"
class VoIPLink;
......@@ -51,8 +52,7 @@ class EventThread : public ost::Thread {
virtual void run() ;
private:
EventThread(const EventThread& rh);
EventThread& operator= (const EventThread& rh);
NON_COPYABLE(EventThread);
// VoIPLink is the object being called by getEvents() method
VoIPLink* link_;
......
......@@ -52,6 +52,7 @@
#include "audio/mainbuffer.h"
#include "preferences.h"
#include "noncopyable.h"
namespace sfl {
class InstantMessaging;
......@@ -1195,12 +1196,7 @@ class ManagerImpl {
void registerAccounts();
private:
// Copy Constructor
ManagerImpl(const ManagerImpl& rh);
// Assignment Operator
ManagerImpl& operator= (const ManagerImpl& rh);
NON_COPYABLE(ManagerImpl);
/**
* To handle the persistent history
......
......@@ -28,8 +28,8 @@
* as that of the covered work.
*/
#ifndef NONCOPYABLE_H_
#define NONCOPYABLE_H_
#ifndef NON_COPYABLE_H_
#define NON_COPYABLE_H_
/**
* @file noncopyable.h
......@@ -43,4 +43,4 @@
ClassName(const ClassName&); \
ClassName& operator=(const ClassName&)
#endif // NONCOPYABLE_H_
#endif // NON_COPYABLE_H_
......@@ -45,6 +45,7 @@
#include <stdexcept>
#include "global.h" // for CodecOrder
#include "noncopyable.h"
namespace sfl {
class AudioCodec;
......@@ -354,9 +355,7 @@ class Sdp {
*/
unsigned int telephoneEventPayload_;
// noncopyable
Sdp(const Sdp&);
Sdp& operator=(const Sdp&);
NON_COPYABLE(Sdp);
/*
* Build the sdp media section
......
......@@ -35,14 +35,13 @@
#ifndef SIPACCOUNT_H
#define SIPACCOUNT_H
#include <sstream>
#include <vector>
#include <map>
#include "account.h"
#include "pjsip/sip_transport_tls.h"
#include "pjsip/sip_types.h"
#include "pjsip-ua/sip_regc.h"
#include <vector>
#include <map>
#include "noncopyable.h"
namespace Conf {
class YamlEmitter;
......@@ -413,6 +412,7 @@ class SIPAccount : public Account {
pjsip_transport* transport_;
private:
NON_COPYABLE(SIPAccount);
std::vector< std::map<std::string, std::string > > credentials_;
......@@ -442,10 +442,6 @@ class SIPAccount : public Account {
*/
static std::string getLoginName();
// noncopyable
SIPAccount(const SIPAccount &);
SIPAccount& operator=(const SIPAccount &);
// The pjsip client registration information
pjsip_regc *regc_;
// To check if the account is registered
......
......@@ -34,6 +34,7 @@
#include "call.h"
#include "audio/audiortp/audio_rtp_factory.h"
#include "noncopyable.h"
class pjsip_evsub;
class pj_caching_pool;
......@@ -89,11 +90,7 @@ class SIPCall : public Call {
private:
// Copy Constructor
SIPCall(const SIPCall& rh);
// Assignment Operator
SIPCall& operator= (const SIPCall& rh);
NON_COPYABLE(SIPCall);
/**
* Audio Rtp Session factory
......
......@@ -282,11 +282,7 @@ class SIPVoIPLink : public VoIPLink {
void dtmfSend(SIPCall *call, char code, DtmfType type);
/* Assignment Operator */
SIPVoIPLink& operator= (const SIPVoIPLink& rh);
/* Copy Constructor */
SIPVoIPLink(const SIPVoIPLink& rh);
NON_COPYABLE(SIPVoIPLink);
SIPVoIPLink();
......
Markdown is supported
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