00001 /* -*- C++ -*- */ 00002 00003 /* COPYRIGHT 00004 * 00005 * This file is part of the Visual Effects Engine - VEE 00006 * 00007 * Read the "VEE-LICENSE" file for the license. 00008 * 00009 * Authors & Copyright: 00010 * 00011 * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 00012 * Janne Kontkanen 2001-2004 00013 * 00014 * Additional copyrights: Tekes 2003-2004 00015 * 00016 * firstname.lastname@hut.fi 00017 * 00018 */ 00019 00020 #ifndef VEE_VALUES_PTR_H 00021 #define VEE_VALUES_PTR_H 00022 00023 #include <vee_clonable_pointer.h> 00024 #include <vee_value.h> 00025 00026 template <typename T> 00027 class VEE_ValuePtr : public VEE_Value 00028 { 00029 public: 00030 VEE_ValuePtr() {} 00031 VEE_ValuePtr(T * ptr) : m_ptr(ptr) {} 00032 00033 virtual VEE_Value * clone() const { return new VEE_ValuePtr(*this); } 00034 00035 T * object() { return m_ptr.ptr(); } 00036 void setObject(T * ptr) { m_ptr = ptr; } 00037 00038 T * fabricate() { return m_ptr.ptr() ? m_ptr.ptr()->clone() : 0; } 00039 00040 protected: 00041 VEE_ClonablePointer<T> m_ptr; 00042 00043 }; 00044 00045 #endif