VAUncopyable.h 1.24 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1
/*
2
 *  --------------------------------------------------------------------------------------------
Jonas Stienen's avatar
Jonas Stienen committed
3
 *
4
5
6
7
8
9
 *    VVV        VVV A           Virtual Acoustics (VA) | http://www.virtualacoustics.org
 *     VVV      VVV AAA          Licensed under the Apache License, Version 2.0
 *      VVV    VVV   AAA
 *       VVV  VVV     AAA        Copyright 2015-2017
 *        VVVVVV       AAA       Institute of Technical Acoustics (ITA)
 *         VVVV         AAA      RWTH Aachen University
Jonas Stienen's avatar
Jonas Stienen committed
10
 *
11
 *  --------------------------------------------------------------------------------------------
Jonas Stienen's avatar
Jonas Stienen committed
12
 */
13
14
15

#ifndef IW_VACORE_UNCOPYABLE
#define IW_VACORE_UNCOPYABLE
Jonas Stienen's avatar
Jonas Stienen committed
16
17
18
19
20
21
22
23
24

#include <VACoreDefinitions.h>

// Idea: Scott Meyers

//! Functionality to suppress copying an object
/**
  * Derive your class from VAUncopyable to block any copy instruction.
  */
25
26
class VACORE_API IVAUncopyable
{
Jonas Stienen's avatar
Jonas Stienen committed
27
28
protected:
	//! For subclasses: standard constructor available
29
	inline IVAUncopyable() {};
Jonas Stienen's avatar
Jonas Stienen committed
30
31

	//! For subclasses: destructor available
32
	inline virtual ~IVAUncopyable() {};
Jonas Stienen's avatar
Jonas Stienen committed
33
34
35

private:
	//! Forbidden for everyone: copy constructor
36
	inline IVAUncopyable( const IVAUncopyable& ) {};
Jonas Stienen's avatar
Jonas Stienen committed
37
38

	//! Forbidden for everyone: assignment operator
39
	IVAUncopyable& operator=( const IVAUncopyable& );
Jonas Stienen's avatar
Jonas Stienen committed
40
41
};

42
#endif // IW_VACORE_UNCOPYABLE