Skip to content

Commit 5315a71

Browse files
committed
Explicitly disabled copy constructor/assignment operator
1 parent fbc8754 commit 5315a71

18 files changed

+22
-0
lines changed

src/rtcpcompoundpacket.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class RTCPPacket;
5252
/** Represents an RTCP compound packet. */
5353
class JRTPLIB_IMPORTEXPORT RTCPCompoundPacket : public RTPMemoryObject
5454
{
55+
JRTPLIB_NO_COPY(RTCPCompoundPacket)
5556
public:
5657
/** Creates an RTCPCompoundPacket instance from the data in \c rawpack, installing a memory manager if specified. */
5758
RTCPCompoundPacket(RTPRawPacket &rawpack, RTPMemoryManager *memmgr = 0);

src/rtcppacket.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class RTCPCompoundPacket;
4949
/** Base class for specific types of RTCP packets. */
5050
class JRTPLIB_IMPORTEXPORT RTCPPacket
5151
{
52+
JRTPLIB_NO_COPY(RTCPPacket)
5253
public:
5354
/** Identifies the specific kind of RTCP packet. */
5455
enum PacketType

src/rtcpsdesinfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ namespace jrtplib
5252
/** The class RTCPSDESInfo is a container for RTCP SDES information. */
5353
class JRTPLIB_IMPORTEXPORT RTCPSDESInfo : public RTPMemoryObject
5454
{
55+
JRTPLIB_NO_COPY(RTCPSDESInfo)
5556
public:
5657
/** Constructs an instance, optionally installing a memory manager. */
5758
RTCPSDESInfo(RTPMemoryManager *mgr = 0) : RTPMemoryObject(mgr) { for (int i = 0 ; i < RTCP_SDES_NUMITEMS_NONPRIVATE ; i++) nonprivateitems[i].SetMemoryManager(mgr); }

src/rtpabortdescriptors.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ namespace jrtplib
6363
*/
6464
class JRTPLIB_IMPORTEXPORT RTPAbortDescriptors
6565
{
66+
JRTPLIB_NO_COPY(RTPAbortDescriptors)
6667
public:
6768
RTPAbortDescriptors();
6869
~RTPAbortDescriptors();

src/rtpconfig.h.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
#define JRTPLIB_IMPORTEXPORT JRTPLIB_IMPORT
5050
#endif // JRTPLIB_COMPILING
5151

52+
#define JRTPLIB_NO_COPY(ClassName) \
53+
private: \
54+
ClassName(const ClassName &); \
55+
ClassName &operator=(const ClassName &);
56+
5257
${RTP_HAVE_SYS_FILIO}
5358

5459
${RTP_HAVE_SYS_SOCKIO}

src/rtpexternaltransmitter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class JRTPLIB_IMPORTEXPORT RTPExternalTransmissionInfo : public RTPTransmissionI
139139
*/
140140
class JRTPLIB_IMPORTEXPORT RTPExternalTransmitter : public RTPTransmitter
141141
{
142+
JRTPLIB_NO_COPY(RTPExternalTransmitter)
142143
public:
143144
RTPExternalTransmitter(RTPMemoryManager *mgr);
144145
~RTPExternalTransmitter();

src/rtphashtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ namespace jrtplib
5252
template<class Element,class GetIndex,int hashsize>
5353
class RTPHashTable : public RTPMemoryObject
5454
{
55+
JRTPLIB_NO_COPY(RTPHashTable)
5556
public:
5657
RTPHashTable(RTPMemoryManager *mgr = 0, int memtype = RTPMEM_TYPE_OTHER);
5758
~RTPHashTable() { Clear(); }

src/rtpkeyhashtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ namespace jrtplib
5252
template<class Key,class Element,class GetIndex,int hashsize>
5353
class RTPKeyHashTable : public RTPMemoryObject
5454
{
55+
JRTPLIB_NO_COPY(RTPKeyHashTable)
5556
public:
5657
RTPKeyHashTable(RTPMemoryManager *mgr = 0,int memtype = RTPMEM_TYPE_OTHER);
5758
~RTPKeyHashTable() { Clear(); }

src/rtppacket.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class RTPRawPacket;
5555
*/
5656
class JRTPLIB_IMPORTEXPORT RTPPacket : public RTPMemoryObject
5757
{
58+
JRTPLIB_NO_COPY(RTPPacket)
5859
public:
5960
/** Creates an RTPPacket instance based upon the data in \c rawpack, optionally installing a memory manager.
6061
* Creates an RTPPacket instance based upon the data in \c rawpack, optionally installing a memory manager.

src/rtppacketbuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class RTPSources;
5656
*/
5757
class JRTPLIB_IMPORTEXPORT RTPPacketBuilder : public RTPMemoryObject
5858
{
59+
JRTPLIB_NO_COPY(RTPPacketBuilder)
5960
public:
6061
/** Constructs an instance which will use \c rtprand for generating random numbers
6162
* (used to initialize the SSRC value and sequence number), optionally installing a memory manager.

0 commit comments

Comments
 (0)