Home Complexity Research Tcl/Tk Local interest Alphatk Mac Cpptcl
Thesis Canyons Downloads Bibliographies MacBibTeX Pltk Search

Cpptcl



Cpptcl is a tool to allow simple integration of C++ objects with Tcl (and hence Tk). It includes automatic support for Tcl argument parsing, command completion, container classes, run-time type information, archival of object creations, ... Cpptcl is a pair of loadable Tcl extensions which work fine under Unix and MacOS (and presumably other platforms too).

In order of priority, this is what Cpptcl does:

The primary purpose of Cpptcl is to allow you to write C++ code and classes which smoothly, simply and powerfully link with the Tcl language, and expose as much or little of their interface to Tcl as desired (member functions and data members). Object creation, destruction and manipulation are all supported from Tcl. Also the C++-Tcl interface uses a lot of the powerful features of the C++ language to make your code much more straightforward than if you were to use the standard Tcl C API. Building and manipulation of strings, lists, evaluations,... is all possible using stream based operators, so you can do things like:

	tcl_obj t;
	t << "store this string" << my_var << " which contains a C variable value";
	tcl_obj tt(interp);
	tt << "puts {" << t << "}" << eval;
A secondary goal is to allow you to take existing C++ classes and automatically wrap them inside other 'Tcl-aware' C++ classes so that it appears to the Tcl user as if your original class is integrated with Tcl.

A tertiary goal is to allow you to take either of the above forms of C++ in Tcl object functionality and wrap such an item inside an [incr Tcl] class. This occurs at the Tcl rather than C++ level, although needn't look any different to the user.

Download CppTcl 2.0source code (requires tcl/tk 8.0 or newer).

Complete documentation for the class hierarchy is available on line, which contains some tutorial items. There is also some demonstration code in the Cpptcl package, which also has good documentation on-line. As of version 1.30, Cpptcl fully supports Tcl8.0, making complete use of the internal 'Tcl_Obj' representation, so all C++-Tcl communication using Cpptcl is significantly faster. Cpptcl is known to work fine under Solaris, MacOS and Windows operating systems.

You can also look at a list of recent changes, in case you're thinking of upgrading to a newer version of Cpptcl. There is also some older, more general documentation about the entire EvoX system on line.

If you want to look at some more code examples of how to use Cpptcl, just download the EvoX simulation system.


EvoX



EvoX is a cool tool for the simulation of complex systems. It's an object based, C++ class system with various analysis tools included. EvoX has a Tcl/Tk interface, large parts of which use the `[incr tcl]' extension for object oriented capabilities. This provides a largely parallel class hierarchy embodying the interface-relevant parts of a given model world. EvoX is very simply extensible and specialisable both in terms of creating new C++ objects for a user's simulations and in terms of extending the interface if desired (although this is not normally necessary). Lastly EvoX uses a distributed programming paradigm so that simulations running locally or remotely may be examined, adjusted and analysed using a single interface. EvoX is built upon Cpptcl

You can have a look at the interface general documentation, or more detailed programmer's documentation and class hierarchy.

Download EvoX 1.1 source code.

Powered by Itcl

EvoX is a triplet of loadable Tcl extensions which work fine under Unix and MacOS (and presumably other platforms too).


Mail me:vince@santafe.edu, or go back to top, or return to the main menu.