1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     util_NonCopyable.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 16675 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifdef __cplusplus
17 
18 #ifndef NN_UTIL_UTIL_NONCOPYABLE_H_
19 #define NN_UTIL_UTIL_NONCOPYABLE_H_
20 
21 namespace nn { namespace util {
22 
23 namespace ADLFireWall {
24 
25 /*!
26     @brief コピー不可能なオブジェクトを生成するためのクラステンプレートです。
27 
28            class A : private nn::util::NonCopyable<A> としてクラスを定義することで、
29 
30            オブジェクトのコピーコンストラクタ、代入のようなコピー操作を抑制できます。
31 */
32 template <typename T>
33 class NonCopyable
34 {
35 protected:
NonCopyable()36     NonCopyable () {}
~NonCopyable()37     ~NonCopyable () {}
38 
39 private:
40     // コピーコンストラクタ、代入演算子を private 化
41     NonCopyable (const NonCopyable &);
42     NonCopyable & operator = (const NonCopyable &);
43 };
44 
45 }
46 
47 using ADLFireWall::NonCopyable;
48 
49 }}
50 
51 
52 #endif /* NN_UTIL_NONCOPYABLE_H_ */
53 
54 #endif // __cplusplus
55