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 * Mark Elendt 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: TS_KernelList.h ( TS Library, C++) 00015 * 00016 * COMMENTS: Kernel definitions for TS library. This class provides a 00017 * mechanism to extend the kernel definitions as well as to access 00018 * the definitions. 00019 * 00020 * WARNING: Each kernel must begin with a unique character. This 00021 * restriction may be removed in the future. The kernel tokens 00022 * are case sensitive. 00023 */ 00024 00025 #ifndef __TS_KernelList__ 00026 #define __TS_KernelList__ 00027 00028 #include "TS_API.h" 00029 #include <UT/UT_PtrArray.h> 00030 00031 class TS_MetaKernel; 00032 00033 // 00034 // This is the file where you should install custom kernel functions. For 00035 // example, install this file in $HOME/houdiniX.X/MetaKernels where X.X is your 00036 // Houdini major.minor version. 00037 // The file should contain the path to the kernel table where your .so/.dll 00038 // file is located relative to the search paths in the HOUDINI_DSO_PATH 00039 // environment variable. For example: 00040 // 00041 // # Kernel extension table 00042 // TS_MyKernel.so 00043 // 00044 // In this case, you could install the TS_MyKernel.so file in 00045 // $HOME/houdiniX.X/dso. The newMetaKernel() function should look like: 00046 // void newMetaKernel() 00047 // { TS_KernelList::getList()->addKernel(&myKernel); } 00048 // 00049 #define TS_KERNEL_TABLE_FILE "MetaKernels" 00050 00051 extern "C" { 00052 DLLEXPORT extern void newMetaKernel(); 00053 }; 00054 00055 class TS_API TS_KernelList { 00056 public: 00057 static TS_KernelList *getList(); 00058 00059 int getEntries() const { return myKernels.entries(); } 00060 TS_MetaKernel *getKernel(int i); 00061 TS_MetaKernel *getKernel(const char *token); 00062 00063 void addKernel(TS_MetaKernel *kernel); 00064 void removeKernel(TS_MetaKernel *kernel); 00065 void removeKernel(const char *token); 00066 private: 00067 TS_KernelList(); 00068 #ifdef LINUX 00069 public: 00070 ~TS_KernelList(); 00071 private: 00072 #else 00073 ~TS_KernelList(); 00074 #endif 00075 00076 UT_PtrArray<TS_MetaKernel *> myKernels; 00077 }; 00078 00079 #endif
1.5.9