00001 /* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_UTIL_ABSTRACT_C_HANDLE_HXX_ 00009 #define _SK_UTIL_ABSTRACT_C_HANDLE_HXX_ 00010 00011 namespace sk { 00012 namespace util { 00013 template<class T> 00014 class abstract_c_handle 00015 { 00016 public: 00017 abstract_c_handle(T& object); 00018 abstract_c_handle(T* object); 00019 virtual ~abstract_c_handle(); 00020 00021 T& get() const; 00022 00023 private: 00024 abstract_c_handle(const abstract_c_handle<T>& other); 00025 abstract_c_handle& operator = (const abstract_c_handle<T>& other); 00026 00027 const bool _deletable; 00028 T* _object; 00029 }; 00030 } 00031 } 00032 00033 #endif /* _SK_UTIL_ABSTRACT_C_HANDLE_HXX_ */