00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Luke Moore 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: PRM_Value.h 00015 * 00016 * COMMENTS: 00017 * 00018 */ 00019 00020 #ifndef __PRM_Value_h__ 00021 #define __PRM_Value_h__ 00022 00023 #include "PRM_API.h" 00024 #include <UT/UT_Defines.h> 00025 #include <UT/UT_PtrArray.h> 00026 00027 class PRM_Parm; 00028 class PRM_EventHandler; 00029 00030 typedef void (*PRM_ValueCallback)(void *callee, void *value); 00031 00032 class PRM_API PRM_Value 00033 { 00034 public: 00035 PRM_Value(); 00036 PRM_Value(const PRM_Value &src); 00037 ~PRM_Value(); 00038 00039 void addInterest(void *callee, 00040 PRM_ValueCallback callback); 00041 void removeInterest(void *callee, 00042 PRM_ValueCallback callback); 00043 bool hasInterest(void *callee) const; 00044 00045 00046 void changed(); 00047 00048 void setValue(void *value) { myValue = value; } 00049 PRM_Value &operator=(void *value) 00050 { myValue = value; return *this; } 00051 00052 void *getValue() { return myValue; } 00053 const void *getValue() const { return myValue; } 00054 operator void*() { return myValue; } 00055 operator const void*() const { return myValue; } 00056 00057 int64 getMemUsage(UT_Bool onlythis) const; 00058 00059 private: 00060 void *myValue; 00061 UT_PtrArray<PRM_EventHandler *> myHandlers; 00062 }; 00063 00064 #endif
1.5.9