How do I access objects for which I don't have the string reference when using SWIG TCL wrappers?
Basically in my program some of the objects are predefined even before loading the the TCL shell. If writing the wrappers myself I would pass a pointer to a object which in turn has the pointers to all the objects created thus far. How can I achieve the same behavior through SWIG?
The simplest method would be to add static methods to the class (or some other wrapped class) that return these special instances. SWIG will then wrap the access correctly, and you'll be able to use the static method calling convention to get handles to those instances.
set foo [YourClass_specialFoo] ;# Get the special instance once
$foo bar ... ;# invoke methods on it