Derived classes of TSnippet follow these conventions:
1) The source of the derived class resides in a file with the same name as the class minus the leading 'T' and with the addition of '.C.'For example, TFooSnippets should have its source in a file called 'FooSnippets.C' under the Examples directory. The default implementation of TSnippet::GetFileName returns this value.
2) Snippets are defined as member functions of TSnippet that take no parameters. Typically they operate as a standalone, but some of the snippets utilize utility functions defined in that subclass of TSnippet. TSnippet itself provides some utility functions, most significantly GetDisplay, which returns a TSnippetDisplay object that snippets use to display text output (similar to ostreams).
3) In the subclass constructor, snippets are 'registered' with the class using the SNIPPETINFO macro. This defines the snippet name and function to call. Snippets appear in the menus using this name.
The snippet browser presents a window and a menu listing all the snippet classes. Each snippet class menu presents a submenu listing all the snippets in that class. When you choose a snippet from this menu, it locates and displays the source code for the snippet, and then runs the snippet, displaying its output.
The snippet browser is a Document framework component. It locates the snippets by looking in a snippet database. This allows the snippet viewer to compile and link without reference to the snippets--you can add or remove snippet classes without recompiling or relinking the viewer. The database resides in the CommonPoint(TM) file, $TaligentRoot/RuntimeEnv/Data/Samples/snippet.db.cp. If the browser cannot find this file, it looks for an ASCII version in the same directory, snippet.db.ascii. The ascii version contains a list of class name/library name pairs, one per line. The browser builds the CommonPoint version of the database from this file, and thereafter use the CommonPoint version.