From 9497c8cb667a3e6ef63177aa0baef9dc2d30f8d4 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 18 Mar 2004 02:07:52 +0000 Subject: [PATCH] added ref/unref and friend dec. support comments git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5763 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 137 ++++++++++++++++++++++++++++++++++++++++++++++++ README | 1 + 2 files changed, 138 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index 0fc9300a5..497ff05bd 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,5 +1,142 @@ Version 1.3.22 (in progress) ================================== +03/16/2004: mmatus + Previously added, but not mentioned before: + + - friend declaration support, swig now emits a global + function in the same class scope. + + - ref/unref features: to mix ref counting C++ classes + and native script ref counting mechanism (like python). + + Use it like: + + %feature("ref") RCObj "$this->ref();" + %feature("unref") RCObj "$this->unref();" + + And the class RCObj, and all the derivated ones, will + perform the rigth ref/unref calls when a new pointer + is returned to the target language, or when the target + language attemps to delete the object. + + See the refcount.i file in the test-suite for more + details. + + +03/16/2004: mmatus + [Python] Using the new %fragment support, major rewrote + of the python swig library, including: + + - Almost automatic template/typemap instantiation for + the STL components. For example, now you can write: + + %template(vector_i) std::vector; + + and a especialized vector_i class is emitted with all + the needed typemaps. No need to use the old + 'specialize_vector' macros. + + Note you can also define + + %template(matrix_i) std::vector >; + %template(vector_pii) std::vector >; + + - The empty template instantiation + + %template() std::vector; + + defines the vector typemaps, but no proxy class. For all the + fundamental types, the empty template instantiation are + defined, so, you can say + + %include std_vector + + int func(const std::vector& a); + + where the proper typemap is applied to 'a', but no + std::vector proxy is generated. + + + - All the STL containers present a more uniform behaviour and + more complete interface declaration. The following are + now supported: + + std::vector + std::list + std::deque + std::set + std::multiset + std::map + std::multimap + + not a container, but also supported: + + std::pair + + also, more typemaps are defined for all of them, + including varin, varout, typecheck, etc. + + - Initial attemp to implement the STL containers + considering allocators, ie: + + std::vector + + it is partially working, but it is just a workaround + while swig improves its template type support. + + + Please test with your particular setup. It seems to be + working with g++ 3.2.2, g++ 2.96, Intel icc and SGI CC + compilers, plus python 1.5.2, 2.0 and 2.3, but since + we are using templates, there is a chance you can find + some problems when using with an old C++ compiler. + +03/16/2004: mmatus + + - Allowing the empty %template directive, such as + + %template() std::vector; + + to process the class "typedef"s and "typemap"s. Before + only the internal "typedef"s were processed. + + This makes possible to emit the default in/out + typemaps without the need of wrapping an especialized + vector instance. + + - Adding the preprocessor extension #@ which mangles the + following macro argument, like in: + + #define macro(X) #@X + macro(int) -> int + macro(std::string) -> std_s_s_string + + - Fragments can now be "type especialized", as the typemaps. The + syntax is as follows + + %fragment("name","header") + { /* a type independent fragment (old syntax) */ } + %fragment("name" {Type}, "header") + { /* the fragment is type dependent */} + + Now fragments can also be used inside templates: + + template + struct A { + %fragment("incode"{A},"header") { + /* 'incode' especialized fragment */ + } + + %typemap(in,fragment="incode"{A}) { + /* + here we use the 'type especialized' + fragment "incode"{A} + */ + } + }; + + + 03/11/2004: cheetah (William Fulton) [Java] Director bug which meant that some virtual functions overridden in diff --git a/README b/README index 7f6200bc4..5873de58c 100644 --- a/README +++ b/README @@ -79,6 +79,7 @@ These improvements include: - Support for C++ overloaded operators. - Support for C++ templates including member templates. - Support for C++ template specialization and partial specialization. + - Support for C++ friend declarations. - Parsing support for almost all C/C++ datatypes. - Automatic translation of C++ exception specifiers. - Contract support.