HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TS_KernelList.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: TS_KernelList.h ( TS Library, C++)
7  *
8  * COMMENTS: Kernel definitions for TS library. This class provides a
9  * mechanism to extend the kernel definitions as well as to access
10  * the definitions.
11  *
12  * WARNING: Each kernel must begin with a unique character. This
13  * restriction may be removed in the future. The kernel tokens
14  * are case sensitive.
15  */
16 
17 #ifndef __TS_KernelList__
18 #define __TS_KernelList__
19 
20 #include "TS_API.h"
21 #include <UT/UT_ValArray.h>
22 
23 class TS_MetaKernel;
24 
25 //
26 // This is the file where you should install custom kernel functions. For
27 // example, install this file in $HOME/houdiniX.X/MetaKernels where X.X is your
28 // Houdini major.minor version.
29 // The file should contain the path to the kernel table where your .so/.dll
30 // file is located relative to the search paths in the HOUDINI_DSO_PATH
31 // environment variable. For example:
32 //
33 // # Kernel extension table
34 // TS_MyKernel.so
35 //
36 // In this case, you could install the TS_MyKernel.so file in
37 // $HOME/houdiniX.X/dso. The newMetaKernel() function should look like:
38 // void newMetaKernel()
39 // { TS_KernelList::getList()->addKernel(&myKernel); }
40 //
41 #define TS_KERNEL_TABLE_FILE "MetaKernels"
42 
43 extern "C" {
45 };
46 
48 {
49 public:
50  static TS_KernelList *getList();
51 
52  int getEntries() const { return myKernels.entries(); }
53  TS_MetaKernel *getKernel(int i);
54  TS_MetaKernel *getKernel(const char *token);
55 
56  // Unlike getKernel() findKernel() will return NULL if there's no matching
57  // kernel
58  TS_MetaKernel *findKernel(const char *token);
59 
60  void addKernel(TS_MetaKernel *kernel);
61  void removeKernel(TS_MetaKernel *kernel);
62  void removeKernel(const char *token);
63 private:
64  TS_KernelList();
65 #ifdef LINUX
66  public:
67  ~TS_KernelList();
68  private:
69 #else
70  ~TS_KernelList();
71 #endif
72 
74 };
75 
76 #endif
#define TS_API
Definition: TS_API.h:10
#define SYS_VISIBILITY_EXPORT
int getEntries() const
Definition: TS_KernelList.h:52
SYS_VISIBILITY_EXPORT void newMetaKernel()
Registration function which installs the kernel.
Definition: TS_cosKernel.C:117