[logo] Introduction to Tcl-Cpp


[intro] [example] [reference] [details]

Tcl-Cpp is a package for interfacing C++ code to Tcl. I have found Tcl to be an enormously useful interactive shell for experimenting with and debugging C++ code. However, writing the wrappers to convert C++ code functions into tcl-callable functions is sometimes onerous and often highly repetitive; using Tcl-Cpp, all you need to do is write a simple interface description file, and all the messy stuff is handled for you!

Contents for these pages


Introduction

Tcl-Cpp is based on Dean Sheenan's ObjectTcl. Most of its functionality comes from the ObjectTcl core. However, my requirements were sufficiently different from those addressed by ObjectTcl that creating my own version was the best solution.

Specifically, while Dean's wanted all the objects in his system to be properly `owned' by the Tcl part of the application -- thereby avoiding the problem of stale references to objects that had been deleted -- I was prepared to pass the responsibility of resource management on to the user in return for the ability to create Tcl wrappers around object references on-the-fly as they turned up at run-time.

The net effect of this is that while the Tcl equivalents of C++ objects in ObjectTcl are subclasses of the C++ objects (allowing C++ virtual methods to be overridden with Tcl code), in Tcl-Cpp the Tcl objects are separate entities that contain pointers to C++ objects (which allows Tcl to run the specialized virtual functions of objects accessed through base classes).

Tcl-Cpp consists of a stand-alone translator program that converts the interface description file into C++ source files, and a library to link with your Tcl application that provides access to the new commands defined in the interface description.


Features

Tcl-Cpp provides the following advantages over ObjectTcl:

Downloading the source

The latest version should be available in my FTP directory at ICSI. The current version is tclcpp-latest.tar.gz.

Go on to the examples page.


DAn Ellis <dpwe@icsi.berkeley.edu>
International Computer Science Institute, Berkeley CA 94133
$Header: /n/crab/da/dpwe/src/otcl/html/RCS/index.html,v 1.3 1997/03/19 01:39:21 dpwe Exp $