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 * Side Effects Software Inc 00008 * 477 Richmond Street West 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 * 00013 * NAME: UT_OpCaller.h ( UT Library, C++) 00014 * 00015 */ 00016 00017 #ifndef __UT_OpCaller__ 00018 #define __UT_OpCaller__ 00019 00020 #include "UT_API.h" 00021 class UT_OpCallee; 00022 00023 /// General documentation for the UT_OpCaller class. 00024 /// 00025 /// In some cases during the cook of an OP Node, calls will be made into low 00026 /// level libraries. These libraries may have callback mechanisms to reference 00027 /// data from other existing OPs, but without any dependencies on OPs 00028 /// themselves. For example, in resolving the "op:some-op-path" paths, the 00029 /// low level libraries don't actually know about OPs, but rely on callbacks 00030 /// to perform the evaluation. 00031 /// 00032 /// However, the caller OP (the OP cooking) isn't notified of these additional 00033 /// dependencies and so doesn't end up cooking properly. This pair of classes 00034 /// provides a mechanism for implementing the appropriate dependencies. 00035 /// Prior to cooking, the OP can create a UT_Caller class which acts as a sink 00036 /// for all the OP references which get made. At the conclusion of the cook, 00037 /// the OP can then call back to all the classes which made the references 00038 /// (the OP_Callee classes) and notify them that the data they built is no 00039 /// longer required. 00040 /// 00041 /// This class is primarily used by VEX at the current time. 00042 00043 class UT_API UT_OpCaller { 00044 public: 00045 /// This class provides a virtual interface to OP_Nodes so that 00046 /// they can query the op-node which is being evaluated. 00047 UT_OpCaller(); 00048 virtual ~UT_OpCaller(); 00049 00050 /// Callee's might want to find out the unique id of the caller. The / 00051 //getOpId() method should provide the correct id for the cooking OP 00052 virtual int getOpId() = 0; 00053 00054 /// The referenceOtherOp() method is called when a callee magically 00055 /// references another operator. This might happen when referencing a 00056 /// file using the "op:soppath" syntax. 00057 /// At the conclusion of cooking, this cache should be notified that the 00058 /// OP is done with the data. 00059 virtual void referenceOtherOp(int opid, UT_OpCallee *cache) = 0; 00060 }; 00061 00062 class UT_API UT_OpCallee { 00063 public: 00064 /// The UT_OpCallee class is used as a general mechanism to get callbacks 00065 /// when a reference to an OP is no longer needed. 00066 UT_OpCallee(); 00067 virtual ~UT_OpCallee(); 00068 00069 /// This method should be called by the UT_OpCaller when the data is no 00070 /// longer required. 00071 virtual void doneWithOp(int opid) = 0; 00072 }; 00073 00074 #endif 00075
1.5.9