00001 // -*- C++ -*- 00002 00003 //=========================================================================== 00004 /** 00005 * @file Copy_Disabled.h 00006 * 00007 * $Id: Copy_Disabled.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $ 00008 * 00009 * @author Carlos O'Ryan <coryan@uci.edu> 00010 */ 00011 //=========================================================================== 00012 00013 #ifndef ACE_COPY_DISABLED_H 00014 #define ACE_COPY_DISABLED_H 00015 00016 #include "ace/pre.h" 00017 00018 #include "ace/ACE_export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 /** 00025 * @class ACE_Copy_Disabled 00026 * 00027 * @brief Helper class to disable copy construction and assignment 00028 * 00029 * Classes used to control OS and other resources are not "canonical", 00030 * i.e. they have their copy constructor and assignment operators 00031 * disabled. 00032 * This is often done by making the copy constructor and assignment 00033 * operators private, effectively disallowing copying by clients of 00034 * the class (including derived classes). If the copy constructor and 00035 * assingment operators are left unimplemented then the class itself 00036 * cannot make any copies of its instances, because it would result in 00037 * link errors. 00038 * 00039 * To use this class simply use private inheritance: 00040 * 00041 * class Foo : private ACE_Copy_Disabled 00042 * { 00043 * // code here 00044 * }; 00045 * 00046 */ 00047 class ACE_Export ACE_Copy_Disabled 00048 { 00049 public: 00050 /// Default constructor 00051 ACE_Copy_Disabled (void); 00052 00053 private: 00054 ACE_Copy_Disabled (const ACE_Copy_Disabled &); 00055 ACE_Copy_Disabled &operator= (const ACE_Copy_Disabled &); 00056 }; 00057 00058 #include "ace/post.h" 00059 00060 #endif /* ACE_FUNCTOR_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002