From: <baz...@us...> - 2008-02-23 22:55:39
|
Revision: 8090 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8090&view=rev Author: bazaarmagetron Date: 2008-02-23 14:55:36 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Manuel Moos: more on argument conversion. Modified Paths: -------------- clio/trunk/clio/doc/argument_conversion.t2t.in clio/trunk/clio/doc/main.t2t.in Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-23 22:13:52.453000069 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-23 23:51:32.714999914 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - doc/argument_conversion.t2t.in argument_conversion.-20080223211340-si5o2t2dx2vhsmwd-1 doc/classes_template.t2t.in classes_template.t2t-20080223211340-si5o2t2dx2vhsmwd-2 + Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 Modified: clio/trunk/clio/doc/argument_conversion.t2t.in =================================================================== --- clio/trunk/clio/doc/argument_conversion.t2t.in 2008-02-23 21:20:00 UTC (rev 8089) +++ clio/trunk/clio/doc/argument_conversion.t2t.in 2008-02-23 22:55:36 UTC (rev 8090) @@ -70,6 +70,8 @@ >>> BigNum with( proxy1 get ) ``` +Functions wrapped by clio will do this unboxing automatically. + Proxies are chained to the object they come from. This means that as long as a proxy is alive, the garbage collector will not collect the object it is contained in. If the object is destroyed anyway (from C++, presumably), the proxy breaks and all accesses to it fail. Proxies break easily if clio @@ -99,6 +101,53 @@ TO BE CONTINUED +=== STL containers === +Are not fully implemented yet. std::vector works if you include ``"clio/std_container.hpp"``. std::vectors will +look like Io Lists with a reduced command set. +=== Objects of other classes === + +Objects passed from C++ to Io by value are cloned for Io. Objects passed from C++ to Io via reference or pointer are wrapped +as if they were created in Io, but marked as owned by C++ so they don't get deleted from Io. Before they are wrapped, clio tries +to determine the most derived class known to clio. + +If C++ expects to receive an object by reference, clio will analyze the passed in io object whether it is of the required type. +The lookup happens according to Io's rules, which can be summarized as "depth first, first base first". If the passed in class +is not of the required type, its first base class is checked, then that class's first base class, and so on, and only when nothing +is found there, the second bases are looked at. It has to be noted that this is different from C++ lookup, where any +disambiguities in the search would cause an error. This is for consistency with member function lookup, allow a quick +excursion. Assume the following classes, forming the dreaded Diamond of Death: +``` +class Base +{ +public: + virtual ~Base(); + void f(); + static void g( Base & ); +}; + +class A: public Base{}; +class B: public Base{}; +class Derived: public A, public B{}; +``` +properly wrapped with clio. In ``Derived``, there exist two copies of ``Base``, and when you try to call either the regular member function +``f`` or the static function ``g`` on an object of visible class ``Derived`` in C++, you get an error. +In Io, however, +``` +Derived clone f +``` +will call the function ``f()`` on the first of the two copies of ``Base``, because that's the way proto lookups work in Io. Therefore, for consistency, +``` +Base g( Derived clone ) +``` +also needs to call g(), passing it the first of the two ``Base`` copies. + +If C++ expects an object of a class by value, the same thing happens, only that the object is copied (and possibly sliced, of course) +before it is passed to C++. + +A small note on const correctness here: it's nonexistent. Clio does not care whether the object in C++ is const or not. +It seems to be a general consensus among script wrapper generator writers that it is not worth the effort. If you require +const correctness, don't wrap your classes directly, wrap them in [Custom Proxies proxies.html]. + @navbar@ Modified: clio/trunk/clio/doc/main.t2t.in =================================================================== --- clio/trunk/clio/doc/main.t2t.in 2008-02-23 21:20:00 UTC (rev 8089) +++ clio/trunk/clio/doc/main.t2t.in 2008-02-23 22:55:36 UTC (rev 8090) @@ -45,6 +45,8 @@ [Namespaces and Nesting namespaces.html]: how C++ namespaces and nested classes are handled +[Custom Proxies proxies.html]: for hard to wrap classes, you can handle them by proxy + [Lifetime Management lifetime.html]: how you make it so that your objects stay alive as long as C++ and Io are still interested in them [Project Layout project.html]: How to best organize your source files. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-23 23:49:34
|
Revision: 8091 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8091&view=rev Author: bazaarmagetron Date: 2008-02-23 15:49:38 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Manuel Moos: Resolved oddity by manually instantiating PrimitiveProxy< std::string >/ Modified Paths: -------------- clio/trunk/clio/clio/dataconversion_extended.cpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/tests/basic.test/output.txt clio/trunk/clio/tests/basic.test/test.cpp clio/trunk/clio/tests/runtest.sh Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-23 23:51:32.714999914 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 00:45:41.637000084 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-23 22:55:36 UTC (rev 8090) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-23 23:49:38 UTC (rev 8091) @@ -120,4 +120,6 @@ CLIO_CREATE_PRIMITIVE( double, "Double" ); CLIO_CREATE_PRIMITIVE( float, "Float" ); +CLIO_CREATE_PRIMITIVE( std::string, "String" ); + // CLIO_INSTANTIATE_TEMPLATE(clio::PrimitiveProxy,(1,(int)),"Int" ); Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-23 22:55:36 UTC (rev 8090) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-23 23:49:38 UTC (rev 8091) @@ -161,7 +161,7 @@ { } - PRIMITIVE const & GetTarget() const + PRIMITIVE & GetTarget() const { if ( !data_ ) { @@ -287,9 +287,12 @@ } +#define CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME ) \ +CLIO_CLASSNAME_EX( clio::dataconversion::PrimitiveProxy<const INT>, "Const" NAME, clio::IClassInfo::Name_IoRaw ); \ +CLIO_CLASSNAME_EX( clio::dataconversion::PrimitiveProxy<INT>, NAME, clio::IClassInfo::Name_IoRaw ) + #define CLIO_INSTANTIATE_PRIMITIVE( INT, NAME ) \ -CLIO_CLASSNAME_EX( clio::dataconversion::PrimitiveProxy<const INT>, "Clio Const" NAME, clio::IClassInfo::Name_IoComplete ); \ -CLIO_CLASSNAME_EX( clio::dataconversion::PrimitiveProxy<INT>, "Clio " NAME, clio::IClassInfo::Name_IoComplete ); \ +CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME ); \ CLIO_IO_COMPLETE_CLASSNAME( INT, "Clio " NAME ) #define CLIO_INSTANTIATE_PRIMITIVE_INT( INT, NAME ) \ @@ -301,6 +304,7 @@ CLIO_INSTANTIATE_PRIMITIVE_INT( short int, "ShortInt" ); CLIO_INSTANTIATE_PRIMITIVE_INT( char, "Char" ); +CLIO_INSTANTIATE_PRIMITIVE_PROXY( std::string, "Strng" ); CLIO_INSTANTIATE_PRIMITIVE( double, "Double" ); CLIO_INSTANTIATE_PRIMITIVE( float, "Float" ); Modified: clio/trunk/clio/tests/basic.test/output.txt =================================================================== --- clio/trunk/clio/tests/basic.test/output.txt 2008-02-23 22:55:36 UTC (rev 8090) +++ clio/trunk/clio/tests/basic.test/output.txt 2008-02-23 23:49:38 UTC (rev 8091) @@ -33,6 +33,13 @@ false <<<< writeln( testObject convert("har") ) har +<<<< s := Clio String with( "har") +<<<< writeln( s ) +har +<<<< writeln( testObject convert2( s ) ) +harhar +<<<< writeln( s ) +harhar <<<< writeln( testObject ptr( testObject ) ) Test TestWrapper_0xHEXCODE: Modified: clio/trunk/clio/tests/basic.test/test.cpp =================================================================== --- clio/trunk/clio/tests/basic.test/test.cpp 2008-02-23 22:55:36 UTC (rev 8090) +++ clio/trunk/clio/tests/basic.test/test.cpp 2008-02-23 23:49:38 UTC (rev 8091) @@ -149,10 +149,10 @@ TestString( state, "writeln( testObject nop(\"har\") )" ); TestString( state, "writeln( testObject convert(\"har\") )" ); - TestString( state, "s := Clio Ref With( Clio Int ) with(1)" ); - TestString( state, "s := Clio Ref With( Sequence ) clone set( \"har\")" ); + TestString( state, "s := Clio String with( \"har\")" ); TestString( state, "writeln( s )" ); TestString( state, "writeln( testObject convert2( s ) )" ); + TestString( state, "writeln( s )" ); TestString( state, "writeln( testObject ptr( testObject ) )" ); Modified: clio/trunk/clio/tests/runtest.sh =================================================================== --- clio/trunk/clio/tests/runtest.sh 2008-02-23 22:55:36 UTC (rev 8090) +++ clio/trunk/clio/tests/runtest.sh 2008-02-23 23:49:38 UTC (rev 8091) @@ -27,6 +27,7 @@ rm -f $*.failed; else echo Failed! + cp ${processed} failed_output.txt ret=1 fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-23 23:58:32
|
Revision: 8092 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8092&view=rev Author: bazaarmagetron Date: 2008-02-23 15:58:32 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Manuel Moos: Refactored string docu into primitive docu. Modified Paths: -------------- clio/trunk/clio/doc/argument_conversion.t2t.in Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 00:45:41.637000084 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 00:52:31.595999956 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n Modified: clio/trunk/clio/doc/argument_conversion.t2t.in =================================================================== --- clio/trunk/clio/doc/argument_conversion.t2t.in 2008-02-23 23:49:38 UTC (rev 8091) +++ clio/trunk/clio/doc/argument_conversion.t2t.in 2008-02-23 23:58:32 UTC (rev 8092) @@ -21,6 +21,11 @@ works even if the enum type is not registered with clio, but then you won't be able to use the object meaningfulyl in Io, you'll only be able to pass it around and have it transformed back to C++ unharmed. On conversion from Io to C++, only enum objects of the correct type are accepted. +- stringy things (std::string, char const *). Are converted as Io Sequences. Care has to be taken when + converting to ``char *`` (no ``const``) from Io; the C++-function will get a pointer to a mutable + buffer. That's not much use, however, since you won't be able to change the lenght of the buffer, so all + changes to the buffer you do make will be lost to Io. Use ``std::string &`` arguments if you want + your modifications to make it back to Io. References and pointers to primitives are converted over primitive proxies. If a reference to a primitive @@ -92,15 +97,6 @@ Don't worry about getting the type right. The error message the function gives you when you pass in a wrong type will tell you what was expected. -=== Strings === - -From C++ to Io, all things looking stringy (``std::string (const &/*)``, ``const char *``, ``char *``) are converted -to ``Sequence`` objects. - -Conversion to C++ is a bit more complicated. If conversion to C++ expects a std::string - -TO BE CONTINUED - === STL containers === Are not fully implemented yet. std::vector works if you include ``"clio/std_container.hpp"``. std::vectors will This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-24 00:18:38
|
Revision: 8093 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8093&view=rev Author: bazaarmagetron Date: 2008-02-23 16:18:43 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Manuel Moos: Put temporary value onto the retain stack so it is not lost. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion_extended.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 00:52:31.595999956 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 01:14:25.210000038 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-23 23:58:32 UTC (rev 8092) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-24 00:18:43 UTC (rev 8093) @@ -379,8 +379,11 @@ p->Detach(); // make the object know to and owned by Io so it gets deleted later - ClassInfo::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); + IoObject * object = ClassInfo::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); + // but not before we leave here + IoState_stackRetain_( IoObject_state(from), object ); + // return a refernece to the held data return &p->GetTarget(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:39:46
|
Revision: 8096 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8096&view=rev Author: bazaarmagetron Date: 2008-02-24 16:39:44 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Repaired enum references. Modified Paths: -------------- clio/trunk/clio/clio/Makefile.am clio/trunk/clio/clio/argumentquality.hpp clio/trunk/clio/clio/clio.hpp clio/trunk/clio/clio/dataconversion.cpp clio/trunk/clio/clio/dataconversion_extended.cpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/enum.hpp clio/trunk/clio/clio/helptest.hpp clio/trunk/clio/clio/macros.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/clio/std_container.hpp clio/trunk/clio/clio/typetraits.hpp Added Paths: ----------- clio/trunk/clio/clio/primitiveproxy.cpp clio/trunk/clio/clio/primitiveproxy.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 01:14:25.210000038 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 17:14:54.890000105 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - + clio/primitiveproxy.hpp primitiveproxy.hpp-20080224161453-yaim302iihdd19qa-2 clio/primitiveproxy.cpp primitiveproxy.cpp-20080224161453-yaim302iihdd19qa-1 Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w Modified: clio/trunk/clio/clio/Makefile.am =================================================================== --- clio/trunk/clio/clio/Makefile.am 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/Makefile.am 2008-02-25 00:39:44 UTC (rev 8096) @@ -27,6 +27,7 @@ nocopy.cpp\ objectwrapperaware.cpp\ objectwrapper.cpp\ +primitiveproxy.cpp\ property.cpp\ proxy.cpp\ security.cpp\ @@ -81,6 +82,7 @@ objectwrapperaware.hpp\ objectwrapper.hpp\ property.hpp\ +primitiveproxy.hpp\ proxy.hpp\ security.hpp\ state.hpp\ Modified: clio/trunk/clio/clio/argumentquality.hpp =================================================================== --- clio/trunk/clio/clio/argumentquality.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/argumentquality.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -66,6 +66,8 @@ Quality_Perfect = 0, // all arguments are perfect fits Quality_Upcast, // a C++ argument is given of a derived class of the expected class Quality_Conversion, // conversion is required + Quality_Box, // required boxing in a wrapper + Quality_Void, // conversion to void * or IoObject * required Quality_NoMatch, // can't match Quality_Max }; Modified: clio/trunk/clio/clio/clio.hpp =================================================================== --- clio/trunk/clio/clio/clio.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/clio.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -2,5 +2,6 @@ #define CLIO_CLIO_H #include "macros.hpp" +#include "dataconversion_extended.hpp" #endif Modified: clio/trunk/clio/clio/dataconversion.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion.cpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/dataconversion.cpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -1,6 +1,6 @@ #include "dataconversion.hpp" +#include "dataconversion_extended.hpp" - #include <sstream> namespace clio Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -106,7 +106,7 @@ } #define CLIO_CREATE_PRIMITIVE( INT, NAME ) \ -CLIO_INSTANTIATE_TEMPLATE(clio::PrimitiveProxy,(1,(INT)), NAME ) +CLIO_INSTANTIATE_TEMPLATE(clio::PrimitiveWrapper,(1,(INT)), NAME ) #define CLIO_CREATE_PRIMITIVE_INT( INT, NAME ) \ CLIO_CREATE_PRIMITIVE( INT, NAME ); \ Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -132,6 +132,7 @@ #include "objectwrapperaware.hpp" #include "codeinjection.hpp" #include "ichained.hpp" +#include "primitiveproxy.hpp" // now comes the really fancy stuff. Here, we can already use clio's full wrapping power to // use C++ wrapper types as the objects converted to Io. @@ -141,6 +142,8 @@ namespace dataconversion { + +#if 0 // For example this little beast: it wraps const references to primitives // (and other objects) so the receiver on the Io side can get them. // This is really just for primitives. Anything that may cause memory allocation @@ -274,25 +277,27 @@ }; extern char const * primitveProxyCode; +#endif } -struct PrimitiveProxyNoMaster{}; +// struct PrimitiveProxyNoMaster{}; // let primitives be handled by their wrapper for template arguments template< class T > struct clioPrivate_classToTypeBase< T, true > { - typedef dataconversion::PrimitiveProxy<T> Type; + typedef typename PrimitiveWrapper<T>::GETTER Type; }; } #define CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME ) \ -CLIO_CLASSNAME_EX( clio::dataconversion::PrimitiveProxy<const INT>, "Const" NAME, clio::IClassInfo::Name_IoRaw ); \ -CLIO_CLASSNAME_EX( clio::dataconversion::PrimitiveProxy<INT>, NAME, clio::IClassInfo::Name_IoRaw ) +CLIO_CLASSNAME_EX( clio::PrimitiveWrapper<const INT>, "Const" NAME, clio::IClassInfo::Name_IoRaw ); \ +CLIO_CLASSNAME_EX( clio::PrimitiveWrapper<INT>, NAME, clio::IClassInfo::Name_IoRaw ) #define CLIO_INSTANTIATE_PRIMITIVE( INT, NAME ) \ -CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME ); \ +CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME );\ +CLIO_CONVERTAS_PROXY_REF( INT, PrimitiveProxy );\ CLIO_IO_COMPLETE_CLASSNAME( INT, "Clio " NAME ) #define CLIO_INSTANTIATE_PRIMITIVE_INT( INT, NAME ) \ @@ -302,7 +307,8 @@ CLIO_INSTANTIATE_PRIMITIVE_INT( long int, "LongInt" ); CLIO_INSTANTIATE_PRIMITIVE_INT( int, "Int" ); CLIO_INSTANTIATE_PRIMITIVE_INT( short int, "ShortInt" ); -CLIO_INSTANTIATE_PRIMITIVE_INT( char, "Char" ); +CLIO_INSTANTIATE_PRIMITIVE_PROXY( char, "Char" ); +CLIO_INSTANTIATE_PRIMITIVE_PROXY( unsigned char, "UnsignedChar" ); CLIO_INSTANTIATE_PRIMITIVE_PROXY( std::string, "Strng" ); CLIO_INSTANTIATE_PRIMITIVE( double, "Double" ); @@ -310,6 +316,7 @@ #undef CLIO_INSTANTIATE_PRIMITIVE +#if 0 CLIO_TEMPLATE_CLASS_EX( clio::dataconversion::PrimitiveProxyConstBase, (1,(class)), "ConstRef" ) { CLIO_CLASS_NAMESPACE( "clio" ); @@ -338,6 +345,7 @@ } CLIO_TEMPLATE_CLASS_NOMASTER( clio::dataconversion::PrimitiveProxy, (1,(class)), clio::PrimitiveProxyNoMaster ); +#endif namespace clio { @@ -348,7 +356,8 @@ // a primitiveProxy for that class is returned. template< class T > struct DataConverterPointerImplementationBase< T, false > { - typedef PrimitiveProxy< T > Proxy; + typedef PrimitiveWrapper< T > Wrapper; + typedef typename Wrapper::GETTER Proxy; typedef ClassInfo< Proxy > ClassInfo; typedef T * Converted; @@ -362,7 +371,7 @@ Proxy * proxy = DataConverterPointerImplementationBase< Proxy, true >::FromIo( from, call, thrower ); if ( !proxy ) thrower.Throw( "Only prototype found, but instance expected"); - return &proxy->GetTarget(); + return &proxy->Get(); } catch( ... ) { @@ -371,12 +380,18 @@ // convert the object as a regular value T value( DataConverterManager<T>::FromIo( from, call, thrower ) ); - // note that slight conversion was required (don't lower the quality class, though) - call.quality.conversionSteps++; + // note that boxing was required + if ( call.quality.quality < ArgumentQuality::Quality_Box ) + { + call.quality.quality = ArgumentQuality::Quality_Box; + } + else + { + call.quality.conversionSteps++; + } // create new proxy object holding a copy of the value - Proxy * p = new Proxy( & value ); - p->Detach(); + Proxy * p = new Wrapper( & value ); // make the object know to and owned by Io so it gets deleted later IoObject * object = ClassInfo::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); @@ -385,7 +400,7 @@ IoState_stackRetain_( IoObject_state(from), object ); // return a refernece to the held data - return &p->GetTarget(); + return &p->Get(); } catch( ... ){} @@ -396,7 +411,7 @@ static IoObject * ToIo( IoState * state, T * from, DataConversionCall const & call ) { - return ClassInfo::Get().FetchIoObject( new Proxy( from ), state, ObjectWrapper::OwnedByIo ); + return ClassInfo::Get().FetchIoObject( new Wrapper( from ), state, ObjectWrapper::OwnedByIo ); } }; Modified: clio/trunk/clio/clio/enum.hpp =================================================================== --- clio/trunk/clio/clio/enum.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/enum.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -2,6 +2,8 @@ #define CLIO_ENUM_H #include "macros.hpp" +#include "dataconversion_extended.hpp" +#include "primitiveproxy.hpp" namespace clio { @@ -88,16 +90,29 @@ // used for primitives which wraps the real enum object in something that has // a "set" method where you can change the value. That is not available as a regular // class method. - typedef dataconversion::DataConverterPointerImplementationBase< E, false > PointerImplementation; - typedef dataconversion::DataConverterReference< E &, PointerImplementation > ReferenceConverter; - typedef dataconversion::DataConverterPointer< E *, PointerImplementation > PointerConverter; + //typedef dataconversion::DataConverterPointerImplementationBase< E, false > PointerImplementation; + //typedef dataconversion::DataConverterReference< E &, PointerImplementation > ReferenceConverter; + //typedef dataconversion::DataConverterPointer< E *, PointerImplementation > PointerConverter; + + //typedef dataconversion::DataConverterReference< E &, PointerImplementation > ReferenceConverter; + //typedef dataconversion::DataConverterPointer< E *, PointerImplementation > PointerConverter; + + typedef dataconversion::DataConverterProxy< E &, PrimitiveProxy< Proxy< E > > > ReferenceConverter; + typedef dataconversion::DataConverterProxy< E *, PrimitiveProxy< Proxy< E > > > PointerConverter; + dataconversion::DataConverterOverrider< E &, ReferenceConverter >::Register(); dataconversion::DataConverterOverrider< E *, PointerConverter >::Register(); + + // instantiate reference wrapper + clio::ClassInfo< PrimitiveWrapper< CLASS > >::Get(); } }; } +// CLIO_CONVERTAS_PROXY_REF( ENUM, PrimitiveProxy ); + + // macro to define an enum. Works just like CLIO_CLASS*, all macros legal there // also work in here. #define CLIO_ENUM_EX( ENUM, USERNAME ) \ Modified: clio/trunk/clio/clio/helptest.hpp =================================================================== --- clio/trunk/clio/clio/helptest.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/helptest.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -1,7 +1,7 @@ #include <iostream> #include <fstream> -#include "macros.hpp" +#include "clio.hpp" #include "state.hpp" #include "gcpointer.hpp" Modified: clio/trunk/clio/clio/macros.hpp =================================================================== --- clio/trunk/clio/clio/macros.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/macros.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -493,6 +493,4 @@ #define CLIO_EXTEND_PROTECTED(FUNCTION) CLIO_EXTEND_PROTECTED_EX(FUNCTION,,"") #define CLIO_OVERRIDE_PRIVATE(FUNCTION,DISAMBIGUATION) CLIO_OVERRIDE_PRIVATE_EX(FUNCTION,DISAMBIGUATION,"") -#include "dataconversion_extended.hpp" - #endif Added: clio/trunk/clio/clio/primitiveproxy.cpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.cpp (rev 0) +++ clio/trunk/clio/clio/primitiveproxy.cpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -0,0 +1,19 @@ +#include "primitiveproxy.hpp" + +namespace clio +{ + +char const * primitiveProxyCode = +"print := method( get print )\n" +"== := method( other, get ==(other) )\n" +"asString := method( get asString )\n" +"asSimpleString := method( get asSimpleString )\n" +"hasSlot := method( s, get hasSlot(s) )\n" +"forward := method( return get doMessage(call message) ) \n" +; + +// specialize default constructor for strings +template<> PrimitiveWrapper< std::string >::PrimitiveWrapper(){} + +} + Added: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp (rev 0) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -0,0 +1,160 @@ +#ifndef CLIO_PRIMITIVEPROXY_H +#define CLIO_PRIMITIVEPROXY_H + +#include "proxy.hpp" + +namespace clio +{ + +template< class PRIMITIVE > class PrimitiveWrapper; + +// proxy for primitives, const version +template < class BASE > class ConstPrimitiveProxy: public BASE +{ +public: + typedef typename BASE::ORIGINAL Primitive; + + explicit ConstPrimitiveProxy( Primitive & primitive ) + : BASE( primitive ) + {} + + explicit ConstPrimitiveProxy( Primitive * primitive ) + : BASE( primitive ) + {} + + ConstPrimitiveProxy() + {} + + typedef PrimitiveWrapper<Primitive> WRAPPER; + + // clones the object as a wrapper + WRAPPER * clone() const; + + // gets the primitive + Primitive get() const + { + return this->Get(); + } +}; + +// proxy for primitives, non-const version +template< class BASE > class PrimitiveProxy: public ConstPrimitiveProxy< BASE > +{ +public: + typedef typename BASE::ORIGINAL Primitive; + + explicit PrimitiveProxy( Primitive & primitive ) + : ConstPrimitiveProxy< BASE >( primitive ) + {} + + explicit PrimitiveProxy( Primitive * primitive ) + : ConstPrimitiveProxy< BASE >( primitive ) + {} + + PrimitiveProxy() + {} + + void set( Primitive primitive ) + { + this->Get() = primitive; + } +}; + +// select the correct base wrapper +template< class T > +struct PrimitiveProxySelect +{ + typedef PrimitiveProxy< Wrapper< T > > Proxy; +}; + +template< class T > +struct PrimitiveProxySelect< const T > +{ + typedef ConstPrimitiveProxy< Wrapper< const T > > Proxy; +}; + +// wrapper for primitives +template< class T > class PrimitiveWrapper: public PrimitiveProxy< Wrapper< typename TestConst< T >::NoConst > > +{ +public: + typedef PrimitiveProxy< Wrapper< typename TestConst< T >::NoConst > > BASE; + + typedef typename BASE::Primitive Primitive; + + PrimitiveWrapper( PrimitiveWrapper const & other ) + { + this->Get() = other.Get(); + } + + explicit PrimitiveWrapper( Primitive const & primitive ) + { + this->Get() = primitive; + } + + explicit PrimitiveWrapper( Primitive const * primitive ) + { + if ( !primitive ) + { + throw Exception( "Expected primitive, got nil" ); + } + this->Get() = *primitive; + } + + PrimitiveWrapper() + { + // primitives should be initialized to 0 + this->Get() = static_cast< T >( 0 ); + } +}; + +// specialize default constructor for strings +template<> PrimitiveWrapper< std::string >::PrimitiveWrapper(); + +template< class BASE > +typename ConstPrimitiveProxy<BASE>::WRAPPER * ConstPrimitiveProxy<BASE>::clone() const +{ + return new WRAPPER( this->Get() ); +} + +struct PrimitiveProxyNoMaster{}; +extern char const * primitiveProxyCode; + +} + +#include "macros.hpp" + +CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::ConstPrimitiveProxy, (1,(class)), false ); + +CLIO_TEMPLATE_CLASS( clio::ConstPrimitiveProxy, (1,(class))) +{ + CLIO_CLASS_BASE( T1 ); + + CLIO_METHOD( get ).NonBreaking(); + CLIO_METHOD( clone ).TransferOwnership(); + + CLIO_INJECTCODE( clio::primitiveProxyCode ); +} + +CLIO_TEMPLATE_CLASS( clio::PrimitiveProxy, (1,(class))) +{ + CLIO_CLASS_BASE( clio::ConstPrimitiveProxy<T1> ); + + CLIO_METHOD( set ); + + CLIO_INJECTCODE( clio::primitiveProxyCode ); +} + +CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::PrimitiveWrapper, (1,(class)), true ); +CLIO_TEMPLATE_CLASS_EX( clio::PrimitiveWrapper, (1,(class)), "Ref" ) +{ + typedef typename CLASS::BASE BASE; + CLIO_CLASS_BASE( BASE ); + CLIO_CONSTRUCTOR_CUSTOM( (1,(T1)) ); + + CLIO_INJECTCODE( clio::primitiveProxyCode ); +} + +CLIO_TEMPLATE_CLASS_NOMASTER( clio::PrimitiveWrapper, (1,(class)), clio::PrimitiveProxyNoMaster ); + +#endif + Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -6,6 +6,7 @@ #include "dataconversion.hpp" #include <sstream> +#include <iostream> namespace clio { @@ -17,6 +18,7 @@ public: typedef T ORIGINAL; typedef WrapperBaseConst GETTER; + typedef ORIGINAL & GETRESULT; typedef WrapperBaseConst< const T > BASE; // returns the original object @@ -35,6 +37,7 @@ { public: typedef T ORIGINAL; + typedef ORIGINAL const & GETRESULT; typedef WrapperBaseConst GETTER; typedef IChained BASE; @@ -72,7 +75,7 @@ virtual ORIGINAL & DoGet() = 0; }; -// Proxy objects. ORIGINAL should be the raw type of the wrapped object, the +// Proxy objects. ORIGINAL should be the raw type of the wrapped object. template< class ORIGINAL > class Proxy: public WrapperBase< ORIGINAL > { @@ -221,22 +224,85 @@ template< class ORIGINAL, class PROXY > class DataConverterProxy: public DataConverterDefs< ORIGINAL > { public: - typedef typename PROXY::GETTER GETTER; + typedef typename PROXY::GETTER GETTER; // what we expect from Io + typedef typename GETTER::ORIGINAL ORIGINAL_BASE; // the raw base type + typedef typename GETTER::GETRESULT GETRESULT; // return type of GETTER::Get() typedef DataConverterDefs< ORIGINAL > Base; typedef DataConverterDefs< typename GETTER::ORIGINAL > Base2; typedef typename Base::TArg TArg; typedef typename Base::Converted Converted; + typedef DataConverterManager< ORIGINAL_BASE > IMPL_ORIGINAL; typedef DataConverterReference< GETTER &, DataConverterPointerImplementation< GETTER > > IMPL_GET; typedef DataConverterReference< PROXY &, DataConverterPointerImplementation< PROXY > > IMPL_SET; - static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) + static GETRESULT FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<true> const & isConst ) { + try + { + GETTER & proxy = IMPL_GET::FromIo( from, call, thrower ); + return proxy.Get(); + } + catch( ... ) + { + try + { + // try to box whatever was there + ORIGINAL_BASE value( IMPL_ORIGINAL::FromIo( from, call, thrower ) ); + + // note that boxing was required + if ( call.quality.quality < ArgumentQuality::Quality_Box ) + { + call.quality.quality = ArgumentQuality::Quality_Box; + } + else + { + call.quality.conversionSteps++; + } + + // create new proxy object holding a copy of the value + PROXY * p = new PROXY( value ); + + // make the object know to and owned by Io so it gets deleted later + IoObject * object = ClassInfo< PROXY >::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); + + // but not before we leave here + IoState_stackRetain_( IoObject_state(from), object ); + + // return a refernece to the held data + return p->Get(); + } + catch(...){} // ignore errors in the block above + throw; // instead, rethrow the original error + } + } + + static GETRESULT FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<false> const & isConst ) + { GETTER & proxy = IMPL_GET::FromIo( from, call, thrower ); return proxy.Get(); } + // check whether we can safely box an incoming object. + // plain values are OK, and const pointers and references + enum { + CanBox = + ( !TestPointer< ORIGINAL >::IsPointer && + !TestReference< ORIGINAL >::IsReference ) + || + ( TestPointer< ORIGINAL >::IsPointer && + TestConst< typename TestPointer< ORIGINAL >::NoPointer >::IsConst ) + || + ( TestReference< ORIGINAL >::IsReference && + TestConst< typename TestReference< ORIGINAL >::NoReference >::IsConst ) + }; + + static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) + { + return TransformReference< Converted >::Transform( FromIo( from, call, thrower, BoolToType< CanBox >() ) ); + } + static void CheckType( IChained const & ){} static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) @@ -288,8 +354,8 @@ CLIO_CLASS_BASE( clio::WrapperBase< T1 > ); } -#define CLIO_CONVERTAS_PROXY( CLASS, PROXY ) namespace clio{ namespace dataconversion{ \ -template<> struct DataConverterManager< CLASS >: public DataConverterProxy< CLASS, Proxy< PROXY > >{}; \ +#define CLIO_CONVERTAS_PROXY( CLASS, CONST, INDIRECTION, PROXY ) namespace clio{ namespace dataconversion{ \ +template<> struct DataConverterManager< CLASS CONST INDIRECTION >: public DataConverterProxy< CLASS CONST INDIRECTION, PROXY< Proxy< CLASS CONST > > >{}; \ }}CLIO_FORCESEMICOLON(proxy1) #define CLIO_CONVERTAS_PROXY_TEMPLATE( CLASS, CONST, INDIRECTION, SIGNATURE, PROXY ) namespace clio{ namespace dataconversion{ \ @@ -300,6 +366,18 @@ PROXY< Proxy< CLASS CLIO_TEMPLATE_ARGLIST_COMPLETE(SIGNATURE) CONST > > >{}; \ }}CLIO_FORCESEMICOLON(proxy2) +// convesion of (const) &/* arguments +#define CLIO_CONVERTAS_PROXY_REF( CLASS, PROXY ) \ +CLIO_CONVERTAS_PROXY( CLASS, ,& , PROXY ); \ +CLIO_CONVERTAS_PROXY( CLASS,const ,& , Const##PROXY ); \ +CLIO_CONVERTAS_PROXY( CLASS, ,* , PROXY ); \ +CLIO_CONVERTAS_PROXY( CLASS,const ,* , Const##PROXY ) + +// convesion of (const) &/* arguments +#define CLIO_CONVERTAS_PROXY_COMPLETE( CLASS, PROXY ) \ +CLIO_CONVERTAS_PROXY( CLASS,,, PROXY ); \ +CLIO_CONVERTAS_PROXY_REF( CLASS, PROXY ) \ + // complete convesion of (const) &/* arguments #define CLIO_CONVERTAS_PROXY_TEMPLATE_COMPLETE( CLASS, SIGNATURE, PROXY ) \ CLIO_CONVERTAS_PROXY_TEMPLATE( CLASS, , , SIGNATURE, PROXY ); \ Modified: clio/trunk/clio/clio/std_container.hpp =================================================================== --- clio/trunk/clio/clio/std_container.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/std_container.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -2,7 +2,6 @@ #define CLIO_STD_CONTAIENR_H #include "proxy.hpp" -#include "macros.hpp" #include "gcpointer.hpp" #include <vector> @@ -140,6 +139,9 @@ extern char const * vectorProxyCodeConst; } +#include "macros.hpp" +#include "dataconversion_extended.hpp" + CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::ConstVectorProxy, (1,(class)), false ); CLIO_TEMPLATE_CLASS( clio::ConstVectorProxy, (1,(class))) Modified: clio/trunk/clio/clio/typetraits.hpp =================================================================== --- clio/trunk/clio/clio/typetraits.hpp 2008-02-24 11:44:10 UTC (rev 8095) +++ clio/trunk/clio/clio/typetraits.hpp 2008-02-25 00:39:44 UTC (rev 8096) @@ -76,6 +76,24 @@ }; */ +// does harmless pointer/reference transformations +template< class T > struct TransformReference +{ + static T Transform( T in ){ return in; } +}; + +template< class T > struct TransformReference< T & > +{ + static T & Transform( T & in ){ return in; } + static T & Transform( T * in ){ assert( in ); return *in; } +}; + +template< class T > struct TransformReference< T * > +{ + static T * Transform( T & in ){ return ∈ } + static T * Transform( T * in ){ return in; } +}; + // class storing a temporary object template< class T > class TempStorage { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:40:28
|
Revision: 8097 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8097&view=rev Author: bazaarmagetron Date: 2008-02-24 16:40:28 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Refactored proxies. Breakage! Modified Paths: -------------- clio/trunk/clio/clio/dataconversion.hpp clio/trunk/clio/clio/dataconversion_extended.cpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/enum.hpp clio/trunk/clio/clio/primitiveproxy.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/clio/std_container.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 17:14:54.890000105 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 19:06:39.562999964 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - clio/primitiveproxy.hpp primitiveproxy.hpp-20080224161453-yaim302iihdd19qa-2 clio/primitiveproxy.cpp primitiveproxy.cpp-20080224161453-yaim302iihdd19qa-1 + Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 Modified: clio/trunk/clio/clio/dataconversion.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -261,15 +261,13 @@ template< class T > struct DataConverterValue; // generic pointers: try to interpret the passed object as a member of the class -// provided FINAL is true. struct DataConverterPointerImplementationBaseBase { static void * FromIo( IClassInfo & classInfo, IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ); }; // generic pointers: try to interpret the passed object as a member of the class -// provided FINAL is true. -template< class T, bool FINAL > struct DataConverterPointerImplementationBase +template< class T > struct DataConverterPointerImplementationBase { typedef typename TestConst< T >::NoConst TNoConst; typedef ClassInfo< TNoConst > ClassInfo; @@ -304,12 +302,8 @@ // STL stings are treated basically like char const * and are primitives for us. CLIO_PRIMITIVE( std::string ); -// if FINAL is false, it is assumed that T is yet another composite type or a primitive, then, -// a primitiveProxy for that class is returned. This is defined in dataconversion_extended.hpp. -template< class T > struct DataConverterPointerImplementationBase< T, false >; - template< class T > struct DataConverterPointerImplementation: -public DataConverterPointerImplementationBase< T, !TestPrimitiveForClio<T>::IsPrimitive > +public DataConverterPointerImplementationBase< T > { }; Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -66,8 +66,8 @@ using namespace dataconversion; // conversion specialized for references to primitives -template< class T > struct DataConverterPrimitiveReference: public DataConverterReference< T &, DataConverterPointerImplementationBase< T, false > >{}; -template< class T > struct DataConverterPrimitivePointer: public DataConverterPointer< T *, DataConverterPointerImplementationBase< T, false > >{}; +//template< class T > struct DataConverterPrimitiveReference: public DataConverterReference< T &, DataConverterPointerImplementationBase< T > >{}; +//template< class T > struct DataConverterPrimitivePointer: public DataConverterPointer< T *, DataConverterPointerImplementationBase< T > >{}; #define CLIO_OVERRIDE_DATACONVERSION_INT( TYPE )\ Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -352,70 +352,6 @@ namespace dataconversion { -// if FINAL is false, it is assumed that T is yet another composite type or a primitive, then, -// a primitiveProxy for that class is returned. -template< class T > struct DataConverterPointerImplementationBase< T, false > -{ - typedef PrimitiveWrapper< T > Wrapper; - typedef typename Wrapper::GETTER Proxy; - typedef ClassInfo< Proxy > ClassInfo; - - typedef T * Converted; - - static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) - { - assert( from ); - - try - { - Proxy * proxy = DataConverterPointerImplementationBase< Proxy, true >::FromIo( from, call, thrower ); - if ( !proxy ) - thrower.Throw( "Only prototype found, but instance expected"); - return &proxy->Get(); - } - catch( ... ) - { - try - { - // convert the object as a regular value - T value( DataConverterManager<T>::FromIo( from, call, thrower ) ); - - // note that boxing was required - if ( call.quality.quality < ArgumentQuality::Quality_Box ) - { - call.quality.quality = ArgumentQuality::Quality_Box; - } - else - { - call.quality.conversionSteps++; - } - - // create new proxy object holding a copy of the value - Proxy * p = new Wrapper( & value ); - - // make the object know to and owned by Io so it gets deleted later - IoObject * object = ClassInfo::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); - - // but not before we leave here - IoState_stackRetain_( IoObject_state(from), object ); - - // return a refernece to the held data - return &p->Get(); - } - catch( ... ){} - - // got here? The inner try block must have failed as well. Rethrow. - throw; - } - } - - static IoObject * ToIo( IoState * state, T * from, DataConversionCall const & call ) - { - return ClassInfo::Get().FetchIoObject( new Wrapper( from ), state, ObjectWrapper::OwnedByIo ); - } -}; - - // IoObject pointers: just pass them through, suppose the creator/receiver knows what he's doing. // Only translate NULL on the C++ side to nil on the Io side. struct DataConverterIoObjectPointer Modified: clio/trunk/clio/clio/enum.hpp =================================================================== --- clio/trunk/clio/clio/enum.hpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/enum.hpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -89,14 +89,8 @@ // wrap non-const references and pointers; use the implementation that is also // used for primitives which wraps the real enum object in something that has // a "set" method where you can change the value. That is not available as a regular - // class method. - //typedef dataconversion::DataConverterPointerImplementationBase< E, false > PointerImplementation; - //typedef dataconversion::DataConverterReference< E &, PointerImplementation > ReferenceConverter; - //typedef dataconversion::DataConverterPointer< E *, PointerImplementation > PointerConverter; - - //typedef dataconversion::DataConverterReference< E &, PointerImplementation > ReferenceConverter; - //typedef dataconversion::DataConverterPointer< E *, PointerImplementation > PointerConverter; - + // class method. NOTE, TODO: It would be better to just GIVE the enum the class + // method `set`, but that's not currently possible. typedef dataconversion::DataConverterProxy< E &, PrimitiveProxy< Proxy< E > > > ReferenceConverter; typedef dataconversion::DataConverterProxy< E *, PrimitiveProxy< Proxy< E > > > PointerConverter; Modified: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -14,17 +14,8 @@ public: typedef typename BASE::ORIGINAL Primitive; - explicit ConstPrimitiveProxy( Primitive & primitive ) - : BASE( primitive ) - {} + CLIO_PROXY_CONST_CONSTRUCTORS( ConstPrimitiveProxy, BASE ){} - explicit ConstPrimitiveProxy( Primitive * primitive ) - : BASE( primitive ) - {} - - ConstPrimitiveProxy() - {} - typedef PrimitiveWrapper<Primitive> WRAPPER; // clones the object as a wrapper @@ -43,65 +34,25 @@ public: typedef typename BASE::ORIGINAL Primitive; - explicit PrimitiveProxy( Primitive & primitive ) - : ConstPrimitiveProxy< BASE >( primitive ) - {} + CLIO_PROXY_NONCONST_CONSTRUCTORS( PrimitiveProxy, ConstPrimitiveProxy< BASE > ){} - explicit PrimitiveProxy( Primitive * primitive ) - : ConstPrimitiveProxy< BASE >( primitive ) - {} - - PrimitiveProxy() - {} - void set( Primitive primitive ) { this->Get() = primitive; } }; -// select the correct base wrapper -template< class T > -struct PrimitiveProxySelect -{ - typedef PrimitiveProxy< Wrapper< T > > Proxy; -}; - -template< class T > -struct PrimitiveProxySelect< const T > -{ - typedef ConstPrimitiveProxy< Wrapper< const T > > Proxy; -}; - // wrapper for primitives template< class T > class PrimitiveWrapper: public PrimitiveProxy< Wrapper< typename TestConst< T >::NoConst > > { public: - typedef PrimitiveProxy< Wrapper< typename TestConst< T >::NoConst > > BASE; + typedef typename TestConst< T >::NoConst TNONCONST; + typedef PrimitiveProxy< Wrapper< TNONCONST > > BASE; typedef typename BASE::Primitive Primitive; - PrimitiveWrapper( PrimitiveWrapper const & other ) + CLIO_WRAPPER_CONSTRUCTORS( PrimitiveWrapper, Primitive ) { - this->Get() = other.Get(); - } - - explicit PrimitiveWrapper( Primitive const & primitive ) - { - this->Get() = primitive; - } - - explicit PrimitiveWrapper( Primitive const * primitive ) - { - if ( !primitive ) - { - throw Exception( "Expected primitive, got nil" ); - } - this->Get() = *primitive; - } - - PrimitiveWrapper() - { // primitives should be initialized to 0 this->Get() = static_cast< T >( 0 ); } @@ -146,12 +97,19 @@ CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::PrimitiveWrapper, (1,(class)), true ); CLIO_TEMPLATE_CLASS_EX( clio::PrimitiveWrapper, (1,(class)), "Ref" ) -{ +{ typedef typename CLASS::BASE BASE; + typedef typename CLASS::TNONCONST TNONCONST; CLIO_CLASS_BASE( BASE ); CLIO_CONSTRUCTOR_CUSTOM( (1,(T1)) ); CLIO_INJECTCODE( clio::primitiveProxyCode ); + + // transfer name + clio::NameSurgeon< CLASS, BASE >::Operate(); + clio::NameSurgeon< CLASS, Proxy< TNONCONST > >::Operate(); + clio::NameSurgeon< CLASS, PrimitiveProxy< Proxy< TNONCONST > > >::Operate(); + clio::NameSurgeon< CLASS, ConstPrimitiveProxy< Proxy< T1 > > >::Operate(); } CLIO_TEMPLATE_CLASS_NOMASTER( clio::PrimitiveWrapper, (1,(class)), clio::PrimitiveProxyNoMaster ); Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -11,34 +11,14 @@ namespace clio { -// Wrapper objects. T should be the raw type of the wrapped object. +// Wrapper objects. T should be the raw type of the wrapped object without const. template< class T > -class WrapperBaseConst: public WrapperBaseConst< const T > +class ProxyConst: public IChained { public: typedef T ORIGINAL; - typedef WrapperBaseConst GETTER; - typedef ORIGINAL & GETRESULT; - typedef WrapperBaseConst< const T > BASE; - - // returns the original object - ORIGINAL & Get() - { - return DoGet(); - } -private: - // returns the original object - virtual ORIGINAL & DoGet() = 0; -}; - -// Wrapper objects. T should be the raw type of the wrapped object. -template< class T > -class WrapperBaseConst< const T >: public IChained -{ -public: - typedef T ORIGINAL; typedef ORIGINAL const & GETRESULT; - typedef WrapperBaseConst GETTER; + typedef ProxyConst GETTER; typedef IChained BASE; // returns the original object @@ -51,33 +31,47 @@ virtual ORIGINAL const & DoGet() const = 0; }; -// Wrapper objects. T should be the raw type of the wrapped object. +// Wrapper objects. T should be the raw type of the wrapped object, no const. template< class T > -class WrapperBase: public WrapperBaseConst< T > +class ProxyNonConst: public ProxyConst< T > { public: typedef T ORIGINAL; + typedef ORIGINAL & GETRESULT; + typedef ProxyNonConst GETTER; + typedef ProxyConst< T > BASE; - // returns the original object - ORIGINAL const & Get() const - { - return DoGet(); - } + using BASE::Get; // returns the original object ORIGINAL & Get() { - return DoGet(); + return this->DoAccess(); } private: // returns the original object - virtual ORIGINAL const & DoGet() const = 0; - virtual ORIGINAL & DoGet() = 0; + virtual ORIGINAL & DoAccess() = 0; }; +// Wrapper objects. T should be the raw type of the wrapped object. const allowed. +template< class T > +class ProxyBase: public ProxyNonConst< T > +{ +public: + typedef ProxyNonConst< T > BASE; +}; + +// Wrapper objects. T should be the raw type of the wrapped object. const allowed. +template< class T > +class ProxyBase< T const >: public ProxyConst< T > +{ +public: + typedef ProxyConst< T > BASE; +}; + // Proxy objects. ORIGINAL should be the raw type of the wrapped object. template< class ORIGINAL > -class Proxy: public WrapperBase< ORIGINAL > +class Proxy: public ProxyBase< ORIGINAL > { public: // creates proxy for original @@ -134,7 +128,7 @@ original_ = 0; // delegate - WrapperBase< ORIGINAL >::OnBreak(); + ProxyBase< ORIGINAL >::OnBreak(); } } private: @@ -155,7 +149,7 @@ return DoGetBase(); } - ORIGINAL & DoGet() + ORIGINAL & DoAccess() { return DoGetBase(); } @@ -169,7 +163,7 @@ // Wrappers contain the wrapped object. template< class ORIGINAL > -class Wrapper: public WrapperBase< ORIGINAL > +class Wrapper: public ProxyBase< typename TestConst< ORIGINAL >::NoConst > { public: // creates proxy for original @@ -193,7 +187,7 @@ } // returns the original object - ORIGINAL & DoGet() + ORIGINAL & DoAccess() { return wrapped_; } @@ -262,10 +256,10 @@ } // create new proxy object holding a copy of the value - PROXY * p = new PROXY( value ); + Wrapper< ORIGINAL_BASE > * p = new Wrapper< ORIGINAL_BASE >( value ); // make the object know to and owned by Io so it gets deleted later - IoObject * object = ClassInfo< PROXY >::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); + IoObject * object = ClassInfo< Wrapper< ORIGINAL_BASE > >::Get().FetchIoObject( p, IoObject_state(from), ObjectWrapper::OwnedByIo ); // but not before we leave here IoState_stackRetain_( IoObject_state(from), object ); @@ -323,35 +317,50 @@ } +// these classes allows you to bend the IO name of a class to another class. +// handy to make all wrappers appear as the main implementation name. +template< class SOURCE, class DEST > +struct NameSurgeon +{ + // transfer the name + static void Operate() + { + ClassInfo< DEST >::Get().SetName( IClassInfo::Name_IoComplete, + ClassInfo< SOURCE >::Get().GetName( IClassInfo::Name_IoComplete ) ); + } +}; + } #include "typetraits.hpp" #include "macros.hpp" -CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::WrapperBaseConst, (1,(class)), false ); -CLIO_TEMPLATE_CLASS_SET_ABSTRACT( clio::WrapperBaseConst, (1,(class)), true ); -CLIO_TEMPLATE_CLASS( clio::WrapperBaseConst, (1,(class)) ) +CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::ProxyConst, (1,(class)), false ); +CLIO_TEMPLATE_CLASS_SET_ABSTRACT( clio::ProxyConst, (1,(class)), true ); +CLIO_TEMPLATE_CLASS( clio::ProxyConst, (1,(class)) ) { - typedef typename clio::WrapperBaseConst<T1>::BASE BASE; - + typedef typename CLASS::BASE BASE; CLIO_CLASS_BASE( BASE ); } -CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::WrapperBase, (1,(class)), false ); -CLIO_TEMPLATE_CLASS_SET_ABSTRACT( clio::WrapperBase, (1,(class)), true ); -CLIO_TEMPLATE_CLASS( clio::WrapperBase, (1,(class)) ) +CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::ProxyNonConst, (1,(class)), false ); +CLIO_TEMPLATE_CLASS_SET_ABSTRACT( clio::ProxyNonConst, (1,(class)), true ); +CLIO_TEMPLATE_CLASS( clio::ProxyNonConst, (1,(class)) ) { - CLIO_CLASS_BASE( WrapperBaseConst<T1> ); + typedef typename CLASS::BASE BASE; + CLIO_CLASS_BASE( BASE ); } CLIO_TEMPLATE_CLASS( clio::Proxy, (1,(class)) ) { - CLIO_CLASS_BASE( clio::WrapperBase< T1 > ); + typedef typename CLASS::BASE BASE; + CLIO_CLASS_BASE( BASE ); } CLIO_TEMPLATE_CLASS( clio::Wrapper, (1,(class)) ) { - CLIO_CLASS_BASE( clio::WrapperBase< T1 > ); + typedef typename CLASS::BASE BASE; + CLIO_CLASS_BASE( BASE ); } #define CLIO_CONVERTAS_PROXY( CLASS, CONST, INDIRECTION, PROXY ) namespace clio{ namespace dataconversion{ \ @@ -386,4 +395,40 @@ CLIO_CONVERTAS_PROXY_TEMPLATE( CLASS, ,* , SIGNATURE, PROXY ); \ CLIO_CONVERTAS_PROXY_TEMPLATE( CLASS, const,* , SIGNATURE, Const##PROXY ) +// helper macros for proxies. BASE is your base class, CLASS your current class. +#define CLIO_PROXY_NONCONST_CONSTRUCTORS( CLASS, BASE ) \ + explicit CLASS( typename BASE::ORIGINAL & arg ) \ + : BASE( arg ){} \ + explicit CLASS( typename BASE::ORIGINAL * arg ) \ + : BASE( arg ){} \ + CLASS() + +#define CLIO_PROXY_CONST_CONSTRUCTORS( CLASS, BASE ) \ + explicit CLASS( typename BASE::ORIGINAL const & arg )\ + : BASE( arg ){} \ + explicit CLASS( typename BASE::ORIGINAL const * arg )\ + : BASE( arg ){} \ + CLIO_PROXY_NONCONST_CONSTRUCTORS( CLASS, BASE ) + +// the same for the wrapper class +#define CLIO_WRAPPER_CONSTRUCTORS( CLASS, WRAPPED ) \ + CLASS( CLASS const & other ) \ + { \ + this->Get() = other.Get(); \ + } \ + explicit CLASS( WRAPPED const & primitive ) \ + { \ + this->Get() = primitive; \ + } \ + explicit CLASS( WRAPPED const * primitive ) \ + { \ + if ( !primitive ) \ + { \ + throw Exception( "Expected something, got nil" ); \ + } \ + this->Get() = *primitive; \ + } \ + CLASS() + + #endif Modified: clio/trunk/clio/clio/std_container.hpp =================================================================== --- clio/trunk/clio/clio/std_container.hpp 2008-02-25 00:39:44 UTC (rev 8096) +++ clio/trunk/clio/clio/std_container.hpp 2008-02-25 00:40:28 UTC (rev 8097) @@ -21,17 +21,8 @@ typedef typename Container::reference reference; typedef typename Container::const_reference const_reference; - explicit ConstVectorProxy( Container & container ) - : BASE( container ) - {} + CLIO_PROXY_CONST_CONSTRUCTORS( ConstVectorProxy, BASE ){} - explicit ConstVectorProxy( Container * container ) - : BASE( container ) - {} - - ConstVectorProxy() - {} - void CheckIndex( size_type index ) const { if ( index < 0 || index >= size() ) @@ -67,17 +58,8 @@ typedef typename Container::reference reference; typedef typename Container::const_reference const_reference; - explicit VectorProxy( Container & container ) - : ConstVectorProxy< BASE >( container ) - {} + CLIO_PROXY_NONCONST_CONSTRUCTORS( VectorProxy, ConstVectorProxy< BASE > ){} - explicit VectorProxy( Container * container ) - : ConstVectorProxy< BASE >( container ) - {} - - VectorProxy() - {} - void append( const_reference value ) { this->Get().push_back(value); @@ -105,27 +87,7 @@ typedef typename BASE::Container Container; - VectorWrapper( VectorWrapper const & other ) - { - this->Get() = other.Get(); - } - - explicit VectorWrapper( Container const & container ) - { - this->Get() = container; - } - - explicit VectorWrapper( Container const * container ) - { - if ( !container ) - { - throw Exception( "Expected container, got nil" ); - } - this->Get() = *container; - } - - VectorWrapper() - {} + CLIO_WRAPPER_CONSTRUCTORS( VectorWrapper, Container ){} }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:40:51
|
Revision: 8098 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8098&view=rev Author: bazaarmagetron Date: 2008-02-24 16:40:57 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Ok, many tests fail right now, but I'm on it. Modified Paths: -------------- clio/trunk/clio/doc/about.t2t.in clio/trunk/clio/tests/basic.test/test.cpp clio/trunk/clio/tests/container.test/test.cpp clio/trunk/clio/tests/conversion.test/test.cpp clio/trunk/clio/tests/stack.test/test.cpp Added Paths: ----------- clio/trunk/clio/tests/adhoc.test/ clio/trunk/clio/tests/adhoc.test/output.txt clio/trunk/clio/tests/adhoc.test/test.cpp clio/trunk/clio/tests/adhoc.test/test.io Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 19:06:39.562999964 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 19:18:43.194999933 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - + tests/adhoc.test proxy.test-20080224110352-ktp2lx7tt5risuzd-1 tests/adhoc.test/output.txt output.txt-20080224110352-ktp2lx7tt5risuzd-2 tests/adhoc.test/test.cpp test.cpp-20080224110352-ktp2lx7tt5risuzd-3 tests/adhoc.test/test.io test.io-20080224110352-ktp2lx7tt5risuzd-4 Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b Modified: clio/trunk/clio/doc/about.t2t.in =================================================================== --- clio/trunk/clio/doc/about.t2t.in 2008-02-25 00:40:28 UTC (rev 8097) +++ clio/trunk/clio/doc/about.t2t.in 2008-02-25 00:40:57 UTC (rev 8098) @@ -1,6 +1,5 @@ What is Clio? - @navbar@ Clio is a C++ template and macro library that lets you create bindings for the @@ -28,7 +27,8 @@ === Why the name? === Well, it is an ancronym for **C**++ **L**ayer for **IO**. Also, Clio, like Io itself, is a name -from Greek mythology. +from Greek mythology. Io was a priestess of Hera and one of Zeus' ... acquaintances, and Clio was the +Muse of History. === Supported C++ Features === Added: clio/trunk/clio/tests/adhoc.test/output.txt =================================================================== Added: clio/trunk/clio/tests/adhoc.test/test.cpp =================================================================== --- clio/trunk/clio/tests/adhoc.test/test.cpp (rev 0) +++ clio/trunk/clio/tests/adhoc.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) @@ -0,0 +1,51 @@ +#include "helptest.hpp" +#include "gcpointer.hpp" + +// **************************** +// primitive proxies +// **************************** + +class T +{ +public: + void acceptsReference( int const & i ) + { + std::cout << "i = " << i << "\n"; + } + + void acceptsValue( int i ) + { + std::cout << "i = " << i << "\n"; + } + + int & ref() + { + return x; + } + + int x; +}; + +template< class T > +class TTest +{ +}; + +CLIO_CLASS( T ) +{ + CLIO_METHOD( acceptsReference ); + CLIO_METHOD( acceptsValue ); + CLIO_METHOD( ref ); +} + +CLIO_TEMPLATE_CLASS( TTest, (1,(class)) ) +{ +} + +CLIO_TEMPLATE_CLASS_MASTER( TTest, (1,(class)), (1,(clio::IoObjectPointer)) ); +CLIO_INSTANTIATE_TEMPLATE( TTest, (1,(int)), "TTest_int" ); + +void Test() +{ +} + Added: clio/trunk/clio/tests/adhoc.test/test.io =================================================================== --- clio/trunk/clio/tests/adhoc.test/test.io (rev 0) +++ clio/trunk/clio/tests/adhoc.test/test.io 2008-02-25 00:40:57 UTC (rev 8098) @@ -0,0 +1,21 @@ +x := T clone +r := x ref +x ref println +x ref type println +r set(1) +x ref println +r asNumber println + +x acceptsReference(1) + +ttest := TTest With(Clio Int) clone +ttest type println +ttest = TTest_int clone +ttest type println + +x type println +i := Clio Int clone +i type println +i println +x acceptsValue(i) + Modified: clio/trunk/clio/tests/basic.test/test.cpp =================================================================== --- clio/trunk/clio/tests/basic.test/test.cpp 2008-02-25 00:40:28 UTC (rev 8097) +++ clio/trunk/clio/tests/basic.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) @@ -153,6 +153,7 @@ TestString( state, "writeln( s )" ); TestString( state, "writeln( testObject convert2( s ) )" ); TestString( state, "writeln( s )" ); + TestString( state, "writeln( testObject len(s) )" ); TestString( state, "writeln( testObject ptr( testObject ) )" ); Modified: clio/trunk/clio/tests/container.test/test.cpp =================================================================== --- clio/trunk/clio/tests/container.test/test.cpp 2008-02-25 00:40:28 UTC (rev 8097) +++ clio/trunk/clio/tests/container.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) @@ -62,7 +62,7 @@ B( A & ){} }; -CLIO_CONVERTAS_PROXY( A &, A ); +// CLIO_CONVERTAS_PROXY( A, &,, A ); namespace clio { Modified: clio/trunk/clio/tests/conversion.test/test.cpp =================================================================== --- clio/trunk/clio/tests/conversion.test/test.cpp 2008-02-25 00:40:28 UTC (rev 8097) +++ clio/trunk/clio/tests/conversion.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) @@ -20,7 +20,7 @@ static void f1(){} static bool f2( bool x ){ return !x; } static int f3( int x ){ return x+1; } - static int const & f3_2( int & x ){ return x; } + static int const & f3_2( int const & x ){ return x; } static DataConversion * f4( DataConversion & x ){ return &x; } static void f5( DataConversion ** x ){ std::cout << (*x)->value << '\n'; } Modified: clio/trunk/clio/tests/stack.test/test.cpp =================================================================== --- clio/trunk/clio/tests/stack.test/test.cpp 2008-02-25 00:40:28 UTC (rev 8097) +++ clio/trunk/clio/tests/stack.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) @@ -62,7 +62,7 @@ B( A & ){} }; -CLIO_CONVERTAS_PROXY( A &, A ); +// CLIO_CONVERTAS_PROXY( A &, A ); namespace clio { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:43:05
|
Revision: 8099 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8099&view=rev Author: bazaarmagetron Date: 2008-02-24 16:43:09 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Moved stuff in the tests around so I don't have a million test.cpp files open. Modified Paths: -------------- clio/trunk/clio/tests/Makefile.am clio/trunk/clio/tests/multiunit.test/test2.cpp clio/trunk/clio/tests/runtest.sh clio/trunk/clio/tests/runtests.sh Added Paths: ----------- clio/trunk/clio/tests/adhoc.test/adhoc.cpp clio/trunk/clio/tests/adhoc.test/adhoc.io clio/trunk/clio/tests/basic.test/basic.cpp clio/trunk/clio/tests/basic.test/basic.io clio/trunk/clio/tests/classname.test/classname.cpp clio/trunk/clio/tests/classname.test/classname.io clio/trunk/clio/tests/codesize.test/codesize.cpp clio/trunk/clio/tests/codesize.test/codesize.io clio/trunk/clio/tests/constructor.test/constructor.cpp clio/trunk/clio/tests/constructor.test/constructor.io clio/trunk/clio/tests/container.test/container.cpp clio/trunk/clio/tests/container.test/container.io clio/trunk/clio/tests/conversion.test/conversion.cpp clio/trunk/clio/tests/conversion.test/conversion.io clio/trunk/clio/tests/crash.test/crash.cpp clio/trunk/clio/tests/crash.test/crash.io clio/trunk/clio/tests/enum.test/enum.cpp clio/trunk/clio/tests/enum.test/enum.io clio/trunk/clio/tests/helptest.hpp clio/trunk/clio/tests/inheritance.test/inheritance.cpp clio/trunk/clio/tests/inheritance.test/inheritance.io clio/trunk/clio/tests/membervariables.test/membervariables.cpp clio/trunk/clio/tests/membervariables.test/membervariables.io clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.cpp clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.io clio/trunk/clio/tests/namespace.test/namespace.cpp clio/trunk/clio/tests/namespace.test/namespace.io clio/trunk/clio/tests/overloads.test/overloads.cpp clio/trunk/clio/tests/overloads.test/overloads.io clio/trunk/clio/tests/proto.test/proto.cpp clio/trunk/clio/tests/proto.test/proto.io clio/trunk/clio/tests/reference.test/reference.cpp clio/trunk/clio/tests/reference.test/reference.io clio/trunk/clio/tests/security.test/security.cpp clio/trunk/clio/tests/security.test/security.io clio/trunk/clio/tests/simple.test/simple.cpp clio/trunk/clio/tests/simple.test/simple.io clio/trunk/clio/tests/smartpointer.test/smartpointer.cpp clio/trunk/clio/tests/smartpointer.test/smartpointer.io clio/trunk/clio/tests/stack.test/stack.cpp clio/trunk/clio/tests/stack.test/stack.io clio/trunk/clio/tests/super.test/super.cpp clio/trunk/clio/tests/super.test/super.io clio/trunk/clio/tests/templates.test/templates.cpp clio/trunk/clio/tests/templates.test/templates.io clio/trunk/clio/tests/virtual.test/virtual.cpp clio/trunk/clio/tests/virtual.test/virtual.io Removed Paths: ------------- clio/trunk/clio/clio/helptest.hpp clio/trunk/clio/tests/adhoc.test/test.cpp clio/trunk/clio/tests/adhoc.test/test.io clio/trunk/clio/tests/basic.test/test.cpp clio/trunk/clio/tests/basic.test/test.io clio/trunk/clio/tests/classname.test/test.cpp clio/trunk/clio/tests/classname.test/test.io clio/trunk/clio/tests/codesize.test/test.cpp clio/trunk/clio/tests/codesize.test/test.io clio/trunk/clio/tests/constructor.test/test.cpp clio/trunk/clio/tests/constructor.test/test.io clio/trunk/clio/tests/container.test/test.cpp clio/trunk/clio/tests/container.test/test.io clio/trunk/clio/tests/conversion.test/test.cpp clio/trunk/clio/tests/conversion.test/test.io clio/trunk/clio/tests/crash.test/test.cpp clio/trunk/clio/tests/crash.test/test.io clio/trunk/clio/tests/enum.test/test.cpp clio/trunk/clio/tests/enum.test/test.io clio/trunk/clio/tests/inheritance.test/test.cpp clio/trunk/clio/tests/inheritance.test/test.io clio/trunk/clio/tests/membervariables.test/test.cpp clio/trunk/clio/tests/membervariables.test/test.io clio/trunk/clio/tests/multiple_inheritance.test/test.cpp clio/trunk/clio/tests/multiple_inheritance.test/test.io clio/trunk/clio/tests/namespace.test/test.cpp clio/trunk/clio/tests/namespace.test/test.io clio/trunk/clio/tests/overloads.test/test.cpp clio/trunk/clio/tests/overloads.test/test.io clio/trunk/clio/tests/proto.test/test.cpp clio/trunk/clio/tests/proto.test/test.io clio/trunk/clio/tests/reference.test/test.cpp clio/trunk/clio/tests/reference.test/test.io clio/trunk/clio/tests/security.test/test.cpp clio/trunk/clio/tests/security.test/test.io clio/trunk/clio/tests/simple.test/test.cpp clio/trunk/clio/tests/simple.test/test.io clio/trunk/clio/tests/smartpointer.test/test.cpp clio/trunk/clio/tests/smartpointer.test/test.io clio/trunk/clio/tests/stack.test/test.cpp clio/trunk/clio/tests/stack.test/test.io clio/trunk/clio/tests/super.test/test.cpp clio/trunk/clio/tests/super.test/test.io clio/trunk/clio/tests/templates.test/test.cpp clio/trunk/clio/tests/templates.test/test.io clio/trunk/clio/tests/virtual.test/test.cpp clio/trunk/clio/tests/virtual.test/test.io Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 19:18:43.194999933 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 23:41:47.381999969 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - tests/adhoc.test proxy.test-20080224110352-ktp2lx7tt5risuzd-1 tests/adhoc.test/output.txt output.txt-20080224110352-ktp2lx7tt5risuzd-2 tests/adhoc.test/test.cpp test.cpp-20080224110352-ktp2lx7tt5risuzd-3 tests/adhoc.test/test.io test.io-20080224110352-ktp2lx7tt5risuzd-4 + tests/helptest.hpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:helptest.hpp tests/codesize.test/codesize.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcodesize.test%2Ftest.cpp tests/codesize.test/codesize.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcodesize.test%2Ftest.io tests/conversion.test/conversion.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconversion.test%2Ftest.io tests/conversion.test/conversion.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconversion.test%2Ftest.cpp tests/super.test/super.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsuper.test%2Ftest.cpp tests/super.test/super.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsuper.test%2Ftest.io tests/templates.test/templates.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Ftemplates.test%2Ftest.cpp tests/templates.test/templates.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Ftemplates.test%2Ftest.io tests/security.test/security.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsecurity.test%2Ftest.io tests/security.test/security.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsecurity.test%2Ftest.cpp tests/inheritance.test/inheritance.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Finheritance.test%2Ftest.cpp tests/inheritance.test/inheritance.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Finheritance.test%2Ftest.io tests/overloads.test/overloads.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Foverloads.test%2Ftest.cpp tests/overloads.test/overloads.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Foverloads.test%2Ftest.io tests/reference.test/reference.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Freference.test%2Ftest.io tests/reference.test/reference.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Freference.test%2Ftest.cpp tests/membervariables.test/membervariables.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmembervariables.test%2Ftest.cpp tests/membervariables.test/membervariables.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmembervariables.test%2Ftest.io tests/smartpointer.test/smartpointer.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsmartpointer.test%2Ftest.io tests/smartpointer.test/smartpointer.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsmartpointer.test%2Ftest.cpp tests/simple.test/simple.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsimple.test%2Ftest.io tests/simple.test/simple.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsimple.test%2Ftest.cpp tests/virtual.test/virtual.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fvirtual.test%2Ftest.io tests/virtual.test/virtual.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fvirtual.test%2Ftest.cpp tests/multiple_inheritance.test/multiple_inheritance.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiple_inheritance.test%2Ftest.cpp tests/multiple_inheritance.test/multiple_inheritance.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiple_inheritance.test%2Ftest.io tests/proto.test/proto.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fproto.test%2Ftest.cpp tests/proto.test/proto.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fproto.test%2Ftest.io tests/constructor.test/constructor.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconstructor.test%2Ftest.cpp tests/constructor.test/constructor.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconstructor.test%2Ftest.io tests/basic.test/basic.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fbasic.test%2Ftest.cpp tests/basic.test/basic.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fbasic.test%2Ftest.io tests/namespace.test/namespace.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest.cpp tests/namespace.test/namespace.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest.io tests/crash.test/crash.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcrash.test%2Ftest.cpp tests/crash.test/crash.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcrash.test%2Ftest.io tests/enum.test/enum.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fenum.test%2Ftest.io tests/enum.test/enum.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fenum.test%2Ftest.cpp tests/adhoc.test/adhoc.io test.io-20080224110352-ktp2lx7tt5risuzd-4 tests/adhoc.test/adhoc.cpp test.cpp-20080224110352-ktp2lx7tt5risuzd-3 tests/classname.test/classname.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fclassname.test%2Ftest.cpp tests/classname.test/classname.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fclassname.test%2Ftest.io tests/container.test/container.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcontainer.test%2Ftest.cpp tests/container.test/container.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcontainer.test%2Ftest.io tests/stack.test/stack.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fstack.test%2Ftest.cpp tests/stack.test/stack.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fstack.test%2Ftest.io Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp Deleted: clio/trunk/clio/clio/helptest.hpp =================================================================== --- clio/trunk/clio/clio/helptest.hpp 2008-02-25 00:40:57 UTC (rev 8098) +++ clio/trunk/clio/clio/helptest.hpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -1,53 +0,0 @@ -#include <iostream> -#include <fstream> - -#include "clio.hpp" -#include "state.hpp" -#include "gcpointer.hpp" - -inline void TestString( clio::State & state, char const * testString ) -{ - std::cout << "<<<< " << testString << "\n"; - state.DoString( testString ); -} - -inline void TestFile( clio::State & state, char const * file ) -{ - std::ifstream s( file ); - while ( s.good() && !s.eof() ) - { - char line[1000]; - s.getline( line, 999, '\n' ); - if ( strlen(line) > 0 && line[0] != '#' ) - TestString( state, line ); - else - std::cout << line << "\n"; - } -} - -// class unknown to clio -class UnknownClass -{ -public: -}; - -void Test(); - -static int argnum_; -static char ** argv_; - -int main( int argnum, char ** argv ) -{ - argnum_ = argnum; - argv_ = argv; - - clio::State state; - - clio::IStateRegistrator::RegisterAll( state ); - - TestFile( state, ( std::string( argv[0] ) + ".io" ).c_str() ); - - Test(); - - return 0; -} Modified: clio/trunk/clio/tests/Makefile.am =================================================================== --- clio/trunk/clio/tests/Makefile.am 2008-02-25 00:40:57 UTC (rev 8098) +++ clio/trunk/clio/tests/Makefile.am 2008-02-25 00:43:09 UTC (rev 8099) @@ -5,11 +5,13 @@ LIBCLIO=../clio/libclio.a +AM_CXXFLAGS="-I${top_srcdir}" +AM_LFLAGS="${LIBCLIO}" + # add one test explicitly so ${CXXCOMPILE/LINK} is defined -bin_PROGRAMS = multiunit.test/test -multiunit_test_test_SOURCES = multiunit.test/test2.cpp multiunit.test/test3.cpp multiunit.test/test.cpp multiunit.test/test2.hpp multiunit.test/test3_specialize.hpp multiunit.test/test.hpp multiunit.test/test3.hpp multiunit.test/common.hpp -multiunit_test_test_CXXFLAGS = "-I${top_srcdir}/clio" -multiunit_test_test_LDADD = ${LIBCLIO} +bin_PROGRAMS = multiunit.test/multiunit.test +multiunit_test_multiunit_test_SOURCES = multiunit.test/test2.cpp multiunit.test/test3.cpp multiunit.test/test.cpp multiunit.test/test2.hpp multiunit.test/test3_specialize.hpp multiunit.test/test.hpp multiunit.test/test3.hpp multiunit.test/common.hpp +multiunit_test_multiunit_test_LDADD = ${LIBCLIO} clean-local: rm -rf *.result @@ -21,19 +23,14 @@ cp -rf ${srcdir}/*.test ${distdir} rm -f ${distdir}/*.test/test ${distdir}/*.test/*.o ${distdir}/*/test/*~ -%.o: %.cpp +.o.test: ${LIBCLIO} ${mkdir_p} `dirname $@` - ${CXXCOMPILE} "-I${top_srcdir}/clio" -c $< -o $@ - -%.test/test: %.test/test.o ${LIBCLIO} - ${mkdir_p} `dirname $@` ${CXXLINK} $< ${LIBCLIO} -%.result: %.test/test +.test.result: srcdir=${srcdir} ${srcdir}/runtest.sh $@ tests: MAKE=${MAKE} srcdir=${srcdir} ${srcdir}/runtests.sh -.precious: %.test/test %.test/test.o Copied: clio/trunk/clio/tests/adhoc.test/adhoc.cpp (from rev 8098, clio/trunk/clio/tests/adhoc.test/test.cpp) =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.cpp (rev 0) +++ clio/trunk/clio/tests/adhoc.test/adhoc.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -0,0 +1,51 @@ +#include "helptest.hpp" +#include "gcpointer.hpp" + +// **************************** +// primitive proxies +// **************************** + +class T +{ +public: + void acceptsReference( int const & i ) + { + std::cout << "i = " << i << "\n"; + } + + void acceptsValue( int i ) + { + std::cout << "i = " << i << "\n"; + } + + int & ref() + { + return x; + } + + int x; +}; + +template< class T > +class TTest +{ +}; + +CLIO_CLASS( T ) +{ + CLIO_METHOD( acceptsReference ); + CLIO_METHOD( acceptsValue ); + CLIO_METHOD( ref ); +} + +CLIO_TEMPLATE_CLASS( TTest, (1,(class)) ) +{ +} + +CLIO_TEMPLATE_CLASS_MASTER( TTest, (1,(class)), (1,(clio::IoObjectPointer)) ); +CLIO_INSTANTIATE_TEMPLATE( TTest, (1,(int)), "TTest_int" ); + +void Test() +{ +} + Copied: clio/trunk/clio/tests/adhoc.test/adhoc.io (from rev 8098, clio/trunk/clio/tests/adhoc.test/test.io) =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.io (rev 0) +++ clio/trunk/clio/tests/adhoc.test/adhoc.io 2008-02-25 00:43:09 UTC (rev 8099) @@ -0,0 +1,21 @@ +x := T clone +r := x ref +x ref println +x ref type println +r set(1) +x ref println +r asNumber println + +x acceptsReference(1) + +ttest := TTest With(Clio Int) clone +ttest type println +ttest = TTest_int clone +ttest type println + +x type println +i := Clio Int clone +i type println +i println +x acceptsValue(i) + Deleted: clio/trunk/clio/tests/adhoc.test/test.cpp =================================================================== --- clio/trunk/clio/tests/adhoc.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) +++ clio/trunk/clio/tests/adhoc.test/test.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -1,51 +0,0 @@ -#include "helptest.hpp" -#include "gcpointer.hpp" - -// **************************** -// primitive proxies -// **************************** - -class T -{ -public: - void acceptsReference( int const & i ) - { - std::cout << "i = " << i << "\n"; - } - - void acceptsValue( int i ) - { - std::cout << "i = " << i << "\n"; - } - - int & ref() - { - return x; - } - - int x; -}; - -template< class T > -class TTest -{ -}; - -CLIO_CLASS( T ) -{ - CLIO_METHOD( acceptsReference ); - CLIO_METHOD( acceptsValue ); - CLIO_METHOD( ref ); -} - -CLIO_TEMPLATE_CLASS( TTest, (1,(class)) ) -{ -} - -CLIO_TEMPLATE_CLASS_MASTER( TTest, (1,(class)), (1,(clio::IoObjectPointer)) ); -CLIO_INSTANTIATE_TEMPLATE( TTest, (1,(int)), "TTest_int" ); - -void Test() -{ -} - Deleted: clio/trunk/clio/tests/adhoc.test/test.io =================================================================== --- clio/trunk/clio/tests/adhoc.test/test.io 2008-02-25 00:40:57 UTC (rev 8098) +++ clio/trunk/clio/tests/adhoc.test/test.io 2008-02-25 00:43:09 UTC (rev 8099) @@ -1,21 +0,0 @@ -x := T clone -r := x ref -x ref println -x ref type println -r set(1) -x ref println -r asNumber println - -x acceptsReference(1) - -ttest := TTest With(Clio Int) clone -ttest type println -ttest = TTest_int clone -ttest type println - -x type println -i := Clio Int clone -i type println -i println -x acceptsValue(i) - Copied: clio/trunk/clio/tests/basic.test/basic.cpp (from rev 8098, clio/trunk/clio/tests/basic.test/test.cpp) =================================================================== --- clio/trunk/clio/tests/basic.test/basic.cpp (rev 0) +++ clio/trunk/clio/tests/basic.test/basic.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -0,0 +1,181 @@ +#include "../helptest.hpp" + +// **************************** +// basic method wrapping +// **************************** + +class Namespace{}; + +CLIO_CLASS_EX( Namespace, "Test" ) +{ +} + +class TestPrivate +{ +public: + TestPrivate( int, char, std::string ); +private: + TestPrivate(); + TestPrivate( TestPrivate const & ); +}; + +CLIO_CLASS_SET_DEFAULTCONSTRUCTOR( TestPrivate, false ); +CLIO_CLASS_SET_COPYCONSTRUCTOR( TestPrivate, false ); + +CLIO_CLASS( TestPrivate ){} + +class TestWrapper +{ +public: + TestWrapper() + : value_( 0 ) + {} + + void Default( int i=0 ) {} + void Default2( int i=0 ) {} + void Default3( int i=0 ) {} + void Default4( int i=0 ) {} + void Set( int i ) { value_ = i; } + int Get() const { return value_; } + int & Access() { return value_; } + + int Add( int i, int j ) { return i + j; } + + int Double( int i ) { return 2 * i; } + int Len( std::string s ) { return s.size(); } + int Len( std::string s ) const { return s.size(); } + char const * Convert( std::string const & s ) { return s.c_str(); } + std::string const & Convert2( std::string & s ) { s = s + s; return s; } + TestWrapper const * Ptr2( TestWrapper * s ) { return s; } + + bool NOP( std::string const & s ) { return false; } + void Ptr( TestWrapper * s ) {} + + // comparison + bool operator==( TestWrapper const & other ) const + { + return value_ == other.value_; + } + + static void Static() {} + + // pointer return values are wrapped in Io + TestWrapper * Create( int i ) + { + TestWrapper * wrapper = new TestWrapper(); + wrapper->Set( i ); + return wrapper; + } + + // returned references are handled like pointers, but ownership is not transferred to Io + TestWrapper & StaticObject( int ) + { + static TestWrapper wrapper; + return wrapper; + } + + // return by value has no other chance than to clone the object + TestWrapper Value( TestWrapper w ) { return w; } + + // unknown classes + UnknownClass & UnknownOut() { static UnknownClass s; return s; } + void UnknownIn( UnknownClass & ) {} +private: + int value_; +}; + +int Global(int){ return 0; } + +class Dummy{}; + +CLIO_CLASS( TestWrapper ) +{ +CLIO_CLASS_NESTED_IN( Namespace ); +CLIO_METHOD( Default ); +CLIO_METHOD( Default2 ); +CLIO_METHOD( Default3 ); +CLIO_METHOD( Default4 ); +CLIO_METHOD( Set ); +CLIO_METHOD( Get ); +CLIO_METHOD( Access ); +CLIO_METHOD( Double ); +CLIO_METHOD( Add ); +// this is how you can handle overloaded functions: pass the function pointer type as second argument and the desired function name as thrid. +CLIO_METHOD_EX( Len,(int(TestWrapper::*)(std::string)),"len"); +CLIO_METHOD_EX( Len,(int(TestWrapper::*)(std::string) const),"lenConst"); +CLIO_METHOD( NOP ); +CLIO_METHOD( Convert ); +CLIO_METHOD( Convert2 ); +CLIO_METHOD( Ptr ); +CLIO_METHOD( Ptr2 ); +CLIO_METHOD( Create ).TransferOwnership(); +CLIO_METHOD( StaticObject ); +CLIO_METHOD( Value ); +CLIO_METHOD( UnknownOut ); +CLIO_METHOD( UnknownIn ); +CLIO_METHOD( Static ); +CLIO_METHOD( operator == ); +CLIO_METHOD_IMPORT( Global ); +} + +void Test() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "testObject := Test TestWrapper clone" ); + + // calls to static and global functions + TestString( state, "testObject static" ); + TestString( state, "Test TestWrapper static" ); + TestString( state, "Test TestWrapper global(1)" ); + + std::cout << "expecting error:\n"; + TestString( state, "Test TestWrapper double(12)" ); + + // test unknown object tunneling + TestString( state, "testObject unknownIn( testObject unknownOut() )" ); + TestString( state, "writeln( testObject add(1,2) )" ); + + TestString( state, "writeln( testObject convert(\"har\") )" ); + std::cout << "expecting error:\n"; + TestString( state, "testObject double" ); + TestString( state, "writeln( testObject double(13) )" ); + std::cout << "expecting error:\n"; + TestString( state, "writeln( testObject double(\"har\") )" ); + TestString( state, "writeln( testObject len(\"har\") )" ); + TestString( state, "writeln( testObject lenConst(\"har\") )" ); + TestString( state, "writeln( testObject nop(\"har\") )" ); + TestString( state, "writeln( testObject convert(\"har\") )" ); + + TestString( state, "s := Clio String with( \"har\")" ); + TestString( state, "writeln( s )" ); + TestString( state, "writeln( testObject convert2( s ) )" ); + TestString( state, "writeln( s )" ); + TestString( state, "writeln( testObject len(s) )" ); + + TestString( state, "writeln( testObject ptr( testObject ) )" ); + + // test creating objects + TestString( state, "writeln( testObject create(0))" ); + TestString( state, "writeln( testObject create(2) get())" ); + + // test static object + TestString( state, "writeln( testObject staticObject(0))" ); + TestString( state, "writeln( testObject staticObject(0) get())" ); + TestString( state, "testObject staticObject(0) set(1)" ); + TestString( state, "writeln( testObject staticObject(0) get())" ); + TestString( state, "writeln( testObject staticObject(0) access())" ); + + TestString( state, "writeln( testObject access() set(10) )" ); + TestString( state, "writeln( testObject get())" ); + + // test return by value + TestString( state, "writeln( testObject )\n" + "writeln( testObject value( testObject ))" ); + + // test comparison + TestString( state, "( testObject == (Test TestWrapper clone) ) println" ); + TestString( state, "( testObject == (Test TestWrapper clone set(10) ) ) println" ); +} Copied: clio/trunk/clio/tests/basic.test/basic.io (from rev 8098, clio/trunk/clio/tests/basic.test/test.io) =================================================================== Deleted: clio/trunk/clio/tests/basic.test/test.cpp =================================================================== --- clio/trunk/clio/tests/basic.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) +++ clio/trunk/clio/tests/basic.test/test.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -1,181 +0,0 @@ -#include "helptest.hpp" - -// **************************** -// basic method wrapping -// **************************** - -class Namespace{}; - -CLIO_CLASS_EX( Namespace, "Test" ) -{ -} - -class TestPrivate -{ -public: - TestPrivate( int, char, std::string ); -private: - TestPrivate(); - TestPrivate( TestPrivate const & ); -}; - -CLIO_CLASS_SET_DEFAULTCONSTRUCTOR( TestPrivate, false ); -CLIO_CLASS_SET_COPYCONSTRUCTOR( TestPrivate, false ); - -CLIO_CLASS( TestPrivate ){} - -class TestWrapper -{ -public: - TestWrapper() - : value_( 0 ) - {} - - void Default( int i=0 ) {} - void Default2( int i=0 ) {} - void Default3( int i=0 ) {} - void Default4( int i=0 ) {} - void Set( int i ) { value_ = i; } - int Get() const { return value_; } - int & Access() { return value_; } - - int Add( int i, int j ) { return i + j; } - - int Double( int i ) { return 2 * i; } - int Len( std::string s ) { return s.size(); } - int Len( std::string s ) const { return s.size(); } - char const * Convert( std::string const & s ) { return s.c_str(); } - std::string const & Convert2( std::string & s ) { s = s + s; return s; } - TestWrapper const * Ptr2( TestWrapper * s ) { return s; } - - bool NOP( std::string const & s ) { return false; } - void Ptr( TestWrapper * s ) {} - - // comparison - bool operator==( TestWrapper const & other ) const - { - return value_ == other.value_; - } - - static void Static() {} - - // pointer return values are wrapped in Io - TestWrapper * Create( int i ) - { - TestWrapper * wrapper = new TestWrapper(); - wrapper->Set( i ); - return wrapper; - } - - // returned references are handled like pointers, but ownership is not transferred to Io - TestWrapper & StaticObject( int ) - { - static TestWrapper wrapper; - return wrapper; - } - - // return by value has no other chance than to clone the object - TestWrapper Value( TestWrapper w ) { return w; } - - // unknown classes - UnknownClass & UnknownOut() { static UnknownClass s; return s; } - void UnknownIn( UnknownClass & ) {} -private: - int value_; -}; - -int Global(int){ return 0; } - -class Dummy{}; - -CLIO_CLASS( TestWrapper ) -{ -CLIO_CLASS_NESTED_IN( Namespace ); -CLIO_METHOD( Default ); -CLIO_METHOD( Default2 ); -CLIO_METHOD( Default3 ); -CLIO_METHOD( Default4 ); -CLIO_METHOD( Set ); -CLIO_METHOD( Get ); -CLIO_METHOD( Access ); -CLIO_METHOD( Double ); -CLIO_METHOD( Add ); -// this is how you can handle overloaded functions: pass the function pointer type as second argument and the desired function name as thrid. -CLIO_METHOD_EX( Len,(int(TestWrapper::*)(std::string)),"len"); -CLIO_METHOD_EX( Len,(int(TestWrapper::*)(std::string) const),"lenConst"); -CLIO_METHOD( NOP ); -CLIO_METHOD( Convert ); -CLIO_METHOD( Convert2 ); -CLIO_METHOD( Ptr ); -CLIO_METHOD( Ptr2 ); -CLIO_METHOD( Create ).TransferOwnership(); -CLIO_METHOD( StaticObject ); -CLIO_METHOD( Value ); -CLIO_METHOD( UnknownOut ); -CLIO_METHOD( UnknownIn ); -CLIO_METHOD( Static ); -CLIO_METHOD( operator == ); -CLIO_METHOD_IMPORT( Global ); -} - -void Test() -{ - clio::State state; - - clio::IStateRegistrator::RegisterAll( state ); - - TestString( state, "testObject := Test TestWrapper clone" ); - - // calls to static and global functions - TestString( state, "testObject static" ); - TestString( state, "Test TestWrapper static" ); - TestString( state, "Test TestWrapper global(1)" ); - - std::cout << "expecting error:\n"; - TestString( state, "Test TestWrapper double(12)" ); - - // test unknown object tunneling - TestString( state, "testObject unknownIn( testObject unknownOut() )" ); - TestString( state, "writeln( testObject add(1,2) )" ); - - TestString( state, "writeln( testObject convert(\"har\") )" ); - std::cout << "expecting error:\n"; - TestString( state, "testObject double" ); - TestString( state, "writeln( testObject double(13) )" ); - std::cout << "expecting error:\n"; - TestString( state, "writeln( testObject double(\"har\") )" ); - TestString( state, "writeln( testObject len(\"har\") )" ); - TestString( state, "writeln( testObject lenConst(\"har\") )" ); - TestString( state, "writeln( testObject nop(\"har\") )" ); - TestString( state, "writeln( testObject convert(\"har\") )" ); - - TestString( state, "s := Clio String with( \"har\")" ); - TestString( state, "writeln( s )" ); - TestString( state, "writeln( testObject convert2( s ) )" ); - TestString( state, "writeln( s )" ); - TestString( state, "writeln( testObject len(s) )" ); - - TestString( state, "writeln( testObject ptr( testObject ) )" ); - - // test creating objects - TestString( state, "writeln( testObject create(0))" ); - TestString( state, "writeln( testObject create(2) get())" ); - - // test static object - TestString( state, "writeln( testObject staticObject(0))" ); - TestString( state, "writeln( testObject staticObject(0) get())" ); - TestString( state, "testObject staticObject(0) set(1)" ); - TestString( state, "writeln( testObject staticObject(0) get())" ); - TestString( state, "writeln( testObject staticObject(0) access())" ); - - TestString( state, "writeln( testObject access() set(10) )" ); - TestString( state, "writeln( testObject get())" ); - - // test return by value - TestString( state, "writeln( testObject )\n" - "writeln( testObject value( testObject ))" ); - - // test comparison - TestString( state, "( testObject == (Test TestWrapper clone) ) println" ); - TestString( state, "( testObject == (Test TestWrapper clone set(10) ) ) println" ); -} Deleted: clio/trunk/clio/tests/basic.test/test.io =================================================================== Copied: clio/trunk/clio/tests/classname.test/classname.cpp (from rev 8098, clio/trunk/clio/tests/classname.test/test.cpp) =================================================================== --- clio/trunk/clio/tests/classname.test/classname.cpp (rev 0) +++ clio/trunk/clio/tests/classname.test/classname.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -0,0 +1,55 @@ +#include "helptest.hpp" + +// **************************** +// classname determination +// **************************** + +namespace test +{ + class TestName + { + }; + + class TestName2 + { + }; +} +using namespace test; + +template<int X> class TemplateTest3{}; +template<class T1, class T2> class TemplateTest2{}; + +CLIO_C_CLASSNAME(TestName); +CLIO_TEMPLATENAME(TemplateTest3, (1,(int)) ); +CLIO_TEMPLATENAME(TemplateTest2, (2,(class,class)) ); + +template< class T > +void Name() +{ + std::cout << __PRETTY_FUNCTION__ << "\n"; +} + +template< class T > +void Fun() +{ + std::cout << __PRETTY_FUNCTION__ << "\n"; +} + +template< int T > +void Fun() +{ + std::cout << __PRETTY_FUNCTION__ << "\n"; +} + +void Test() +{ + Name< TemplateTest3<1> >(); + Fun< TemplateTest3<1> >(); + Fun< 2 >(); + + std::cout << clio::GetTypeName< std::string >() << "\n"; + std::cout << clio::GetTypeName< TestName const >() << "\n"; + std::cout << clio::GetTypeName< TemplateTest3< 1 > * >() << "\n"; + std::cout << clio::GetTypeName< TemplateTest2< TestName, char > * >() << "\n"; +} + Copied: clio/trunk/clio/tests/classname.test/classname.io (from rev 8098, clio/trunk/clio/tests/classname.test/test.io) =================================================================== Deleted: clio/trunk/clio/tests/classname.test/test.cpp =================================================================== --- clio/trunk/clio/tests/classname.test/test.cpp 2008-02-25 00:40:57 UTC (rev 8098) +++ clio/trunk/clio/tests/classname.test/test.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -1,55 +0,0 @@ -#include "helptest.hpp" - -// **************************** -// classname determination -// **************************** - -namespace test -{ - class TestName - { - }; - - class TestName2 - { - }; -} -using namespace test; - -template<int X> class TemplateTest3{}; -template<class T1, class T2> class TemplateTest2{}; - -CLIO_C_CLASSNAME(TestName); -CLIO_TEMPLATENAME(TemplateTest3, (1,(int)) ); -CLIO_TEMPLATENAME(TemplateTest2, (2,(class,class)) ); - -template< class T > -void Name() -{ - std::cout << __PRETTY_FUNCTION__ << "\n"; -} - -template< class T > -void Fun() -{ - std::cout << __PRETTY_FUNCTION__ << "\n"; -} - -template< int T > -void Fun() -{ - std::cout << __PRETTY_FUNCTION__ << "\n"; -} - -void Test() -{ - Name< TemplateTest3<1> >(); - Fun< TemplateTest3<1> >(); - Fun< 2 >(); - - std::cout << clio::GetTypeName< std::string >() << "\n"; - std::cout << clio::GetTypeName< TestName const >() << "\n"; - std::cout << clio::GetTypeName< TemplateTest3< 1 > * >() << "\n"; - std::cout << clio::GetTypeName< TemplateTest2< TestName, char > * >() << "\n"; -} - Deleted: clio/trunk/clio/tests/classname.test/test.io =================================================================== Copied: clio/trunk/clio/tests/codesize.test/codesize.cpp (from rev 8098, clio/trunk/clio/tests/codesize.test/test.cpp) =================================================================== --- clio/trunk/clio/tests/codesize.test/codesize.cpp (rev 0) +++ clio/trunk/clio/tests/codesize.test/codesize.cpp 2008-02-25 00:43:09 UTC (rev 8099) @@ -0,0 +1,1215 @@ +#include "helptest.hpp" + +// code size test +//#undef CLIO_METHOD_EX +//#define CLIO_METHOD_EX(a,b,c) CLIO_FORCESEMICOLON() +//#undef CLIO_VIRTUALS +//#define CLIO_VIRTUALS(a) CLIO_FORCESEMICOLON() +//#undef CLIO_CONSTRUCTOR_CUSTOM_EX +//#define CLIO_CONSTRUCTOR_CUSTOM_EX(a,b) - 1 + +// using namespace clio; + +// #ifdef NDEBUG + +#define TEST1 +#define TEST2 +#define TEST3 +#define TEST4 +#define TEST5 +#define TEST6 +#define TEST7 +#define TEST8 +//#define TEST9 +//#define TEST10 +//#define TEST11 + +// #endif + +#define CLIO_FUNCTION_NAME V +#include <clio/virtual.hpp> + +bool runTests = false; + +void BreakPoint() +{ + runTests = true; +} + +#ifdef TEST1 +// **************************** +// basic method wrapping +// **************************** + +// CLIO_CLASS_ASVALUE( UnknownClass ) + +class Namespace{}; + + + +CLIO_CLASS_EX( Namespace, "Test" ) +{ +} + +class TestWrapper +{ +public: + TestWrapper() + : value_( 0 ) + {} + + void Default( int i=0 ) {} + void Default2( int i=0 ) {} + void Default3( int i=0 ) {} + void Default4( int i=0 ) {} + void Set( int i ) { value_ = i; } + int Get() const { return value_; } + int & Access() { return value_; } + + int Add( int i, int j ) { return i + j; } + + int Double( int i ) { return 2 * i; } + int Len( std::string s ) { return s.size(); } + int Len( std::string s ) const { return s.size(); } + char const * Convert( std::string const & s ) { return s.c_str(); } + std::string const & Convert2( std::string & s ) { return s; } + TestWrapper const * Ptr2( TestWrapper * s ) { return s; } + + bool NOP( std::string const & s ) { return false; } + void Ptr( TestWrapper * s ) {} + + static void Static() {} + + // pointer return values are wrapped in Io, and Io takes ownership of the + // object by default + TestWrapper * Create( int i ) + { + TestWrapper * wrapper = new TestWrapper(); + wrapper->Set( i ); + return wrapper; + } + + // returned references are handled like pointers, but ownership is not transferred to Io + TestWrapper & StaticObject( int ) + { + static TestWrapper wrapper; + return wrapper; + } + + // return by value has no other chance than to clone the object + TestWrapper Value( TestWrapper w ) { return w; } + + // unknown classes + UnknownClass & UnknownOut() { static UnknownClass s; return s; } + void UnknownIn( UnknownClass & ) {} +private: + int value_; +}; + +int Global(int){ return 0; } + +class Dummy{}; + +CLIO_CLASS( TestWrapper ) +{ +CLIO_CLASS_NESTED_IN( Namespace ); +CLIO_METHOD( Default ); +CLIO_METHOD( Default2 ); +CLIO_METHOD( Default3 ); +CLIO_METHOD( Default4 ); +CLIO_METHOD( Set ); +CLIO_METHOD( Get ); +CLIO_METHOD( Access ); +CLIO_METHOD( Double ); +CLIO_METHOD( Add ); +// this is how you can handle overloaded functions: pass the function pointer type as second argument and the desired function name as thrid. +CLIO_METHOD_EX( Len,(int(TestWrapper::*)(std::string)),"len"); +CLIO_METHOD_EX( Len,(int(TestWrapper::*)(std::string) const),"lenConst"); +CLIO_METHOD( NOP ); +CLIO_METHOD( Convert ); +CLIO_METHOD( Convert2 ); +CLIO_METHOD( Ptr ); +CLIO_METHOD( Ptr2 ); +CLIO_METHOD( Create ); +CLIO_METHOD( StaticObject ); +CLIO_METHOD( Value ); +CLIO_METHOD( UnknownOut ); +CLIO_METHOD( UnknownIn ); +CLIO_METHOD( Static ); +CLIO_METHOD_IMPORT( Global ); +} + +void test1() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "testObject := Test TestWrapper clone" ); + + // calls to static and global functions + TestString( state, "testObject static" ); + TestString( state, "Test TestWrapper static" ); + TestString( state, "Test TestWrapper global(1)" ); + + std::cout << "expecting error:\n"; + TestString( state, "Test TestWrapper double(12)" ); + + // test unknown object tunneling + TestString( state, "writeln( testObject unknownIn( testObject unknownOut() ))" ); + TestString( state, "writeln( testObject add(1,2) )" ); + + TestString( state, "writeln( testObject convert(\"har\") )" ); + std::cout << "expecting error:\n"; + TestString( state, "testObject double" ); + TestString( state, "writeln( testObject double(13) )" ); + std::cout << "expecting error:\n"; + TestString( state, "writeln( testObject double(\"har\") )" ); + TestString( state, "writeln( testObject len(\"har\") )" ); + TestString( state, "writeln( testObject lenConst(\"har\") )" ); + TestString( state, "writeln( testObject nop(\"har\") )" ); + TestString( state, "writeln( testObject convert(\"har\") )" ); + TestString( state, "writeln( testObject ptr( testObject ) )" ); + + // test creating objects + TestString( state, "writeln( testObject create(0))" ); + TestString( state, "writeln( testObject create(2) get())" ); + + // test static object + TestString( state, "writeln( testObject staticObject(0))" ); + TestString( state, "writeln( testObject staticObject(0) get())" ); + TestString( state, "testObject staticObject(0) set(1)" ); + TestString( state, "writeln( testObject staticObject(0) get())" ); + TestString( state, "writeln( testObject staticObject(0) access())" ); + + TestString( state, "writeln( testObject access() set(10) )" ); + TestString( state, "writeln( testObject get())" ); + + // test return by value + TestString( state, "writeln( testObject )\n" + "writeln( testObject value( testObject ))" ); + + + std::cout << "\n************* Test 1 finished ***************\n\n"; +} + +#endif + + +#ifdef TEST2 +// **************************** +// basic inheritance +// **************************** + +class TestBase +{ +public: + virtual void LifeSign( int ) { std::cout << "TestBase here!\n"; } + void Ptr( TestBase * ptr ) { std::cout << "PTR:"; ptr->LifeSign(0); } + virtual ~TestBase() {} + char const * Convert( std::string const & s ) { return s.c_str(); } +}; + +class Scratch +{ +public: + virtual ~Scratch(){} +private: + int x; +}; + +class Scratch2 +{ +public: + virtual ~Scratch2(){} +private: + int x; +}; + +class TestDerived: public Scratch, public TestBase, public Scratch2 +{ +public: + virtual void LifeSign( int ) { std::cout << "TestDerived here!\n"; } + TestBase const * This( void * ) { return this; } +}; + +CLIO_CLASS( TestBase ) +{ +// methods go here +CLIO_METHOD( LifeSign ); +CLIO_METHOD( Ptr ); +//CLIO_METHOD( Convert ); +} + +CLIO_CLASS( TestDerived ) +{ +// register base class(es?), if any +CLIO_CLASS_BASE( TestBase ); +CLIO_METHOD( This ); +// methods go here +// CLIO_METHOD( LifeSign ); +} + +void test2() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "TestBase clone lifeSign(1) " ); + TestString( state, "TestDerived clone lifeSign(1) " ); + TestString( state, "TestDerived clone ptr(TestBase clone)" ); + TestString( state, "TestBase clone ptr(TestDerived clone)" ); + + // testing automatic downcasts; note that This() returs a TestBase *, yet a method of TestDerived is accessible. + TestString( state, "TestDerived clone this(0) this(0) lifeSign(1)" ); + + std::cout << "\n************* Test 2 finished ***************\n\n"; +} + +#endif + +#ifdef TEST3 + +// **************************** +// multiple inheritance +// **************************** + +class Grinder +{ +public: + virtual void Grind( void * ) const = 0; + virtual ~Grinder(){}; +}; + +CLIO_ABSTRACT_CLASS( Grinder ) +{ +// register base class(es?), if any +// methods go here +CLIO_METHOD( Grind ); +} + +class ElectricGrinder: public virtual Grinder +{ +public: + virtual void Grind( void * ) const { std::cout << "Electric grinding.\n"; } +}; + +CLIO_CLASS( ElectricGrinder ) +{ +// register base class(es?), if any +CLIO_CLASS_BASE( Grinder ); +} + +class CoffeeGrinder: public virtual Grinder +{ +public: + virtual void Grind( void * ) const { std::cout << "Grinding of coffee.\n"; } +}; + +CLIO_CLASS( CoffeeGrinder ) +{ +// register base class(es?), if any +CLIO_CLASS_BASE( Grinder ); +} + +class ElectricCoffeeGrinder: public virtual ElectricGrinder, public virtual CoffeeGrinder +{ +public: + virtual void Grind( void * ) const { std::cout << "Electric grinding of coffee.\n"; } +}; + +CLIO_CLASS( ElectricCoffeeGrinder ) +{ +// register base class(es?), if any +CLIO_CLASS_BASE( ElectricGrinder ); +CLIO_CLASS_BASE( CoffeeGrinder ); +} + +void test3() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + + std::cout << "expecting error:\n"; + TestString( state, "Grinder clone grind(0)" ); + TestString( state, "ElectricGrinder clone grind(0)" ); + TestString( state, "CoffeeGrinder clone grind(0)" ); + TestString( state, "ElectricCoffeeGrinder clone grind(0)" ); + + std::cout << "\n************* Test 3 finished ***************\n\n"; +} +#endif + +#ifdef TEST4 + +// **************************** +// overriding virtual functions +// **************************** + +// class with virtual functions overridable in script +class Extensible +{ +public: + virtual ~Extensible(){}; + + virtual void Function1() + { + std::cout << "Function1 C++\n"; + } + + virtual char const * Function2( char const * s ) const + { + std::cout << "Function2 in C++:" << s << "\n"; return s; + } + + // call the virtual functions to test them + void CallVirtuals() + { + Function1(); + Function2( "test" ); + } +}; + +// make functions with name Function1 and Function2 overridable +#define CLIO_FUNCTION_NAME Function1 +#include <clio/virtual.hpp> + +#define CLIO_FUNCTION_NAME Function2 +#include <clio/virtual.hpp> + +CLIO_CLASS( Extensible ) +{ +CLIO_METHOD( CallVirtuals ); +CLIO_VIRTUALS( + CLIO_EXTEND( Function1 ) + CLIO_EXTEND( Function2 ) + ); +} + +// class with virtual functions overridable in script +class Overridable +{ +public: + virtual ~Overridable(){}; + + virtual void Function1() = 0; + virtual void UnknownIn( UnknownClass & ){} + + // call the virtual functions to test them + void CallVirtuals() + { + Function1(); + } +}; + +#define CLIO_FUNCTION_NAME UnknownIn +#include <clio/virtual.hpp> + +CLIO_ABSTRACT_CLASS( Overridable ) +{ +CLIO_METHOD( CallVirtuals ); +CLIO_VIRTUALS( + CLIO_OVERRIDE( Function1 ) + CLIO_OVERRIDE( UnknownIn ) +); +} + +void test4() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "Extended := Extensible clone" ); + TestString( state, "testObject := Extended clone" ); + TestString( state, "testObject function2(\"bla\")" ); + TestString( state, "testObject callVirtuals()" ); + TestString( state, "testObject function1 := method(writeln(\"function1 in script\"))" ); + TestString( state, "testObject function2 := method(s, writeln(\"Function2 in script:\",s) return s)" ); + TestString( state, "testObject callVirtuals()" ); + TestString( state, "testObject function1 := method(writeln(\"function1 in script\") return 1)" ); + TestString( state, "testObject function2 := method(s, writeln(\"Function2 in script:\",s))" ); + std::cout << "Expecting error on failure to convert return value of function2\n"; + TestString( state, "testObject callVirtuals()" ); + + // try to call base implementation. This doesn't seem to work yet. Bummer. +// TestString( state, "Extended function2 := method(s, writeln(\"Function2 in script, hoping to call C++ version as well: \",s) super(function2))" ); + TestString( state, "Extended function2 := method(s, writeln(\"E2\", s) resend)" ); + TestString( state, "testObject := Extended clone" ); + TestString( state, "testObject function2 := method(s, writeln(\"E1\", s) resend)" ); + TestString( state, "testObject function2( \"bla\")" ); + TestString( state, "testObject callVirtuals()" ); + + TestString( state, "testObject := Overridable clone" ); + std::cout << "Expecting error because function1 is pure virtual\n"; + TestString( state, "testObject callVirtuals()" ); + TestString( state, "testObject function1 := method(writeln(\"function1 in script\"))" ); + TestString( state, "testObject callVirtuals()" ); + + std::cout << "\n************* Test 4 finished ***************\n\n"; +} + +#endif + +#ifdef TEST5 + +// **************************** +// templates +// **************************** + +template< class T1, class T2, int I1 > class TemplateTestBase +{ +public: + virtual ~TemplateTestBase(){} + + int h(){ return I1; } + static T1 Create(){ return T1(); } +}; + +template< class T > class TemplateTest: public TemplateTestBase< T, T, 2 > +{ +public: + T f( T in){ return V( in ); } // tests basic function wrapping and virtual calls + virtual T V( T in ){ return in; } // tests virtual calls + + // tests implicit instantiation + TemplateTest< float > g(){ return TemplateTest< float >(); } +}; + +struct TemplateTestHelper: public TemplateTest< clio::IoObjectPointer > +{ + typedef TemplateTest< clio::IoObjectPointer > Base; + + template< class T > + static IoObject * With( T const * dummy ) + { + typedef clio::ClassInfo< TemplateTest< T > > ClassInfo; + return ClassInfo::Get().FetchPrototype().GetSelf(); + } +}; + + +CLIO_CLASS_EX( TemplateTestHelper, "TemplateTest" ) +{ + CLIO_CLASS_BASE( Base ); + + CLIO_OVERLOADED_TEMPLATE_METHOD_EX( With, (1,(int)),, "With" ); + CLIO_OVERLOADED_TEMPLATE_METHOD_EX( With, (1,(std::string)),, "With" ); + CLIO_OVERLOADED_TEMPLATE_METHOD_EX( With, (1,(TemplateTestHelper)),, "With" ); + CLIO_OVERLOADED_TEMPLATE_METHOD_EX( With, (1,(clio::IoObjectPointer)),, "With" ); +} + +CLIO_TEMPLATE_CLASS( TemplateTestBase, (3,(class,class,int))) +{ + CLIO_METHOD( h ); + CLIO_METHOD( Create ); +} + +CLIO_TEMPLATE_CLASS( TemplateTest, (1,(class))) +{ + typedef TemplateTestBase<T1,T1,2> BASE; + CLIO_CLASS_BASE( BASE ); + CLIO_METHOD( f ); + CLIO_METHOD( g ); + CLIO_VIRTUALS( + CLIO_EXTEND(V) + ); +} + +CLIO_INSTANTIATE_TEMPLATE(TemplateTest,(1,(int)),"TemplateTest_int_"); +CLIO_INSTANTIATE_TEMPLATE(TemplateTest,(1,(std::string)),"TemplateTest_string_"); + +void test5() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "testObject := TemplateTest With( Number ) clone" ); + TestString( state, "testObject2 := TemplateTest With( Sequence ) clone" ); + TestString( state, "testObject3 := TemplateTest clone" ); + TestString( state, "writeln(testObject f(1))" ); + TestString( state, "writeln(testObject2 f(\"bla\"))" ); + TestString( state, "testObject2 v = method(s, return s .. s)" ); + TestString( state, "writeln(testObject2 f(\"bla\"))" ); + // note that g is from the base class; the template wrapper for that gets + // autoinstantiated. + TestString( state, "writeln(testObject2 h)" ); + // also, functions that use templates auto-instantiate them + TestString( state, "writeln(testObject2 g() f(1.5))" ); + + // test default instance + TestString( state, "writeln(testObject3 h() )" ); + TestString( state, "writeln(testObject3 create() )" ); + TestString( state, "writeln(TemplateTest With( testObject ) create() )" ); + TestString( state, "writeln(TemplateTest With( TemplateTest ) create() )" ); + TestString( state, "writeln(testObject3 create() )" ); + TestString( state, "writeln(testObject3 v( list(1,2,3) ) )" ); + + std::cout << "\n************* Test 5 finished ***************\n\n"; + +} + +#endif + +#ifdef TEST6 + +// **************************** +// super() and resend +// **************************** + +class SuperTest +{ +public: + virtual ~SuperTest(){} + + void f(){ std::cout << "f in C++\n"; } + void h(){ std::cout << "h in C++\n"; } +protected: + virtual void P(){std::cout << "P in C++\n"; } +private: + virtual void Q(){std::cout << "Q in C++\n"; } +}; + +#define CLIO_FUNCTION_NAME P +#include <clio/virtual.hpp> + +#define CLIO_FUNCTION_NAME Q +#include <clio/virtual.hpp> + +CLIO_CLASS( SuperTest ) +{ +CLIO_METHOD( f ); +CLIO_METHOD( h ); +CLIO_VIRTUALS( + CLIO_EXTEND_PROTECTED( P ) + CLIO_OVERRIDE_PRIVATE( Q, (void (SuperTest::*)(void)) ) +); +} + +void test6() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "testObject := SuperTest clone" ); + TestString( state, "testObject f" ); + TestString( state, "testObject g := method(writeln(\"g\") resend)" ); + TestString( state, "testObject f := method(writeln(\"f in Io\") super(f))" ); + TestString( state, "testObject h := method(writeln(\"h in Io\") resend)" ); + TestString( state, "testObject f" ); + TestString( state, "testObject h" ); + std::cout << "Expecting error\n"; + TestString( state, "testObject g" ); + std::cout << "Expecting error\n"; + TestString( state, "testObject p" ); + TestString( state, "testObject pp := method(p)" ); + std::cout << "Expecting error\n"; + TestString( state, "testObject pp" ); + TestString( state, "testObject p := method(writeln(\"p in io\") resend)" ); + TestString( state, "testObject p" ); + + std::cout << "Expecting error\n"; + TestString( state, "testObject q" ); + + TestString( state, "testObject q := method(writeln(\"q in io\") resend)" ); + std::cout << "Expecting error\n"; + TestString( state, "testObject q" ); + + TestString( state, "testObject q := method(writeln(\"q in io\"))" ); + TestString( state, "testObject q" ); + + std::cout << "\n************* Test 6 finished ***************\n\n"; +} + +#endif + +#ifdef TEST7 + +// **************************** +// return by reference +// **************************** + +class ReturnTest +{ +public: + static std::string & nop( std::string & in ){ return in; } + static std::string & get(){ static std::string safe; return safe; } + static void forward(){} +}; + +CLIO_CLASS(ReturnTest) +{ + CLIO_METHOD(nop); + CLIO_METHOD(get); + // CLIO_METHOD(forward); + // CLIO_INJECTCODE( "y := 2.0" ); +} + +void test7() +{ + clio::State state; + + clio::IStateRegistrator::RegisterAll( state ); + + TestString( state, "y := ReturnTest nop(\"bla\")" ); + TestString( state, "writeln(y .. y)" ); + TestString( state, "x := ReturnTest get" ); + TestString( state, "writeln(\"x =\", x)" ); + TestString( state, "x set(\"blubb\")" ); + TestString( state, "writeln(x .. x)" ); + TestString( state, "writeln(x .. \"bla\")" ); + TestString( state, "writeln(\"bla\" .. x)" ); + TestString( state, "z := x clone" ); + TestString( state, "writeln(\"x =\", x)" ); + TestString( state, "writeln(\"z =\", x)" ); + TestString( state, "x set(\"bla\")" ); + TestString( state, "writeln(\"x =\", x)" ); + TestString( state, "writeln(\"z =\", x)" ); + std::cout << "expecting error\n"; + TestString( state, "z set(\"bla\")" ); + + std::cout << "\n************* Test 7 finished ***************\n\n"; +} + +// clio::CodeInjection bla( clio::ClassInfo< ReturnTest >::Get(), "y := 1.0" ); + +#endif + +#ifdef TEST8 + +// **************************** +// non-default constructors +// **************************** + +namespace CT +{ + + +class ConstructTest1 +{ +public: + + ConstructTest1( char const * val ) + { + BreakPoint(); + std::cout << val << "\n"; + val_ = val; + } + + std::string V() const { return val_; } + + ~ConstructTest1(){ BreakPoint(); } +protected: +private: + ConstructTest1(){ BreakPoint(); } + ConstructTest1( const ConstructTest1 & ){} + std::string val_; +}; + +class ConstructTest2 +{ +public: + + ConstructTest2( char const * val ) + { + std::cout << val << "\n"; + val_ = val; + } + + virtual std::string V() const { return val_; } + + virtual ~ConstructTest2(){}; +protected: + ConstructTest2(){ BreakPoint(); } +private: + ConstructTest2( const ConstructTest2 & ){}; + std::string val_; +}; + +} + +// using CT::ConstructTest; +using CT::ConstructTest1; + +CLIO_CLASS_SET_DEFAULTCONSTRUCTOR( ConstructTest1, false ); +CLIO_CLASS_SET_COPYCONSTRUCTOR( ConstructTest1, false ); +CLIO_CLASS_SET_POLYMORPHIC( ConstructTest1, false ); + +CLIO_CLASS_SET_DEFAULTCONSTRUCTOR( CT::ConstructTest2, false ); +CLIO_CLASS_SET_COPYCONSTRUCTOR( CT::ConstructTest2, false ); + +CLIO_CLASS(ConstructTest1) +{ + CLIO_METHOD(V); + + // constructors are registered via their signatures + CLIO_CONSTRUCTOR_CUSTOM( (1,(char const *)) ); +} + +CLIO_CLASS_EX(CT::ConstructTest2, "") +{ + CLIO_VIRTUALS( + CLIO_EXTEND(V) + + // in classes where virtual functions are overridden, + // constructors need to be at the end of the CLIO_VIRTUALS + // block + CLIO_CONSTRUCTOR_CUSTOM( (1,(char const *)) ) + CLIO_CONSTRUCTOR_CUSTOM_EX( (1,(char const *)),"with2" ) + ); +} + +void test8() +{ + cl... [truncated message content] |
From: <baz...@us...> - 2008-02-25 00:44:36
|
Revision: 8100 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8100&view=rev Author: bazaarmagetron Date: 2008-02-24 16:44:40 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: also moved io source files. Added Paths: ----------- clio/trunk/clio/tests/adhoc.test/adhoc.test.io clio/trunk/clio/tests/basic.test/basic.test.io clio/trunk/clio/tests/classname.test/classname.test.io clio/trunk/clio/tests/codesize.test/codesize.test.io clio/trunk/clio/tests/constructor.test/constructor.test.io clio/trunk/clio/tests/container.test/container.test.io clio/trunk/clio/tests/conversion.test/conversion.test.io clio/trunk/clio/tests/crash.test/crash.test.io clio/trunk/clio/tests/enum.test/enum.test.io clio/trunk/clio/tests/inheritance.test/inheritance.test.io clio/trunk/clio/tests/membervariables.test/membervariables.test.io clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.test.io clio/trunk/clio/tests/namespace.test/namespace.test.io clio/trunk/clio/tests/overloads.test/overloads.test.io clio/trunk/clio/tests/proto.test/proto.test.io clio/trunk/clio/tests/reference.test/reference.test.io clio/trunk/clio/tests/security.test/security.test.io clio/trunk/clio/tests/simple.test/simple.test.io clio/trunk/clio/tests/smartpointer.test/smartpointer.test.io clio/trunk/clio/tests/stack.test/stack.test.io clio/trunk/clio/tests/super.test/super.test.io clio/trunk/clio/tests/templates.test/templates.test.io clio/trunk/clio/tests/virtual.test/virtual.test.io Removed Paths: ------------- clio/trunk/clio/tests/adhoc.test/adhoc.io clio/trunk/clio/tests/basic.test/basic.io clio/trunk/clio/tests/classname.test/classname.io clio/trunk/clio/tests/codesize.test/codesize.io clio/trunk/clio/tests/constructor.test/constructor.io clio/trunk/clio/tests/container.test/container.io clio/trunk/clio/tests/conversion.test/conversion.io clio/trunk/clio/tests/crash.test/crash.io clio/trunk/clio/tests/enum.test/enum.io clio/trunk/clio/tests/inheritance.test/inheritance.io clio/trunk/clio/tests/membervariables.test/membervariables.io clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.io clio/trunk/clio/tests/namespace.test/namespace.io clio/trunk/clio/tests/overloads.test/overloads.io clio/trunk/clio/tests/proto.test/proto.io clio/trunk/clio/tests/reference.test/reference.io clio/trunk/clio/tests/security.test/security.io clio/trunk/clio/tests/simple.test/simple.io clio/trunk/clio/tests/smartpointer.test/smartpointer.io clio/trunk/clio/tests/stack.test/stack.io clio/trunk/clio/tests/super.test/super.io clio/trunk/clio/tests/templates.test/templates.io clio/trunk/clio/tests/virtual.test/virtual.io Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 23:41:47.381999969 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 23:48:48.727999926 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - tests/helptest.hpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:helptest.hpp tests/codesize.test/codesize.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcodesize.test%2Ftest.cpp tests/codesize.test/codesize.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcodesize.test%2Ftest.io tests/conversion.test/conversion.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconversion.test%2Ftest.io tests/conversion.test/conversion.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconversion.test%2Ftest.cpp tests/super.test/super.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsuper.test%2Ftest.cpp tests/super.test/super.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsuper.test%2Ftest.io tests/templates.test/templates.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Ftemplates.test%2Ftest.cpp tests/templates.test/templates.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Ftemplates.test%2Ftest.io tests/security.test/security.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsecurity.test%2Ftest.io tests/security.test/security.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsecurity.test%2Ftest.cpp tests/inheritance.test/inheritance.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Finheritance.test%2Ftest.cpp tests/inheritance.test/inheritance.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Finheritance.test%2Ftest.io tests/overloads.test/overloads.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Foverloads.test%2Ftest.cpp tests/overloads.test/overloads.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Foverloads.test%2Ftest.io tests/reference.test/reference.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Freference.test%2Ftest.io tests/reference.test/reference.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Freference.test%2Ftest.cpp tests/membervariables.test/membervariables.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmembervariables.test%2Ftest.cpp tests/membervariables.test/membervariables.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmembervariables.test%2Ftest.io tests/smartpointer.test/smartpointer.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsmartpointer.test%2Ftest.io tests/smartpointer.test/smartpointer.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsmartpointer.test%2Ftest.cpp tests/simple.test/simple.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsimple.test%2Ftest.io tests/simple.test/simple.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsimple.test%2Ftest.cpp tests/virtual.test/virtual.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fvirtual.test%2Ftest.io tests/virtual.test/virtual.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fvirtual.test%2Ftest.cpp tests/multiple_inheritance.test/multiple_inheritance.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiple_inheritance.test%2Ftest.cpp tests/multiple_inheritance.test/multiple_inheritance.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiple_inheritance.test%2Ftest.io tests/proto.test/proto.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fproto.test%2Ftest.cpp tests/proto.test/proto.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fproto.test%2Ftest.io tests/constructor.test/constructor.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconstructor.test%2Ftest.cpp tests/constructor.test/constructor.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconstructor.test%2Ftest.io tests/basic.test/basic.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fbasic.test%2Ftest.cpp tests/basic.test/basic.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fbasic.test%2Ftest.io tests/namespace.test/namespace.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest.cpp tests/namespace.test/namespace.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest.io tests/crash.test/crash.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcrash.test%2Ftest.cpp tests/crash.test/crash.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcrash.test%2Ftest.io tests/enum.test/enum.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fenum.test%2Ftest.io tests/enum.test/enum.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fenum.test%2Ftest.cpp tests/adhoc.test/adhoc.io test.io-20080224110352-ktp2lx7tt5risuzd-4 tests/adhoc.test/adhoc.cpp test.cpp-20080224110352-ktp2lx7tt5risuzd-3 tests/classname.test/classname.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fclassname.test%2Ftest.cpp tests/classname.test/classname.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fclassname.test%2Ftest.io tests/container.test/container.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcontainer.test%2Ftest.cpp tests/container.test/container.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcontainer.test%2Ftest.io tests/stack.test/stack.cpp 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fstack.test%2Ftest.cpp tests/stack.test/stack.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fstack.test%2Ftest.io + tests/codesize.test/codesize.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcodesize.test%2Ftest.io tests/conversion.test/conversion.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconversion.test%2Ftest.io tests/super.test/super.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsuper.test%2Ftest.io tests/templates.test/templates.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Ftemplates.test%2Ftest.io tests/security.test/security.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsecurity.test%2Ftest.io tests/inheritance.test/inheritance.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Finheritance.test%2Ftest.io tests/overloads.test/overloads.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Foverloads.test%2Ftest.io tests/reference.test/reference.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Freference.test%2Ftest.io tests/membervariables.test/membervariables.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmembervariables.test%2Ftest.io tests/smartpointer.test/smartpointer.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsmartpointer.test%2Ftest.io tests/simple.test/simple.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsimple.test%2Ftest.io tests/virtual.test/virtual.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fvirtual.test%2Ftest.io tests/multiple_inheritance.test/multiple_inheritance.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiple_inheritance.test%2Ftest.io tests/proto.test/proto.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fproto.test%2Ftest.io tests/constructor.test/constructor.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconstructor.test%2Ftest.io tests/basic.test/basic.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fbasic.test%2Ftest.io tests/namespace.test/namespace.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest.io tests/crash.test/crash.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcrash.test%2Ftest.io tests/enum.test/enum.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fenum.test%2Ftest.io tests/adhoc.test/adhoc.test.io test.io-20080224110352-ktp2lx7tt5risuzd-4 tests/classname.test/classname.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fclassname.test%2Ftest.io tests/container.test/container.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcontainer.test%2Ftest.io tests/stack.test/stack.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fstack.test%2Ftest.io Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar Deleted: clio/trunk/clio/tests/adhoc.test/adhoc.io =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/adhoc.test/adhoc.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,21 +0,0 @@ -x := T clone -r := x ref -x ref println -x ref type println -r set(1) -x ref println -r asNumber println - -x acceptsReference(1) - -ttest := TTest With(Clio Int) clone -ttest type println -ttest = TTest_int clone -ttest type println - -x type println -i := Clio Int clone -i type println -i println -x acceptsValue(i) - Copied: clio/trunk/clio/tests/adhoc.test/adhoc.test.io (from rev 8099, clio/trunk/clio/tests/adhoc.test/adhoc.io) =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.test.io (rev 0) +++ clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,21 @@ +x := T clone +r := x ref +x ref println +x ref type println +r set(1) +x ref println +r asNumber println + +x acceptsReference(1) + +ttest := TTest With(Clio Int) clone +ttest type println +ttest = TTest_int clone +ttest type println + +x type println +i := Clio Int clone +i type println +i println +x acceptsValue(i) + Deleted: clio/trunk/clio/tests/basic.test/basic.io =================================================================== Copied: clio/trunk/clio/tests/basic.test/basic.test.io (from rev 8099, clio/trunk/clio/tests/basic.test/basic.io) =================================================================== Deleted: clio/trunk/clio/tests/classname.test/classname.io =================================================================== Copied: clio/trunk/clio/tests/classname.test/classname.test.io (from rev 8099, clio/trunk/clio/tests/classname.test/classname.io) =================================================================== Deleted: clio/trunk/clio/tests/codesize.test/codesize.io =================================================================== Copied: clio/trunk/clio/tests/codesize.test/codesize.test.io (from rev 8099, clio/trunk/clio/tests/codesize.test/codesize.io) =================================================================== Deleted: clio/trunk/clio/tests/constructor.test/constructor.io =================================================================== Copied: clio/trunk/clio/tests/constructor.test/constructor.test.io (from rev 8099, clio/trunk/clio/tests/constructor.test/constructor.io) =================================================================== Deleted: clio/trunk/clio/tests/container.test/container.io =================================================================== --- clio/trunk/clio/tests/container.test/container.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/container.test/container.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,25 +0,0 @@ -x := TestVector clone -ints := x accessInts -ints append(1) -x getInts -ints append(2) -ints size() println -ints at(0) println -ints at(1) println -ints foreach(println) -ints foreach(v, v println) -ints foreach(i, v, writeln(i, ":", v) ) -i2 := ints clone -i2 append(3) -ints foreach(println) - -x getInts foreach(println) - -ints pop println -ints pop println - -x createFloats() - -x setInts( Std Vector With(Clio Int) clone append(5) ) -x getInts foreach(println) - Copied: clio/trunk/clio/tests/container.test/container.test.io (from rev 8099, clio/trunk/clio/tests/container.test/container.io) =================================================================== --- clio/trunk/clio/tests/container.test/container.test.io (rev 0) +++ clio/trunk/clio/tests/container.test/container.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,25 @@ +x := TestVector clone +ints := x accessInts +ints append(1) +x getInts +ints append(2) +ints size() println +ints at(0) println +ints at(1) println +ints foreach(println) +ints foreach(v, v println) +ints foreach(i, v, writeln(i, ":", v) ) +i2 := ints clone +i2 append(3) +ints foreach(println) + +x getInts foreach(println) + +ints pop println +ints pop println + +x createFloats() + +x setInts( Std Vector With(Clio Int) clone append(5) ) +x getInts foreach(println) + Deleted: clio/trunk/clio/tests/conversion.test/conversion.io =================================================================== Copied: clio/trunk/clio/tests/conversion.test/conversion.test.io (from rev 8099, clio/trunk/clio/tests/conversion.test/conversion.io) =================================================================== Deleted: clio/trunk/clio/tests/crash.test/crash.io =================================================================== --- clio/trunk/clio/tests/crash.test/crash.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/crash.test/crash.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,25 +0,0 @@ -callGC := method( for(a,0,1000,blarg := a clone ) ) - -// crash test 1: get an inner object of another object -getInner := method( y := Y clone(); return y getInner() ) -innerX := getInner() - -// wait for the original to expired -callGC() - -// and try to use the inner object -innerX test() - -// next attempt, reference to inner integers -getInner2 := method( y := Y clone(); return y getInner() getInt() ) -innerInt := getInner2() - -innerInt set(3) -innerInt println - -callGC() - -// try to access an inner integer after the main object (hopefully not!) expired -innerInt println -innerInt set(2) -innerInt println Copied: clio/trunk/clio/tests/crash.test/crash.test.io (from rev 8099, clio/trunk/clio/tests/crash.test/crash.io) =================================================================== --- clio/trunk/clio/tests/crash.test/crash.test.io (rev 0) +++ clio/trunk/clio/tests/crash.test/crash.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,25 @@ +callGC := method( for(a,0,1000,blarg := a clone ) ) + +// crash test 1: get an inner object of another object +getInner := method( y := Y clone(); return y getInner() ) +innerX := getInner() + +// wait for the original to expired +callGC() + +// and try to use the inner object +innerX test() + +// next attempt, reference to inner integers +getInner2 := method( y := Y clone(); return y getInner() getInt() ) +innerInt := getInner2() + +innerInt set(3) +innerInt println + +callGC() + +// try to access an inner integer after the main object (hopefully not!) expired +innerInt println +innerInt set(2) +innerInt println Deleted: clio/trunk/clio/tests/enum.test/enum.io =================================================================== --- clio/trunk/clio/tests/enum.test/enum.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/enum.test/enum.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,35 +0,0 @@ -# testing calues -TestEnum value1 println -TestEnum value2 println - -# testing types -EnumTest get type println -EnumTest access type println - -# testing access -EnumTest get println -EnumTest access println -EnumTest set( TestEnum value1 ) -EnumTest get println -EnumTest setRef( TestEnum value3 ) -EnumTest get println -EnumTest set( TestEnum value2 ) -EnumTest get println -EnumTest access set( TestEnum value1 ) -EnumTest get println - -# testing reference instantiation -r := Clio Ref With(TestEnum) -r = r with( TestEnum value3 ) -r type println -r println - -# test comparison -( (TestEnum value3) == (TestEnum value3) ) println -( (TestEnum value3) == (TestEnum value2) ) println -( r == (TestEnum value3) ) println -( r == (TestEnum value2) ) println - -# TODO: get rid of the get. -( (TestEnum value3) == (r get) ) println -( (TestEnum value2) == (r get) ) println Copied: clio/trunk/clio/tests/enum.test/enum.test.io (from rev 8099, clio/trunk/clio/tests/enum.test/enum.io) =================================================================== --- clio/trunk/clio/tests/enum.test/enum.test.io (rev 0) +++ clio/trunk/clio/tests/enum.test/enum.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,35 @@ +# testing calues +TestEnum value1 println +TestEnum value2 println + +# testing types +EnumTest get type println +EnumTest access type println + +# testing access +EnumTest get println +EnumTest access println +EnumTest set( TestEnum value1 ) +EnumTest get println +EnumTest setRef( TestEnum value3 ) +EnumTest get println +EnumTest set( TestEnum value2 ) +EnumTest get println +EnumTest access set( TestEnum value1 ) +EnumTest get println + +# testing reference instantiation +r := Clio Ref With(TestEnum) +r = r with( TestEnum value3 ) +r type println +r println + +# test comparison +( (TestEnum value3) == (TestEnum value3) ) println +( (TestEnum value3) == (TestEnum value2) ) println +( r == (TestEnum value3) ) println +( r == (TestEnum value2) ) println + +# TODO: get rid of the get. +( (TestEnum value3) == (r get) ) println +( (TestEnum value2) == (r get) ) println Deleted: clio/trunk/clio/tests/inheritance.test/inheritance.io =================================================================== Copied: clio/trunk/clio/tests/inheritance.test/inheritance.test.io (from rev 8099, clio/trunk/clio/tests/inheritance.test/inheritance.io) =================================================================== Deleted: clio/trunk/clio/tests/membervariables.test/membervariables.io =================================================================== --- clio/trunk/clio/tests/membervariables.test/membervariables.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/membervariables.test/membervariables.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,23 +0,0 @@ -# member variables - -x := X clone -#x getSlot("value") type println -x value println -x privateValue println -x value = 1 -x privateValue = 10 -x value println -x value2 println -x privateValue println -x privateValue2 println -x value := 2 -#x getSlot("value") type println -x value println -x value2 println -x value = 3 -x value println -x value2 println -x v2 := 3 -x v2 println -x v2 = 2 -x v2 println Copied: clio/trunk/clio/tests/membervariables.test/membervariables.test.io (from rev 8099, clio/trunk/clio/tests/membervariables.test/membervariables.io) =================================================================== --- clio/trunk/clio/tests/membervariables.test/membervariables.test.io (rev 0) +++ clio/trunk/clio/tests/membervariables.test/membervariables.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,23 @@ +# member variables + +x := X clone +#x getSlot("value") type println +x value println +x privateValue println +x value = 1 +x privateValue = 10 +x value println +x value2 println +x privateValue println +x privateValue2 println +x value := 2 +#x getSlot("value") type println +x value println +x value2 println +x value = 3 +x value println +x value2 println +x v2 := 3 +x v2 println +x v2 = 2 +x v2 println Deleted: clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.io =================================================================== Copied: clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.test.io (from rev 8099, clio/trunk/clio/tests/multiple_inheritance.test/multiple_inheritance.io) =================================================================== Deleted: clio/trunk/clio/tests/namespace.test/namespace.io =================================================================== --- clio/trunk/clio/tests/namespace.test/namespace.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/namespace.test/namespace.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,7 +0,0 @@ -Plain clone -Space Test clone -Space Sub Test2 clone - -#expecting error (with default namespace not set) -Test Space Test clone - Copied: clio/trunk/clio/tests/namespace.test/namespace.test.io (from rev 8099, clio/trunk/clio/tests/namespace.test/namespace.io) =================================================================== --- clio/trunk/clio/tests/namespace.test/namespace.test.io (rev 0) +++ clio/trunk/clio/tests/namespace.test/namespace.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,7 @@ +Plain clone +Space Test clone +Space Sub Test2 clone + +#expecting error (with default namespace not set) +Test Space Test clone + Deleted: clio/trunk/clio/tests/overloads.test/overloads.io =================================================================== Copied: clio/trunk/clio/tests/overloads.test/overloads.test.io (from rev 8099, clio/trunk/clio/tests/overloads.test/overloads.io) =================================================================== Deleted: clio/trunk/clio/tests/proto.test/proto.io =================================================================== Copied: clio/trunk/clio/tests/proto.test/proto.test.io (from rev 8099, clio/trunk/clio/tests/proto.test/proto.io) =================================================================== Deleted: clio/trunk/clio/tests/reference.test/reference.io =================================================================== Copied: clio/trunk/clio/tests/reference.test/reference.test.io (from rev 8099, clio/trunk/clio/tests/reference.test/reference.io) =================================================================== Deleted: clio/trunk/clio/tests/security.test/security.io =================================================================== --- clio/trunk/clio/tests/security.test/security.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/security.test/security.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,6 +0,0 @@ -Public clone f() -Secret clone f() -SecretDerived clone base f() -SecretDerived clone baseClone g() -SecretDerived clone baseClone f() -Hidden Test clone \ No newline at end of file Copied: clio/trunk/clio/tests/security.test/security.test.io (from rev 8099, clio/trunk/clio/tests/security.test/security.io) =================================================================== --- clio/trunk/clio/tests/security.test/security.test.io (rev 0) +++ clio/trunk/clio/tests/security.test/security.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,6 @@ +Public clone f() +Secret clone f() +SecretDerived clone base f() +SecretDerived clone baseClone g() +SecretDerived clone baseClone f() +Hidden Test clone \ No newline at end of file Deleted: clio/trunk/clio/tests/simple.test/simple.io =================================================================== Copied: clio/trunk/clio/tests/simple.test/simple.test.io (from rev 8099, clio/trunk/clio/tests/simple.test/simple.io) =================================================================== Deleted: clio/trunk/clio/tests/smartpointer.test/smartpointer.io =================================================================== Copied: clio/trunk/clio/tests/smartpointer.test/smartpointer.test.io (from rev 8099, clio/trunk/clio/tests/smartpointer.test/smartpointer.io) =================================================================== Deleted: clio/trunk/clio/tests/stack.test/stack.io =================================================================== --- clio/trunk/clio/tests/stack.test/stack.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/stack.test/stack.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,30 +0,0 @@ -x := TestVector clone -ints := x accessInts -ints append(1) -x getInts -ints append(2) -ints size() println -ints at(0) println -ints at(1) println -ints foreach(println) -ints foreach(v, v println) -ints foreach(i, v, writeln(i, ":", v) ) -i2 := ints clone -i2 append(3) -ints foreach(println) - -x getInts foreach(println) - -ints pop println -ints pop println - -x getInts clone type println -Std Vector clone type println -Std VectorWrapper clone type println -Clio VectorWrapper type println -x getInts foreach(println) -x setInts( Std VectorWrapper With(Clio Int) clone append(5) ) -x setInts( Std Vector With(Clio Int) clone append(5) ) -x getInts foreach(println) -x createFloats() - Copied: clio/trunk/clio/tests/stack.test/stack.test.io (from rev 8099, clio/trunk/clio/tests/stack.test/stack.io) =================================================================== --- clio/trunk/clio/tests/stack.test/stack.test.io (rev 0) +++ clio/trunk/clio/tests/stack.test/stack.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,30 @@ +x := TestVector clone +ints := x accessInts +ints append(1) +x getInts +ints append(2) +ints size() println +ints at(0) println +ints at(1) println +ints foreach(println) +ints foreach(v, v println) +ints foreach(i, v, writeln(i, ":", v) ) +i2 := ints clone +i2 append(3) +ints foreach(println) + +x getInts foreach(println) + +ints pop println +ints pop println + +x getInts clone type println +Std Vector clone type println +Std VectorWrapper clone type println +Clio VectorWrapper type println +x getInts foreach(println) +x setInts( Std VectorWrapper With(Clio Int) clone append(5) ) +x setInts( Std Vector With(Clio Int) clone append(5) ) +x getInts foreach(println) +x createFloats() + Deleted: clio/trunk/clio/tests/super.test/super.io =================================================================== Copied: clio/trunk/clio/tests/super.test/super.test.io (from rev 8099, clio/trunk/clio/tests/super.test/super.io) =================================================================== Deleted: clio/trunk/clio/tests/templates.test/templates.io =================================================================== --- clio/trunk/clio/tests/templates.test/templates.io 2008-02-25 00:43:09 UTC (rev 8099) +++ clio/trunk/clio/tests/templates.test/templates.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -1,55 +0,0 @@ -# testing whether template masters were correctly handled -B XX With(Clio Int) clone type println -B YY With(Clio Int) clone type println -NN With(Clio Int) clone type println -B X_int type println -B Y_int type println - -# expecting errors on the next command block -A Y -A YY -A Z -A ZZ -B ZZ -TemplateTestBase - -# some typename tests -B XX type println -B YY type println -Clio Ref type println -Base TemplateTestBase_Sequence_Object_3 type println -TemplateTestBase_Sequence_Object_3 type println - - -testObject := TemplateTest With( Number ) clone -testObject2 := TemplateTest With( Sequence ) clone -testObject3 := TemplateTest clone -testObject4 := Base TemplateTestBase clone -testObject4 type println -writeln("Expecting error") -testObject4 h() -testObject4 := Base TemplateTestBase With( Sequence, Sequence, 2 ) clone -testObject4 type println -testObject4 h() println -testObject4 := Base TemplateTestBase With( Sequence, Sequence, 3 ) clone -testObject4 type println -testObject4 h() println -testObject f(1) println -testObject2 f("bla") println -testObject2 v = method(s, return s .. s) -testObject2 f("bla") println - -# note that g is from the base class; the template wrapper for that gets -# autoinstantiated. -testObject2 h println - -# also, functions that use templates auto-instantiate them -testObject2 g() f(1.5) println - -# test default instance -testObject3 h() println -testObject3 create() println -TemplateTest With( testObject ) create() println -TemplateTest With( TemplateTest ) create() type println -testObject3 create() println -testObject3 v( list(1,2,3) ) println Copied: clio/trunk/clio/tests/templates.test/templates.test.io (from rev 8099, clio/trunk/clio/tests/templates.test/templates.io) =================================================================== --- clio/trunk/clio/tests/templates.test/templates.test.io (rev 0) +++ clio/trunk/clio/tests/templates.test/templates.test.io 2008-02-25 00:44:40 UTC (rev 8100) @@ -0,0 +1,55 @@ +# testing whether template masters were correctly handled +B XX With(Clio Int) clone type println +B YY With(Clio Int) clone type println +NN With(Clio Int) clone type println +B X_int type println +B Y_int type println + +# expecting errors on the next command block +A Y +A YY +A Z +A ZZ +B ZZ +TemplateTestBase + +# some typename tests +B XX type println +B YY type println +Clio Ref type println +Base TemplateTestBase_Sequence_Object_3 type println +TemplateTestBase_Sequence_Object_3 type println + + +testObject := TemplateTest With( Number ) clone +testObject2 := TemplateTest With( Sequence ) clone +testObject3 := TemplateTest clone +testObject4 := Base TemplateTestBase clone +testObject4 type println +writeln("Expecting error") +testObject4 h() +testObject4 := Base TemplateTestBase With( Sequence, Sequence, 2 ) clone +testObject4 type println +testObject4 h() println +testObject4 := Base TemplateTestBase With( Sequence, Sequence, 3 ) clone +testObject4 type println +testObject4 h() println +testObject f(1) println +testObject2 f("bla") println +testObject2 v = method(s, return s .. s) +testObject2 f("bla") println + +# note that g is from the base class; the template wrapper for that gets +# autoinstantiated. +testObject2 h println + +# also, functions that use templates auto-instantiate them +testObject2 g() f(1.5) println + +# test default instance +testObject3 h() println +testObject3 create() println +TemplateTest With( testObject ) create() println +TemplateTest With( TemplateTest ) create() type println +testObject3 create() println +testObject3 v( list(1,2,3) ) println Deleted: clio/trunk/clio/tests/virtual.test/virtual.io =================================================================== Copied: clio/trunk/clio/tests/virtual.test/virtual.test.io (from rev 8099, clio/trunk/clio/tests/virtual.test/virtual.io) =================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:45:03
|
Revision: 8101 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8101&view=rev Author: bazaarmagetron Date: 2008-02-24 16:45:05 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: more io script moves Added Paths: ----------- clio/trunk/clio/tests/multiunit.test/multiunit.test.io clio/trunk/clio/tests/namespace.test/namespace.test2.io Removed Paths: ------------- clio/trunk/clio/tests/multiunit.test/test.io clio/trunk/clio/tests/namespace.test/test2.io Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 23:48:48.727999926 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-24 23:52:19.092999935 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - tests/codesize.test/codesize.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcodesize.test%2Ftest.io tests/conversion.test/conversion.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconversion.test%2Ftest.io tests/super.test/super.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsuper.test%2Ftest.io tests/templates.test/templates.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Ftemplates.test%2Ftest.io tests/security.test/security.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsecurity.test%2Ftest.io tests/inheritance.test/inheritance.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Finheritance.test%2Ftest.io tests/overloads.test/overloads.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Foverloads.test%2Ftest.io tests/reference.test/reference.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Freference.test%2Ftest.io tests/membervariables.test/membervariables.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmembervariables.test%2Ftest.io tests/smartpointer.test/smartpointer.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsmartpointer.test%2Ftest.io tests/simple.test/simple.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fsimple.test%2Ftest.io tests/virtual.test/virtual.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fvirtual.test%2Ftest.io tests/multiple_inheritance.test/multiple_inheritance.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiple_inheritance.test%2Ftest.io tests/proto.test/proto.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fproto.test%2Ftest.io tests/constructor.test/constructor.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fconstructor.test%2Ftest.io tests/basic.test/basic.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fbasic.test%2Ftest.io tests/namespace.test/namespace.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest.io tests/crash.test/crash.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcrash.test%2Ftest.io tests/enum.test/enum.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fenum.test%2Ftest.io tests/adhoc.test/adhoc.test.io test.io-20080224110352-ktp2lx7tt5risuzd-4 tests/classname.test/classname.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fclassname.test%2Ftest.io tests/container.test/container.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fcontainer.test%2Ftest.io tests/stack.test/stack.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fstack.test%2Ftest.io + tests/multiunit.test/multiunit.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiuinit.test%2Ftest.io tests/namespace.test/namespace.test2.io 8061@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest2.io Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf Copied: clio/trunk/clio/tests/multiunit.test/multiunit.test.io (from rev 8100, clio/trunk/clio/tests/multiunit.test/test.io) =================================================================== --- clio/trunk/clio/tests/multiunit.test/multiunit.test.io (rev 0) +++ clio/trunk/clio/tests/multiunit.test/multiunit.test.io 2008-02-25 00:45:05 UTC (rev 8101) @@ -0,0 +1,5 @@ +c1 := C1 clone +c2 := C2 clone +c1 f(c2) +c2 f(c1) + Deleted: clio/trunk/clio/tests/multiunit.test/test.io =================================================================== --- clio/trunk/clio/tests/multiunit.test/test.io 2008-02-25 00:44:40 UTC (rev 8100) +++ clio/trunk/clio/tests/multiunit.test/test.io 2008-02-25 00:45:05 UTC (rev 8101) @@ -1,5 +0,0 @@ -c1 := C1 clone -c2 := C2 clone -c1 f(c2) -c2 f(c1) - Copied: clio/trunk/clio/tests/namespace.test/namespace.test2.io (from rev 8100, clio/trunk/clio/tests/namespace.test/test2.io) =================================================================== --- clio/trunk/clio/tests/namespace.test/namespace.test2.io (rev 0) +++ clio/trunk/clio/tests/namespace.test/namespace.test2.io 2008-02-25 00:45:05 UTC (rev 8101) @@ -0,0 +1,4 @@ +Test Plain clone +Test Space Test clone +Test Space Sub Test2 clone +Test Clio Int Deleted: clio/trunk/clio/tests/namespace.test/test2.io =================================================================== --- clio/trunk/clio/tests/namespace.test/test2.io 2008-02-25 00:44:40 UTC (rev 8100) +++ clio/trunk/clio/tests/namespace.test/test2.io 2008-02-25 00:45:05 UTC (rev 8101) @@ -1,4 +0,0 @@ -Test Plain clone -Test Space Test clone -Test Space Sub Test2 clone -Test Clio Int This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:45:44
|
Revision: 8102 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8102&view=rev Author: bazaarmagetron Date: 2008-02-24 16:45:47 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: More adaptions. Modified Paths: -------------- clio/trunk/clio/clio/Makefile.am clio/trunk/clio/clio/classname.hpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/primitiveproxy.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/tests/Makefile.am clio/trunk/clio/tests/adhoc.test/adhoc.cpp clio/trunk/clio/tests/adhoc.test/adhoc.test.io clio/trunk/clio/tests/basic.test/basic.cpp clio/trunk/clio/tests/reference.test/output.txt clio/trunk/clio/tests/reference.test/reference.cpp clio/trunk/clio/tests/runtests.sh Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-24 23:52:19.092999935 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 01:04:21.165999889 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:file-ids - tests/multiunit.test/multiunit.test.io 8058@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fmultiuinit.test%2Ftest.io tests/namespace.test/namespace.test2.io 8061@7d95bf1e-0414-0410-9756-b78462a59f44:clio%2Ftrunk%2Fclio:tests%2Fnamespace.test%2Ftest2.io + Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y Modified: clio/trunk/clio/clio/Makefile.am =================================================================== --- clio/trunk/clio/clio/Makefile.am 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/clio/Makefile.am 2008-02-25 00:45:47 UTC (rev 8102) @@ -67,7 +67,6 @@ functiontype_base.hpp\ gcmarker.hpp\ gcpointer.hpp\ -helptest.hpp\ icaster.hpp\ ichained.hpp\ iclassinfo.hpp\ Modified: clio/trunk/clio/clio/classname.hpp =================================================================== --- clio/trunk/clio/clio/classname.hpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/clio/classname.hpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -324,7 +324,7 @@ CLIO_C_CLASSNAME_INT(long int); // or this, for io typenames -CLIO_IO_COMPLETE_CLASSNAME( std::string, "Sequence" ); +//CLIO_IO_COMPLETE_CLASSNAME( std::string, "Sequence" ); //CLIO_IO_CLASSNAME( float, "Number" ); //CLIO_IO_CLASSNAME( double, "Double" ); Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -310,7 +310,7 @@ CLIO_INSTANTIATE_PRIMITIVE_PROXY( char, "Char" ); CLIO_INSTANTIATE_PRIMITIVE_PROXY( unsigned char, "UnsignedChar" ); -CLIO_INSTANTIATE_PRIMITIVE_PROXY( std::string, "Strng" ); +CLIO_INSTANTIATE_PRIMITIVE( std::string, "String" ); CLIO_INSTANTIATE_PRIMITIVE( double, "Double" ); CLIO_INSTANTIATE_PRIMITIVE( float, "Float" ); Modified: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -36,6 +36,12 @@ CLIO_PROXY_NONCONST_CONSTRUCTORS( PrimitiveProxy, ConstPrimitiveProxy< BASE > ){} + // clones the object as a wrapper + typename ConstPrimitiveProxy< BASE >::WRAPPER * clone() const + { + return ConstPrimitiveProxy< BASE >::clone(); + } + void set( Primitive primitive ) { this->Get() = primitive; @@ -91,6 +97,7 @@ CLIO_CLASS_BASE( clio::ConstPrimitiveProxy<T1> ); CLIO_METHOD( set ); + CLIO_METHOD( clone ).TransferOwnership(); CLIO_INJECTCODE( clio::primitiveProxyCode ); } @@ -106,10 +113,12 @@ CLIO_INJECTCODE( clio::primitiveProxyCode ); // transfer name +#if 0 + clio::NameSurgeon< CLASS, ConstPrimitiveProxy< Proxy< T1 > > >::Operate(); clio::NameSurgeon< CLASS, BASE >::Operate(); clio::NameSurgeon< CLASS, Proxy< TNONCONST > >::Operate(); clio::NameSurgeon< CLASS, PrimitiveProxy< Proxy< TNONCONST > > >::Operate(); - clio::NameSurgeon< CLASS, ConstPrimitiveProxy< Proxy< T1 > > >::Operate(); +#endif } CLIO_TEMPLATE_CLASS_NOMASTER( clio::PrimitiveWrapper, (1,(class)), clio::PrimitiveProxyNoMaster ); Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -325,8 +325,12 @@ // transfer the name static void Operate() { - ClassInfo< DEST >::Get().SetName( IClassInfo::Name_IoComplete, - ClassInfo< SOURCE >::Get().GetName( IClassInfo::Name_IoComplete ) ); + std::stringstream s; + s << ClassInfo< DEST >::Get().GetName( IClassInfo::Name_IoComplete ) + << "[short: " + << ClassInfo< SOURCE >::Get().GetName( IClassInfo::Name_IoComplete ) + << "]"; + ClassInfo< DEST >::Get().SetName( IClassInfo::Name_IoComplete, s.str() ); } }; Modified: clio/trunk/clio/tests/Makefile.am =================================================================== --- clio/trunk/clio/tests/Makefile.am 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/Makefile.am 2008-02-25 00:45:47 UTC (rev 8102) @@ -1,36 +1,36 @@ all: tests -../clio/libclio.a: ${top_srcdir}/clio/*pp +LIBCLIO=../clio/libclio.a + +${LIBCLIO}: ${top_srcdir}/clio/*pp ${MAKE} -C ../clio -LIBCLIO=../clio/libclio.a AM_CXXFLAGS="-I${top_srcdir}" AM_LFLAGS="${LIBCLIO}" # add one test explicitly so ${CXXCOMPILE/LINK} is defined bin_PROGRAMS = multiunit.test/multiunit.test -multiunit_test_multiunit_test_SOURCES = multiunit.test/test2.cpp multiunit.test/test3.cpp multiunit.test/test.cpp multiunit.test/test2.hpp multiunit.test/test3_specialize.hpp multiunit.test/test.hpp multiunit.test/test3.hpp multiunit.test/common.hpp +multiunit_test_multiunit_test_SOURCES = multiunit.test/test2.cpp multiunit.test/test3.cpp multiunit.test/test.cpp multiunit.test/test2.hpp multiunit.test/test3_specialize.hpp multiunit.test/test.hpp multiunit.test/test3.hpp multiunit.test/common.hpp helptest.hpp multiunit_test_multiunit_test_LDADD = ${LIBCLIO} clean-local: - rm -rf *.result test "${srcdir}" = "." || rm -rf *.test/*.io - rm -rf *.test/test *.test/*.o + rm -rf *.test/*.test *.test/*.o *.test/*.result dist-hook: cp ${srcdir}/*.sh ${distdir} cp -rf ${srcdir}/*.test ${distdir} rm -f ${distdir}/*.test/test ${distdir}/*.test/*.o ${distdir}/*/test/*~ -.o.test: ${LIBCLIO} +%.test: %.o ${LIBCLIO} ${mkdir_p} `dirname $@` ${CXXLINK} $< ${LIBCLIO} .test.result: srcdir=${srcdir} ${srcdir}/runtest.sh $@ -tests: +tests: ${LIBCLIO} MAKE=${MAKE} srcdir=${srcdir} ${srcdir}/runtests.sh Modified: clio/trunk/clio/tests/adhoc.test/adhoc.cpp =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.cpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/adhoc.test/adhoc.cpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -1,16 +1,23 @@ -#include "helptest.hpp" -#include "gcpointer.hpp" +#include "../helptest.hpp" +#include <clio/gcpointer.hpp> // **************************** -// primitive proxies +// for temporary quick experiments // **************************** class T { public: - void acceptsReference( int const & i ) + T() { + x = 101; + s = "bla"; + } + + std::string const & acceptsReference( std::string const & i ) + { std::cout << "i = " << i << "\n"; + return i; } void acceptsValue( int i ) @@ -18,11 +25,12 @@ std::cout << "i = " << i << "\n"; } - int & ref() + std::string & ref() { - return x; + return s; } + std::string s; int x; }; Modified: clio/trunk/clio/tests/adhoc.test/adhoc.test.io =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 00:45:47 UTC (rev 8102) @@ -1,21 +1,14 @@ -x := T clone -r := x ref -x ref println -x ref type println -r set(1) -x ref println -r asNumber println +x := T clone ref +x println +x type println +z := x clone +z type println +z println -x acceptsReference(1) +x set("ble") +x println +writeln( "argh" .. x ) +writeln( "argh" .. x get ) +z println -ttest := TTest With(Clio Int) clone -ttest type println -ttest = TTest_int clone -ttest type println -x type println -i := Clio Int clone -i type println -i println -x acceptsValue(i) - Modified: clio/trunk/clio/tests/basic.test/basic.cpp =================================================================== --- clio/trunk/clio/tests/basic.test/basic.cpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/basic.test/basic.cpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -153,7 +153,7 @@ TestString( state, "writeln( s )" ); TestString( state, "writeln( testObject convert2( s ) )" ); TestString( state, "writeln( s )" ); - TestString( state, "writeln( testObject len(s) )" ); + // TestString( state, "writeln( testObject len(s) )" ); TestString( state, "writeln( testObject ptr( testObject ) )" ); Modified: clio/trunk/clio/tests/reference.test/output.txt =================================================================== --- clio/trunk/clio/tests/reference.test/output.txt 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/reference.test/output.txt 2008-02-25 00:45:47 UTC (rev 8102) @@ -2,7 +2,7 @@ <<<< y := ReturnTest nop("bla") <<<< writeln(y .. y) blabla -<<<< x := ReturnTest get +<<<< x := ReturnTest clone get <<<< writeln("x =", x) x = <<<< x set("blubb") @@ -12,7 +12,11 @@ blubbbla <<<< writeln("bla" .. x) blablubb +<<<< x type println +Clio PrimitiveProxy With(Clio Proxy With(Clio String)) <<<< z := x clone +<<<< z println +blubb <<<< writeln("x =", x) x =blubb <<<< writeln("z =", x) @@ -22,10 +26,4 @@ x =bla <<<< writeln("z =", x) z =bla -expecting error <<<< z set("bla") - - Exception: argument 1 to method 'atPut' must be a Number, not a 'Sequence' - atPut Vector.io 8 - - Modified: clio/trunk/clio/tests/reference.test/reference.cpp =================================================================== --- clio/trunk/clio/tests/reference.test/reference.cpp 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/reference.test/reference.cpp 2008-02-25 00:45:47 UTC (rev 8102) @@ -8,9 +8,11 @@ class ReturnTest { public: - static std::string & nop( std::string & in ){ return in; } - static std::string & get(){ static std::string safe; return safe; } + static std::string const & nop( std::string const & in ){ return in; } + std::string & get(){ return s; } static void forward(){} + + std::string s; }; CLIO_CLASS(ReturnTest) @@ -29,19 +31,20 @@ TestString( state, "y := ReturnTest nop(\"bla\")" ); TestString( state, "writeln(y .. y)" ); - TestString( state, "x := ReturnTest get" ); + TestString( state, "x := ReturnTest clone get" ); TestString( state, "writeln(\"x =\", x)" ); TestString( state, "x set(\"blubb\")" ); TestString( state, "writeln(x .. x)" ); TestString( state, "writeln(x .. \"bla\")" ); TestString( state, "writeln(\"bla\" .. x)" ); + TestString( state, "x type println" ); TestString( state, "z := x clone" ); + TestString( state, "z println" ); TestString( state, "writeln(\"x =\", x)" ); TestString( state, "writeln(\"z =\", x)" ); TestString( state, "x set(\"bla\")" ); TestString( state, "writeln(\"x =\", x)" ); TestString( state, "writeln(\"z =\", x)" ); - std::cout << "expecting error\n"; TestString( state, "z set(\"bla\")" ); } Modified: clio/trunk/clio/tests/runtests.sh =================================================================== --- clio/trunk/clio/tests/runtests.sh 2008-02-25 00:45:05 UTC (rev 8101) +++ clio/trunk/clio/tests/runtests.sh 2008-02-25 00:45:47 UTC (rev 8102) @@ -9,4 +9,4 @@ #${srcdir}/*.test | sed -e "s,${srcdir}/,,g" -e "s,.test,,g" | sed -e "s, \([^ ]*\), \1.test/\1.result,g"` -${MAKE} `echo "" $BASES | sed -e "s, \([^ ]*\), \1.test/\1.test,g"` `echo "" $BASES | sed -e "s, \([^ ]*\), \1.test/\1.result,g"` +${MAKE} `echo "" $BASES | sed -e "s, \([^ ]*\), \1.test/\1.result,g"` `echo "" $BASES | sed -e "s, \([^ ]*\), \1.test/\1.test,g"` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:46:01
|
Revision: 8103 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8103&view=rev Author: bazaarmagetron Date: 2008-02-24 16:46:06 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Adapted expected output. Modified Paths: -------------- clio/trunk/clio/tests/enum.test/output.txt Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 01:04:21.165999889 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 01:06:07.973000050 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 Modified: clio/trunk/clio/tests/enum.test/output.txt =================================================================== --- clio/trunk/clio/tests/enum.test/output.txt 2008-02-25 00:45:47 UTC (rev 8102) +++ clio/trunk/clio/tests/enum.test/output.txt 2008-02-25 00:46:06 UTC (rev 8103) @@ -8,7 +8,7 @@ <<<< EnumTest get type println TestEnum <<<< EnumTest access type println -Clio Ref With(TestEnum) +Clio PrimitiveProxy With(Clio Proxy With(TestEnum)) # testing access <<<< EnumTest get println This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 00:46:30
|
Revision: 8104 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8104&view=rev Author: bazaarmagetron Date: 2008-02-24 16:46:34 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: More work on data conversion. Modified Paths: -------------- clio/trunk/clio/clio/argumentquality.hpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/tests/adhoc.test/adhoc.test.io clio/trunk/clio/tests/overloads.test/output.txt Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 01:06:07.973000050 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 01:33:11.020999908 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 Modified: clio/trunk/clio/clio/argumentquality.hpp =================================================================== --- clio/trunk/clio/clio/argumentquality.hpp 2008-02-25 00:46:06 UTC (rev 8103) +++ clio/trunk/clio/clio/argumentquality.hpp 2008-02-25 00:46:34 UTC (rev 8104) @@ -64,9 +64,9 @@ enum QualityClass { Quality_Perfect = 0, // all arguments are perfect fits + Quality_Box, // required boxing in a wrapper Quality_Upcast, // a C++ argument is given of a derived class of the expected class Quality_Conversion, // conversion is required - Quality_Box, // required boxing in a wrapper Quality_Void, // conversion to void * or IoObject * required Quality_NoMatch, // can't match Quality_Max Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:46:06 UTC (rev 8103) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:46:34 UTC (rev 8104) @@ -307,8 +307,12 @@ CLIO_INSTANTIATE_PRIMITIVE_INT( long int, "LongInt" ); CLIO_INSTANTIATE_PRIMITIVE_INT( int, "Int" ); CLIO_INSTANTIATE_PRIMITIVE_INT( short int, "ShortInt" ); + +// chars need a bit of manual work, otherwise char * would not convert as string CLIO_INSTANTIATE_PRIMITIVE_PROXY( char, "Char" ); +CLIO_IO_COMPLETE_CLASSNAME( char, "Clio " "Char" ); CLIO_INSTANTIATE_PRIMITIVE_PROXY( unsigned char, "UnsignedChar" ); +CLIO_IO_COMPLETE_CLASSNAME( unsigned char, "Clio UnsignedChar" ); CLIO_INSTANTIATE_PRIMITIVE( std::string, "String" ); CLIO_INSTANTIATE_PRIMITIVE( double, "Double" ); @@ -316,37 +320,6 @@ #undef CLIO_INSTANTIATE_PRIMITIVE -#if 0 -CLIO_TEMPLATE_CLASS_EX( clio::dataconversion::PrimitiveProxyConstBase, (1,(class)), "ConstRef" ) -{ - CLIO_CLASS_NAMESPACE( "clio" ); - CLIO_METHOD( Get ).NonBreaking(); -} - -CLIO_TEMPLATE_CLASS_EX( clio::dataconversion::PrimitiveProxyNoConstBase, (1,(class)), "NoConstRef" ) -{ - CLIO_CLASS_NAMESPACE( "clio" ); - typedef clio::dataconversion::PrimitiveProxyConstBase< T1 > Base; - CLIO_CLASS_BASE( Base ); - - CLIO_METHOD( Set ).NonBreaking(); -} - -CLIO_TEMPLATE_CLASS_EX( clio::dataconversion::PrimitiveProxy, (1,(class)), "Ref" ) -{ - CLIO_CLASS_NAMESPACE( "clio" ); - typedef typename CLASS::Base Base; - CLIO_CLASS_BASE( Base ); - - CLIO_CONSTRUCTOR_CUSTOM( (1,(T1)) ); - - // this adds the Io glue code that makes the proxy look almost like a real object - CLIO_INJECTCODE( ::clio::dataconversion::primitveProxyCode ); -} - -CLIO_TEMPLATE_CLASS_NOMASTER( clio::dataconversion::PrimitiveProxy, (1,(class)), clio::PrimitiveProxyNoMaster ); -#endif - namespace clio { namespace dataconversion @@ -364,6 +337,9 @@ if ( from && IoObject_state(from) && from == IoObject_state(from)->ioNil ) return 0; + // bad, bad conversion quality. We should only use this as the last resort. + call.quality.quality = ArgumentQuality::Quality_Void; + return from; } Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:46:06 UTC (rev 8103) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:46:34 UTC (rev 8104) @@ -355,6 +355,12 @@ CLIO_CLASS_BASE( BASE ); } +CLIO_TEMPLATE_CLASS( clio::ProxyBase, (1,(class)) ) +{ + typedef typename CLASS::BASE BASE; + CLIO_CLASS_BASE( BASE ); +} + CLIO_TEMPLATE_CLASS( clio::Proxy, (1,(class)) ) { typedef typename CLASS::BASE BASE; Modified: clio/trunk/clio/tests/adhoc.test/adhoc.test.io =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 00:46:06 UTC (rev 8103) +++ clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 00:46:34 UTC (rev 8104) @@ -1,14 +0,0 @@ -x := T clone ref -x println -x type println -z := x clone -z type println -z println - -x set("ble") -x println -writeln( "argh" .. x ) -writeln( "argh" .. x get ) -z println - - Modified: clio/trunk/clio/tests/overloads.test/output.txt =================================================================== --- clio/trunk/clio/tests/overloads.test/output.txt 2008-02-25 00:46:06 UTC (rev 8103) +++ clio/trunk/clio/tests/overloads.test/output.txt 2008-02-25 00:46:34 UTC (rev 8104) @@ -16,23 +16,23 @@ <<<< x g( x h_float ) h<float> - Exception: No fitting overload found for passed argument of type 'Clio ConstFloat'. The candidates say: -test.cpp:74 : OverloadTest2::g( char const & ) : 'Clio ConstChar' expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'char const &') -test.cpp:67 : OverloadTest2::g( string ) : Sequence expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'string') -test.cpp:68 : OverloadTest2::g( int ) : Number expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'int') -test.cpp:69 : OverloadTest2::g( float ) : Number expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'float') -test.cpp:70 : OverloadTest2::g( double ) : Number expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'double') -test.cpp:71 : OverloadTest2::g( double const & ) : 'Clio ConstDouble' expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'double const &') -test.cpp:72 : OverloadTest2::g( int const & ) : 'Clio ConstInt' expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'int const &') -test.cpp:73 : OverloadTest2::g( char const & ) : 'Clio ConstChar' expected, got 'Clio ConstFloat' instead (parsing argument 0 of desired type 'char const &') + Exception: No fitting overload found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))'. The candidates say: +overloads.cpp:74 : OverloadTest2::g( char const & ) : 'Clio Char' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') +overloads.cpp:67 : OverloadTest2::g( string ) : Sequence expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'string') +overloads.cpp:68 : OverloadTest2::g( int ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'int') +overloads.cpp:69 : OverloadTest2::g( float ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'float') +overloads.cpp:70 : OverloadTest2::g( double ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'double') +overloads.cpp:71 : OverloadTest2::g( double const & ) : 'Clio ProxyConst With(Clio Double)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'double const &') +overloads.cpp:72 : OverloadTest2::g( int const & ) : 'Clio ProxyConst With(Clio Int)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'int const &') +overloads.cpp:73 : OverloadTest2::g( char const & ) : 'Clio Char' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') (during call of C++ function 'OverloadTest2::g( char const & )') <<<< x g( x h_char ) h<char> - Exception: Too many equally fitting overloads found for passed argument of type 'Clio ConstChar'. The candidates are: -test.cpp:74 : OverloadTest2::g( char const & ) -test.cpp:73 : OverloadTest2::g( char const & ) + Exception: Too many equally fitting overloads found for passed argument of type 'Clio Char'. The candidates are: +overloads.cpp:74 : OverloadTest2::g( char const & ) +overloads.cpp:73 : OverloadTest2::g( char const & ) (during call of C++ function 'OverloadTest2::g( char const & )') <<<< x f(OverloadTest clone) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 02:26:03
|
Revision: 8105 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8105&view=rev Author: bazaarmagetron Date: 2008-02-24 18:26:09 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Still more work. Proxies now generate automatically without const trouble. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion.hpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/primitiveproxy.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/clio/std_container.hpp clio/trunk/clio/tests/Makefile.am clio/trunk/clio/tests/conversion.test/output.txt clio/trunk/clio/tests/overloads.test/output.txt Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 01:33:11.020999908 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 02:36:18.217000008 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n Modified: clio/trunk/clio/clio/dataconversion.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 02:26:09 UTC (rev 8105) @@ -274,16 +274,34 @@ typedef T * Converted; - static T * FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower) + // type indicating whether T is primitive + typedef BoolToType< TestPrimitive< T >::IsPrimitive > IsPrimitive; + + // code variant for non-primitive T + static T * FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType< false > const & ) { return static_cast< T * >( DataConverterPointerImplementationBaseBase::FromIo ( ClassInfo::Get(), from, call, thrower ) ); } - static IoObject * ToIo( IoState * state, T * from, DataConversionCall const & call ) + static IoObject * ToIo( IoState * state, T * from, DataConversionCall const & call, BoolToType< false > const & ) { return ClassInfo::Get().FetchIoObject( from, state, ObjectWrapper::OwnedByC ); } + + // code variant for primitive T. Uses primitive proxies and is therefore defined in primitiveproxy.hpp. + static T * FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType< true > const & ); + static IoObject * ToIo( IoState * state, T * from, DataConversionCall const & call, BoolToType< true > const & ); + + static T * FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) + { + return FromIo( from, call, thrower, IsPrimitive() ); + } + + static IoObject * ToIo( IoState * state, T * from, DataConversionCall const & call ) + { + return ToIo( state, from, call, IsPrimitive() ); + } }; // test if a type gets special, primitive-like, treatment by clio Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 02:26:09 UTC (rev 8105) @@ -297,7 +297,7 @@ #define CLIO_INSTANTIATE_PRIMITIVE( INT, NAME ) \ CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME );\ -CLIO_CONVERTAS_PROXY_REF( INT, PrimitiveProxy );\ +CLIO_CONVERTAS_PROXY_INDIRECTION( INT, PrimitiveProxy );\ CLIO_IO_COMPLETE_CLASSNAME( INT, "Clio " NAME ) #define CLIO_INSTANTIATE_PRIMITIVE_INT( INT, NAME ) \ @@ -313,6 +313,8 @@ CLIO_IO_COMPLETE_CLASSNAME( char, "Clio " "Char" ); CLIO_INSTANTIATE_PRIMITIVE_PROXY( unsigned char, "UnsignedChar" ); CLIO_IO_COMPLETE_CLASSNAME( unsigned char, "Clio UnsignedChar" ); +CLIO_CONVERTAS_PROXY_REFERENCE( char, PrimitiveProxy ); +CLIO_CONVERTAS_PROXY_REFERENCE( unsigned char, PrimitiveProxy ); CLIO_INSTANTIATE_PRIMITIVE( std::string, "String" ); CLIO_INSTANTIATE_PRIMITIVE( double, "Double" ); Modified: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 02:26:09 UTC (rev 8105) @@ -13,6 +13,7 @@ { public: typedef typename BASE::ORIGINAL Primitive; + typedef ConstPrimitiveProxy< BASE > CONST; CLIO_PROXY_CONST_CONSTRUCTORS( ConstPrimitiveProxy, BASE ){} @@ -76,8 +77,29 @@ struct PrimitiveProxyNoMaster{}; extern char const * primitiveProxyCode; +namespace dataconversion +{ +// pointers to primitives implementation +template< class T > +T * DataConverterPointerImplementationBase<T>::FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType< true > const & ) +{ + // look for a proxy object + typedef PrimitiveProxy< Proxy< T > > PROXY; + return DataConverterProxy< T *, PROXY >::FromIo( from, call, thrower ); } + +template< class T > +IoObject * DataConverterPointerImplementationBase<T>::ToIo( IoState * state, T * from, DataConversionCall const & call, BoolToType< true > const & ) +{ + // return a proxy object + typedef PrimitiveProxy< Proxy< T > > PROXY; + return DataConverterProxy< T *, PROXY >::ToIo( state, from, call ); +} +} + +} + #include "macros.hpp" CLIO_TEMPLATE_CLASS_SET_DEFAULTCONSTRUCTOR( clio::ConstPrimitiveProxy, (1,(class)), false ); Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 02:26:09 UTC (rev 8105) @@ -202,7 +202,8 @@ // Data conversion via proxy classes. The proxy class is supposed to have this // public interface: // class PROXY{ -// TYPEDEF SOMEOTHERCLASS GETTER; +// typedef SOMEOTHERCLASS GETTER; +// typedef SOMEOTHERCLASS CONST; // PROXY( ORIGINAL ); // }; // where SOMEOTHERCLASS is a base class of PROXY of the form @@ -218,6 +219,7 @@ template< class ORIGINAL, class PROXY > class DataConverterProxy: public DataConverterDefs< ORIGINAL > { public: + typedef typename PROXY::CONST PROXY_CONST; // proxy for const objects typedef typename PROXY::GETTER GETTER; // what we expect from Io typedef typename GETTER::ORIGINAL ORIGINAL_BASE; // the raw base type typedef typename GETTER::GETRESULT GETRESULT; // return type of GETTER::Get() @@ -230,6 +232,7 @@ typedef DataConverterManager< ORIGINAL_BASE > IMPL_ORIGINAL; typedef DataConverterReference< GETTER &, DataConverterPointerImplementation< GETTER > > IMPL_GET; typedef DataConverterReference< PROXY &, DataConverterPointerImplementation< PROXY > > IMPL_SET; + typedef DataConverterReference< PROXY_CONST &, DataConverterPointerImplementation< PROXY_CONST > > IMPL_SET_CONST; static GETRESULT FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<true> const & isConst ) { @@ -299,9 +302,26 @@ static void CheckType( IChained const & ){} - static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) + // conversion of const arguments from Io + static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call, BoolToType< true > const & CONST ) { // create + typename IMPL_SET_CONST::TArg arg = *(new PROXY_CONST(from)); + + // READ BELOW IF THIS LINE GIVES AN ERROR + DataConverterProxy::CheckType( arg ); + // If the above line gives an error, that means you tried to register + // a proxy object for data conversion that is not derived from clio::IChained. + // Let all your proxies inherit from clio::IChained to correct this error. It's + // best if you let them inherit from clio::Proxy< ORIGINAL >. + + return IMPL_SET_CONST::ToIo( state, arg, call ); + } + + // conversion of nonconst arguments + static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call, BoolToType< false > const & CONST ) + { + // create typename IMPL_SET::TArg arg = *(new PROXY(from)); // READ BELOW IF THIS LINE GIVES AN ERROR @@ -313,6 +333,12 @@ return IMPL_SET::ToIo( state, arg, call ); } + + static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) + { + // delegate to const/non-const implementation + return ToIo( state, from, call, BoolToType< TestConst< TArg >::IsConst >() ); + } }; } @@ -385,14 +411,22 @@ PROXY< Proxy< CLASS CLIO_TEMPLATE_ARGLIST_COMPLETE(SIGNATURE) CONST > > >{}; \ }}CLIO_FORCESEMICOLON(proxy2) -// convesion of (const) &/* arguments -#define CLIO_CONVERTAS_PROXY_REF( CLASS, PROXY ) \ +// convesion of (const) & arguments +#define CLIO_CONVERTAS_PROXY_REFERENCE( CLASS, PROXY ) \ CLIO_CONVERTAS_PROXY( CLASS, ,& , PROXY ); \ -CLIO_CONVERTAS_PROXY( CLASS,const ,& , Const##PROXY ); \ +CLIO_CONVERTAS_PROXY( CLASS,const ,& , Const##PROXY ) + +// convesion of (const) * arguments +#define CLIO_CONVERTAS_PROXY_POINTER( CLASS, PROXY ) \ CLIO_CONVERTAS_PROXY( CLASS, ,* , PROXY ); \ CLIO_CONVERTAS_PROXY( CLASS,const ,* , Const##PROXY ) // convesion of (const) &/* arguments +#define CLIO_CONVERTAS_PROXY_INDIRECTION( CLASS, PROXY ) \ +CLIO_CONVERTAS_PROXY_REFERENCE( CLASS, PROXY ); \ +CLIO_CONVERTAS_PROXY_POINTER( CLASS, PROXY ) + +// convesion of (const) &/* arguments #define CLIO_CONVERTAS_PROXY_COMPLETE( CLASS, PROXY ) \ CLIO_CONVERTAS_PROXY( CLASS,,, PROXY ); \ CLIO_CONVERTAS_PROXY_REF( CLASS, PROXY ) \ Modified: clio/trunk/clio/clio/std_container.hpp =================================================================== --- clio/trunk/clio/clio/std_container.hpp 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/clio/std_container.hpp 2008-02-25 02:26:09 UTC (rev 8105) @@ -15,6 +15,7 @@ { public: typedef typename BASE::ORIGINAL Container; + typedef ConstVectorProxy CONST; typedef typename Container::size_type size_type; typedef typename Container::value_type value_type; Modified: clio/trunk/clio/tests/Makefile.am =================================================================== --- clio/trunk/clio/tests/Makefile.am 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/tests/Makefile.am 2008-02-25 02:26:09 UTC (rev 8105) @@ -27,7 +27,7 @@ ${mkdir_p} `dirname $@` ${CXXLINK} $< ${LIBCLIO} -.test.result: +%.result: %.test srcdir=${srcdir} ${srcdir}/runtest.sh $@ tests: ${LIBCLIO} Modified: clio/trunk/clio/tests/conversion.test/output.txt =================================================================== --- clio/trunk/clio/tests/conversion.test/output.txt 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/tests/conversion.test/output.txt 2008-02-25 02:26:09 UTC (rev 8105) @@ -2,7 +2,7 @@ <<<< x := DataConversion clone <<<< x f5( DataConversionDummy ) - Exception: 'Clio Ref With(DataConversion)' expected, got 'DataConversionDummy' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') + Exception: 'Clio ProxyNonConst With(DataConversion)' expected, got 'DataConversionDummy' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') <<<< DataConversion f1 <<<< DataConversion f2(true) println @@ -17,14 +17,18 @@ <<<< x f5( x f6 ) 1 <<<< x f5( x ) -0 + + Exception: 'Clio ProxyNonConst With(DataConversion)' expected, got 'DataConversion' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') + <<<< x f5_2( x ) 0 <<<< DataConversion f3_2(2) type println -Clio ConstInt +Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Int)) <<<< DataConversion f3_2(2) set(3) Exception: Number does not respond to 'set' <<<< writeln( x f7( 1 ) ) -1 + + Exception: No C++ object found (parsing argument 0 of desired type 'int &' during call of C++ function 'DataConversion::f7( int & )') + Modified: clio/trunk/clio/tests/overloads.test/output.txt =================================================================== --- clio/trunk/clio/tests/overloads.test/output.txt 2008-02-25 00:46:34 UTC (rev 8104) +++ clio/trunk/clio/tests/overloads.test/output.txt 2008-02-25 02:26:09 UTC (rev 8105) @@ -17,20 +17,20 @@ h<float> Exception: No fitting overload found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))'. The candidates say: -overloads.cpp:74 : OverloadTest2::g( char const & ) : 'Clio Char' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') +overloads.cpp:74 : OverloadTest2::g( char const & ) : 'Clio ProxyConst With(Clio Char)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') overloads.cpp:67 : OverloadTest2::g( string ) : Sequence expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'string') overloads.cpp:68 : OverloadTest2::g( int ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'int') overloads.cpp:69 : OverloadTest2::g( float ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'float') overloads.cpp:70 : OverloadTest2::g( double ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'double') overloads.cpp:71 : OverloadTest2::g( double const & ) : 'Clio ProxyConst With(Clio Double)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'double const &') overloads.cpp:72 : OverloadTest2::g( int const & ) : 'Clio ProxyConst With(Clio Int)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'int const &') -overloads.cpp:73 : OverloadTest2::g( char const & ) : 'Clio Char' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') +overloads.cpp:73 : OverloadTest2::g( char const & ) : 'Clio ProxyConst With(Clio Char)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') (during call of C++ function 'OverloadTest2::g( char const & )') <<<< x g( x h_char ) h<char> - Exception: Too many equally fitting overloads found for passed argument of type 'Clio Char'. The candidates are: + Exception: Too many equally fitting overloads found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Char))'. The candidates are: overloads.cpp:74 : OverloadTest2::g( char const & ) overloads.cpp:73 : OverloadTest2::g( char const & ) (during call of C++ function 'OverloadTest2::g( char const & )') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 02:26:24
|
Revision: 8106 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8106&view=rev Author: bazaarmagetron Date: 2008-02-24 18:26:30 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Bad idea with the special handling of template instantiation arguments. Reverting. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/macros.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 02:36:18.217000008 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 02:51:44.556999922 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 02:26:09 UTC (rev 8105) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 02:26:30 UTC (rev 8106) @@ -283,12 +283,6 @@ // struct PrimitiveProxyNoMaster{}; -// let primitives be handled by their wrapper for template arguments -template< class T > struct clioPrivate_classToTypeBase< T, true > -{ - typedef typename PrimitiveWrapper<T>::GETTER Type; -}; - } #define CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME ) \ Modified: clio/trunk/clio/clio/macros.hpp =================================================================== --- clio/trunk/clio/clio/macros.hpp 2008-02-25 02:26:09 UTC (rev 8105) +++ clio/trunk/clio/clio/macros.hpp 2008-02-25 02:26:30 UTC (rev 8106) @@ -212,6 +212,13 @@ typedef T Type; }; +// let primitives be handled by their wrapper for template arguments +template< class T > struct clioPrivate_classToTypeBase< T, true > +{ + typedef T Type; +}; + + // For the template instantiation overloads: // converts a type to another type template< class T > struct clioPrivate_classToType This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 02:27:02
|
Revision: 8107 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8107&view=rev Author: bazaarmagetron Date: 2008-02-24 18:27:08 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Yay, template test fails a little less badly. Modified Paths: -------------- clio/trunk/clio/clio/proxy.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 02:51:44.556999922 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 03:21:14.834000111 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 02:26:30 UTC (rev 8106) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 02:27:08 UTC (rev 8107) @@ -199,6 +199,26 @@ namespace dataconversion { +// helper class returning NULL pointers or throwing exceptions +template< class T > +struct NullReturner +{ + static T Get( IExceptionThrower const & thrower ) + { + thrower.Throw( "Null pointer or prototype found when instance was expected." ); + return T(); + } +}; + +template< class T > +struct NullReturner< T * > +{ + static T * Get( IExceptionThrower const & thrower ) + { + return NULL; + } +}; + // Data conversion via proxy classes. The proxy class is supposed to have this // public interface: // class PROXY{ @@ -230,16 +250,30 @@ typedef typename Base::Converted Converted; typedef DataConverterManager< ORIGINAL_BASE > IMPL_ORIGINAL; - typedef DataConverterReference< GETTER &, DataConverterPointerImplementation< GETTER > > IMPL_GET; - typedef DataConverterReference< PROXY &, DataConverterPointerImplementation< PROXY > > IMPL_SET; - typedef DataConverterReference< PROXY_CONST &, DataConverterPointerImplementation< PROXY_CONST > > IMPL_SET_CONST; + typedef DataConverterPointerImplementation< GETTER > IMPL_GET; + typedef DataConverterPointerImplementation< PROXY > IMPL_SET; + typedef DataConverterPointerImplementation< PROXY_CONST > IMPL_SET_CONST; - static GETRESULT FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<true> const & isConst ) + // non-const type, no wrapping possible + static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<false> const & isConst ) { + GETTER * proxy = IMPL_GET::FromIo( from, call, thrower ); + if ( proxy ) + { + return TransformReference< Converted >::Transform( proxy->Get() ); + } + else + { + return NullReturner< Converted >::Get( thrower ); + } + } + + // const type, try to wrap + static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<true> const & isConst ) + { try { - GETTER & proxy = IMPL_GET::FromIo( from, call, thrower ); - return proxy.Get(); + return FromIo( from, call, thrower, BoolToType<false>() ); } catch( ... ) { @@ -268,19 +302,13 @@ IoState_stackRetain_( IoObject_state(from), object ); // return a refernece to the held data - return p->Get(); + return TransformReference< Converted >::Transform( p->Get() ); } catch(...){} // ignore errors in the block above throw; // instead, rethrow the original error } } - static GETRESULT FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower, BoolToType<false> const & isConst ) - { - GETTER & proxy = IMPL_GET::FromIo( from, call, thrower ); - return proxy.Get(); - } - // check whether we can safely box an incoming object. // plain values are OK, and const pointers and references enum { @@ -297,7 +325,7 @@ static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) { - return TransformReference< Converted >::Transform( FromIo( from, call, thrower, BoolToType< CanBox >() ) ); + return FromIo( from, call, thrower, BoolToType< CanBox >() ); } static void CheckType( IChained const & ){} @@ -306,10 +334,10 @@ static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call, BoolToType< true > const & CONST ) { // create - typename IMPL_SET_CONST::TArg arg = *(new PROXY_CONST(from)); + PROXY_CONST * arg = new PROXY_CONST(from); // READ BELOW IF THIS LINE GIVES AN ERROR - DataConverterProxy::CheckType( arg ); + DataConverterProxy::CheckType( *arg ); // If the above line gives an error, that means you tried to register // a proxy object for data conversion that is not derived from clio::IChained. // Let all your proxies inherit from clio::IChained to correct this error. It's @@ -322,10 +350,10 @@ static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call, BoolToType< false > const & CONST ) { // create - typename IMPL_SET::TArg arg = *(new PROXY(from)); + PROXY * arg = new PROXY(from); // READ BELOW IF THIS LINE GIVES AN ERROR - DataConverterProxy::CheckType( arg ); + DataConverterProxy::CheckType( *arg ); // If the above line gives an error, that means you tried to register // a proxy object for data conversion that is not derived from clio::IChained. // Let all your proxies inherit from clio::IChained to correct this error. It's This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 02:49:17
|
Revision: 8108 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8108&view=rev Author: bazaarmagetron Date: 2008-02-24 18:49:04 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Almost there... Modified Paths: -------------- clio/trunk/clio/clio/dataconversion_extended.cpp clio/trunk/clio/clio/dataconversion_extended.hpp clio/trunk/clio/clio/macros.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 03:21:14.834000111 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 03:37:50.822000027 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 02:27:08 UTC (rev 8107) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 02:49:04 UTC (rev 8108) @@ -3,17 +3,138 @@ #include <IoNumber.h> #include <IoState.h> -CLIO_CLASS( clio::dataconversion::DataConverterMutableCString::CharProxy ) -{ - CLIO_CLASS_NAMESPACE("clio"); -} - namespace clio { namespace dataconversion { +// IoObject pointers: just pass them through, suppose the creator/receiver knows what he's doing. +// Only translate NULL on the C++ side to nil on the Io side. +template< class OBJECT > +struct DataConverterIoObjectPointer +{ + typedef OBJECT * Converted; + typedef OBJECT * TArg; + + static inline Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) + { + if ( from && IoObject_state(from) && from == IoObject_state(from)->ioNil ) + return 0; + + // bad, bad conversion quality. We should only use this as the last resort. + call.quality.quality = ArgumentQuality::Quality_Void; + + return from; + } + + static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) + { + if ( from ) + return const_cast< IoObject * >( from ); + else + return state->ioNil; + } +}; + + +void AssertSequence( IoObject * from, IExceptionThrower const & thrower ); + + +// strings: C strings +struct DataConverterCString +{ + typedef DataConverterDefs< char const * > Base; + + typedef Base::TArg TArg; + typedef Base::Converted Converted; + + static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) + { + if ( !from ) + throw Exception( "char * is NULL" ); + return IoSeq_newWithCString_( state, from ); + } + + static inline Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) + { + AssertSequence( from, thrower ); + return IoSeq_asCString( from ); + } +}; + +// C++ strings +struct DataConverterSTDString: public DataConverterCString +{ + typedef DataConverterDefs< std::string > Base; + + typedef Base::TArg TArg; + typedef Base::Converted Converted; + + static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) + { + return DataConverterCString::ToIo( state, from.c_str(), call ); + } + + static inline Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) + { + return DataConverterCString::FromIo( from, call, thrower ); + } +}; + +// strange beasts: mutable C strings +struct DataConverterMutableCString +{ + // temporary holder for non-const char * type strings + class CharProxy + { + public: + CharProxy( char const * toCopy ) + : copy_(strdup(const_cast< char * >(toCopy))) + {} + + operator char * () + { + return copy_; + } + + ~CharProxy() + { + if ( copy_ ) + free(copy_); + copy_ = 0; + } + + // auto-ptresque copy semantics + CharProxy( CharProxy const & other ) + { + copy_ = other.copy_; + other.copy_ = 0; + } + + CharProxy() + { + copy_ = strdup(""); + } + private: + mutable char * copy_; + + CharProxy & operator = ( CharProxy const & ); + }; + + typedef DataConverterDefs< char * > Base; + + typedef Base::TArg TArg; + typedef Base::Converted Converted; + + static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ); + + static IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) + { + return DataConverterCString::ToIo( state, from, call ); + } +}; + // errors void AssertNumber( IoObject * from, IExceptionThrower const & thrower ) { @@ -84,7 +205,8 @@ done = true; // plain Io objects - DataConverterOverrider< IoObject *, DataConverterIoObjectPointer >::Register(); + DataConverterOverrider< IoObject *, DataConverterIoObjectPointer< IoObject > >::Register(); + DataConverterOverrider< IoObject const *, DataConverterIoObjectPointer< IoObject const > >::Register(); // bools DataConverterOverrider< bool, DataConverterBool >::Register(); @@ -122,4 +244,9 @@ CLIO_CREATE_PRIMITIVE( std::string, "String" ); +CLIO_CLASS( clio::dataconversion::DataConverterMutableCString::CharProxy ) +{ + CLIO_CLASS_NAMESPACE("clio"); +} + // CLIO_INSTANTIATE_TEMPLATE(clio::PrimitiveProxy,(1,(int)),"Int" ); Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 02:27:08 UTC (rev 8107) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 02:49:04 UTC (rev 8108) @@ -321,131 +321,7 @@ namespace dataconversion { -// IoObject pointers: just pass them through, suppose the creator/receiver knows what he's doing. -// Only translate NULL on the C++ side to nil on the Io side. -struct DataConverterIoObjectPointer -{ - typedef IoObject * Converted; - typedef IoObject * TArg; - static inline IoObject * FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) - { - if ( from && IoObject_state(from) && from == IoObject_state(from)->ioNil ) - return 0; - - // bad, bad conversion quality. We should only use this as the last resort. - call.quality.quality = ArgumentQuality::Quality_Void; - - return from; - } - - static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) - { - if ( from ) - return from; - else - return state->ioNil; - } -}; - - -void AssertSequence( IoObject * from, IExceptionThrower const & thrower ); - - -// strings: C strings -struct DataConverterCString -{ - typedef DataConverterDefs< char const * > Base; - - typedef Base::TArg TArg; - typedef Base::Converted Converted; - - static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) - { - if ( !from ) - throw Exception( "char * is NULL" ); - return IoSeq_newWithCString_( state, from ); - } - - static inline Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) - { - AssertSequence( from, thrower ); - return IoSeq_asCString( from ); - } -}; - -// C++ strings -struct DataConverterSTDString: public DataConverterCString -{ - typedef DataConverterDefs< std::string > Base; - - typedef Base::TArg TArg; - typedef Base::Converted Converted; - - static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) - { - return DataConverterCString::ToIo( state, from.c_str(), call ); - } - - static inline Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ) - { - return DataConverterCString::FromIo( from, call, thrower ); - } -}; - -// strange beasts: mutable C strings -struct DataConverterMutableCString -{ - // temporary holder for non-const char * type strings - class CharProxy - { - public: - CharProxy( char const * toCopy ) - : copy_(strdup(const_cast< char * >(toCopy))) - {} - - operator char * () - { - return copy_; - } - - ~CharProxy() - { - if ( copy_ ) - free(copy_); - copy_ = 0; - } - - // auto-ptresque copy semantics - CharProxy( CharProxy const & other ) - { - copy_ = other.copy_; - other.copy_ = 0; - } - - CharProxy() - { - copy_ = strdup(""); - } - private: - mutable char * copy_; - - CharProxy & operator = ( CharProxy const & ); - }; - - typedef DataConverterDefs< char * > Base; - - typedef Base::TArg TArg; - typedef Base::Converted Converted; - - static Converted FromIo( IoObject * from, DataConversionCall const & call, IExceptionThrower const & thrower ); - - static IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) - { - return DataConverterCString::ToIo( state, from, call ); - } -}; - } } Modified: clio/trunk/clio/clio/macros.hpp =================================================================== --- clio/trunk/clio/clio/macros.hpp 2008-02-25 02:27:08 UTC (rev 8107) +++ clio/trunk/clio/clio/macros.hpp 2008-02-25 02:49:04 UTC (rev 8108) @@ -203,29 +203,17 @@ // For the template instantiation overloads: // converts a type to another type -template< class T, bool primitive > struct clioPrivate_classToTypeBase +template< class T > struct clioPrivate_classToType { -}; - -template< class T > struct clioPrivate_classToTypeBase< T, false > -{ typedef T Type; }; -// let primitives be handled by their wrapper for template arguments -template< class T > struct clioPrivate_classToTypeBase< T, true > +// templates accepting IoObjectPointers should accept anything. +template<> struct clioPrivate_classToType<IoObjectPointer> { - typedef T Type; + typedef IoObject Type; }; - -// For the template instantiation overloads: -// converts a type to another type -template< class T > struct clioPrivate_classToType -{ - typedef typename clioPrivate_classToTypeBase<T, clio::TestPrimitive< T >::IsPrimitive>::Type Type; -}; - // same as classToType template< class T > struct clioPrivate_typenameToType: public clioPrivate_classToType< T >{}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 02:50:42
|
Revision: 8109 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8109&view=rev Author: bazaarmagetron Date: 2008-02-24 18:50:44 -0800 (Sun, 24 Feb 2008) Log Message: ----------- Manuel Moos: Hah, no, the test result was fine :) All tests pass again. Phew. Modified Paths: -------------- clio/trunk/clio/tests/templates.test/output.txt clio/trunk/clio/tests/templates.test/templates.test.io Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 03:37:50.822000027 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 03:43:08.516000032 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 Modified: clio/trunk/clio/tests/templates.test/output.txt =================================================================== --- clio/trunk/clio/tests/templates.test/output.txt 2008-02-25 02:49:04 UTC (rev 8108) +++ clio/trunk/clio/tests/templates.test/output.txt 2008-02-25 02:50:44 UTC (rev 8109) @@ -49,6 +49,8 @@ <<<< testObject := TemplateTest With( Number ) clone +<<<< testObject type println +TemplateTest With(Clio Float) <<<< testObject2 := TemplateTest With( Sequence ) clone <<<< testObject3 := TemplateTest clone <<<< testObject4 := Base TemplateTestBase clone @@ -62,7 +64,7 @@ <<<< testObject4 := Base TemplateTestBase With( Sequence, Sequence, 2 ) clone <<<< testObject4 type println -Base TemplateTestBase With(Sequence,Sequence,2) +Base TemplateTestBase With(Clio String,Clio String,2) <<<< testObject4 h() println 2 <<<< testObject4 := Base TemplateTestBase With( Sequence, Sequence, 3 ) clone @@ -92,9 +94,10 @@ 2 <<<< testObject3 create() println nil +<<<< TemplateTest With( testObject ) type println +TemplateTest <<<< TemplateTest With( testObject ) create() println - TemplateTest_0xHEXCODE: - +nil <<<< TemplateTest With( TemplateTest ) create() type println TemplateTest <<<< testObject3 create() println Modified: clio/trunk/clio/tests/templates.test/templates.test.io =================================================================== --- clio/trunk/clio/tests/templates.test/templates.test.io 2008-02-25 02:49:04 UTC (rev 8108) +++ clio/trunk/clio/tests/templates.test/templates.test.io 2008-02-25 02:50:44 UTC (rev 8109) @@ -22,6 +22,7 @@ testObject := TemplateTest With( Number ) clone +testObject type println testObject2 := TemplateTest With( Sequence ) clone testObject3 := TemplateTest clone testObject4 := Base TemplateTestBase clone @@ -49,6 +50,7 @@ # test default instance testObject3 h() println testObject3 create() println +TemplateTest With( testObject ) type println TemplateTest With( testObject ) create() println TemplateTest With( TemplateTest ) create() type println testObject3 create() println This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 10:59:40
|
Revision: 8110 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8110&view=rev Author: bazaarmagetron Date: 2008-02-25 02:59:47 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Manuel Moos: Fixed some things gcc 3.3 was complaining about. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion.hpp clio/trunk/clio/clio/primitiveproxy.cpp clio/trunk/clio/clio/primitiveproxy.hpp clio/trunk/clio/clio/proxy.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 03:43:08.516000032 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 11:05:12.898000002 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq Modified: clio/trunk/clio/clio/dataconversion.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 02:50:44 UTC (rev 8109) +++ clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 10:59:47 UTC (rev 8110) @@ -554,6 +554,12 @@ CLIO_CONVERT_AS_FLOAT( double ); CLIO_CONVERT_AS_FLOAT( float ); +#define CLIO_CONVERT_AS_PRIMITIVE( PRIMITIVE ) \ +CLIO_NODEFAULT_DATACONVERSION( PRIMITIVE & );\ +CLIO_NODEFAULT_DATACONVERSION( PRIMITIVE const & );\ +CLIO_NODEFAULT_DATACONVERSION( PRIMITIVE * );\ +CLIO_NODEFAULT_DATACONVERSION( PRIMITIVE const * ) + #define CLIO_CONVERT_AS_INT( NUMBER ) \ template<> struct DataConverterDefsBase< NUMBER >: public DataConverterDefsBaseInt{}; \ template<> struct DataConverterDefsBase< unsigned NUMBER >: public DataConverterDefsBaseIntUnsigned{}; \ Modified: clio/trunk/clio/clio/primitiveproxy.cpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.cpp 2008-02-25 02:50:44 UTC (rev 8109) +++ clio/trunk/clio/clio/primitiveproxy.cpp 2008-02-25 10:59:47 UTC (rev 8110) @@ -12,8 +12,5 @@ "forward := method( return get doMessage(call message) ) \n" ; -// specialize default constructor for strings -template<> PrimitiveWrapper< std::string >::PrimitiveWrapper(){} - } Modified: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 02:50:44 UTC (rev 8109) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 10:59:47 UTC (rev 8110) @@ -66,7 +66,7 @@ }; // specialize default constructor for strings -template<> PrimitiveWrapper< std::string >::PrimitiveWrapper(); +template<> inline PrimitiveWrapper< std::string >::PrimitiveWrapper(){}; template< class BASE > typename ConstPrimitiveProxy<BASE>::WRAPPER * ConstPrimitiveProxy<BASE>::clone() const Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 02:50:44 UTC (rev 8109) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 10:59:47 UTC (rev 8110) @@ -206,7 +206,8 @@ static T Get( IExceptionThrower const & thrower ) { thrower.Throw( "Null pointer or prototype found when instance was expected." ); - return T(); + static T * t = NULL; + return *t; } }; @@ -219,6 +220,17 @@ } }; +template< class T > +struct NullReturner< T & > +{ + static T & Get( IExceptionThrower const & thrower ) + { + thrower.Throw( "Null pointer or prototype found when instance was expected." ); + static T * t = NULL; + return *t; + } +}; + // Data conversion via proxy classes. The proxy class is supposed to have this // public interface: // class PROXY{ @@ -231,7 +243,7 @@ // ORIGINAL const & Get(); // ORIGINAL & Get(); // }; - +// and CONST is a const variant of the proxy. // // and is supposed to be derived from IChained. Not surprisingly, Wrapper<> and Proxy<> // apply :) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 11:00:34
|
Revision: 8111 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8111&view=rev Author: bazaarmagetron Date: 2008-02-25 03:00:37 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Manuel Moos: Moved instantiation of standard primitive proxies (for int& et al) to .cpp file. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion.hpp clio/trunk/clio/clio/dataconversion_extended.cpp clio/trunk/clio/clio/dataconversion_extended.hpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 11:05:12.898000002 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 11:37:27.279999971 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 Modified: clio/trunk/clio/clio/dataconversion.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 10:59:47 UTC (rev 8110) +++ clio/trunk/clio/clio/dataconversion.hpp 2008-02-25 11:00:37 UTC (rev 8111) @@ -534,8 +534,8 @@ CLIO_CONVERT_AS( TYPE, std::string ) CLIO_NODEFAULT_DATACONVERSION( std::string ); -CLIO_NODEFAULT_DATACONVERSION( char * ); -CLIO_NODEFAULT_DATACONVERSION( char const * ); +// CLIO_NODEFAULT_DATACONVERSION( char * ); +// CLIO_NODEFAULT_DATACONVERSION( char const * ); CLIO_NODEFAULT_DATACONVERSION( bool ); CLIO_NODEFAULT_DATACONVERSION( IoObject * ); @@ -551,9 +551,6 @@ template<> struct DataConverterDefsBase< NUMBER >: public DataConverterDefsBaseFloat{}; \ CLIO_NODEFAULT_DATACONVERSION( NUMBER ) -CLIO_CONVERT_AS_FLOAT( double ); -CLIO_CONVERT_AS_FLOAT( float ); - #define CLIO_CONVERT_AS_PRIMITIVE( PRIMITIVE ) \ CLIO_NODEFAULT_DATACONVERSION( PRIMITIVE & );\ CLIO_NODEFAULT_DATACONVERSION( PRIMITIVE const & );\ @@ -563,6 +560,8 @@ #define CLIO_CONVERT_AS_INT( NUMBER ) \ template<> struct DataConverterDefsBase< NUMBER >: public DataConverterDefsBaseInt{}; \ template<> struct DataConverterDefsBase< unsigned NUMBER >: public DataConverterDefsBaseIntUnsigned{}; \ +CLIO_CONVERT_AS_PRIMITIVE( NUMBER );\ +CLIO_CONVERT_AS_PRIMITIVE( unsigned NUMBER );\ CLIO_NODEFAULT_DATACONVERSION( NUMBER );\ CLIO_NODEFAULT_DATACONVERSION( unsigned NUMBER ) @@ -570,8 +569,14 @@ CLIO_CONVERT_AS_INT( short int ); CLIO_CONVERT_AS_INT( int ); CLIO_CONVERT_AS_INT( long int ); +CLIO_CONVERT_AS_FLOAT( double ); +CLIO_CONVERT_AS_FLOAT( float ); +CLIO_CONVERT_AS_PRIMITIVE( float ); +CLIO_CONVERT_AS_PRIMITIVE( double ); +CLIO_CONVERT_AS_PRIMITIVE( bool ); + } } Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 10:59:47 UTC (rev 8110) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 11:00:37 UTC (rev 8111) @@ -197,6 +197,23 @@ #define CLIO_OVERRIDE_DATACONVERSION_FLOAT( TYPE )\ DataConverterOverrider< TYPE, DataConverterNumber<DataConverterDefsBaseFloat> >::Register() +#define CLIO_OVERRIDE_DATACONVERSION_REFERENCE( TYPE )\ +DataConverterOverrider< TYPE &, DataConverterProxy<TYPE &, PrimitiveProxy< Proxy< TYPE > > > >::Register();\ +DataConverterOverrider< TYPE const &, DataConverterProxy<TYPE const &, PrimitiveProxy< Proxy< TYPE const > > > >::Register() + +#define CLIO_OVERRIDE_DATACONVERSION_POINTER( TYPE )\ +DataConverterOverrider< TYPE *, DataConverterProxy<TYPE *, PrimitiveProxy< Proxy< TYPE > > > >::Register();\ +DataConverterOverrider< TYPE const *, DataConverterProxy<TYPE const *, PrimitiveProxy< Proxy< TYPE const > > > >::Register() + +#define CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( TYPE )\ +CLIO_OVERRIDE_DATACONVERSION_REFERENCE( TYPE );\ +CLIO_OVERRIDE_DATACONVERSION_POINTER( TYPE ) + +#define CLIO_OVERRIDE_DATACONVERSION_INDIRECTION_INT( TYPE )\ +CLIO_OVERRIDE_DATACONVERSION_INT( TYPE );\ +CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( TYPE );\ +CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( unsigned TYPE );\ + void ForceLinkDataConversionExtended() { static bool done = false; @@ -211,18 +228,25 @@ // bools DataConverterOverrider< bool, DataConverterBool >::Register(); + + // numbers + CLIO_OVERRIDE_DATACONVERSION_INT( char ); + CLIO_OVERRIDE_DATACONVERSION_REFERENCE( char ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( unsigned char ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION_INT( short int ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION_INT( int ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION_INT( long int ); + CLIO_OVERRIDE_DATACONVERSION_FLOAT( float ); + CLIO_OVERRIDE_DATACONVERSION_FLOAT( double ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( float ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( double ); + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( bool ); + // strings DataConverterOverrider< std::string, DataConverterSTDString >::Register(); DataConverterOverrider< char const *, DataConverterCString >::Register(); DataConverterOverrider< char *, DataConverterMutableCString >::Register(); - // numbers - CLIO_OVERRIDE_DATACONVERSION_INT( char ); - CLIO_OVERRIDE_DATACONVERSION_INT( short int ); - CLIO_OVERRIDE_DATACONVERSION_INT( int ); - CLIO_OVERRIDE_DATACONVERSION_INT( long int ); - CLIO_OVERRIDE_DATACONVERSION_FLOAT( float ); - CLIO_OVERRIDE_DATACONVERSION_FLOAT( double ); } } Modified: clio/trunk/clio/clio/dataconversion_extended.hpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 10:59:47 UTC (rev 8110) +++ clio/trunk/clio/clio/dataconversion_extended.hpp 2008-02-25 11:00:37 UTC (rev 8111) @@ -291,7 +291,6 @@ #define CLIO_INSTANTIATE_PRIMITIVE( INT, NAME ) \ CLIO_INSTANTIATE_PRIMITIVE_PROXY( INT, NAME );\ -CLIO_CONVERTAS_PROXY_INDIRECTION( INT, PrimitiveProxy );\ CLIO_IO_COMPLETE_CLASSNAME( INT, "Clio " NAME ) #define CLIO_INSTANTIATE_PRIMITIVE_INT( INT, NAME ) \ @@ -301,15 +300,7 @@ CLIO_INSTANTIATE_PRIMITIVE_INT( long int, "LongInt" ); CLIO_INSTANTIATE_PRIMITIVE_INT( int, "Int" ); CLIO_INSTANTIATE_PRIMITIVE_INT( short int, "ShortInt" ); - -// chars need a bit of manual work, otherwise char * would not convert as string -CLIO_INSTANTIATE_PRIMITIVE_PROXY( char, "Char" ); -CLIO_IO_COMPLETE_CLASSNAME( char, "Clio " "Char" ); -CLIO_INSTANTIATE_PRIMITIVE_PROXY( unsigned char, "UnsignedChar" ); -CLIO_IO_COMPLETE_CLASSNAME( unsigned char, "Clio UnsignedChar" ); -CLIO_CONVERTAS_PROXY_REFERENCE( char, PrimitiveProxy ); -CLIO_CONVERTAS_PROXY_REFERENCE( unsigned char, PrimitiveProxy ); - +CLIO_INSTANTIATE_PRIMITIVE_INT( char, "Char" ); CLIO_INSTANTIATE_PRIMITIVE( std::string, "String" ); CLIO_INSTANTIATE_PRIMITIVE( double, "Double" ); CLIO_INSTANTIATE_PRIMITIVE( float, "Float" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 12:05:57
|
Revision: 8112 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8112&view=rev Author: bazaarmagetron Date: 2008-02-25 04:05:59 -0800 (Mon, 25 Feb 2008) Log Message: ----------- author: Manuel Moos Made gcc 4.0 happy. Fixed directory generation of tests. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion.cpp clio/trunk/clio/clio/primitiveproxy.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/tests/runtests.sh Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 11:37:27.279999971 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: clio + timestamp: 2008-02-25 12:37:57.757999897 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 Modified: clio/trunk/clio/clio/dataconversion.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion.cpp 2008-02-25 11:00:37 UTC (rev 8111) +++ clio/trunk/clio/clio/dataconversion.cpp 2008-02-25 12:05:59 UTC (rev 8112) @@ -47,8 +47,11 @@ if ( casts > wrapper->GetClassInfo().GetTotalBaseClassCount() ) { std::ostringstream s; - s << "'" << classInfo.GetName( IClassInfo::Name_IoComplete ) - << "' expected, got '" << wrapper->GetClassInfo().GetName( IClassInfo::Name_IoComplete ) + s << "'" << classInfo.GetName( IClassInfo::Name_IoComplete ) + << "[" << classInfo.GetName( IClassInfo::Name_C ) << "]" + << "' expected, got '" + << wrapper->GetClassInfo().GetName( IClassInfo::Name_IoComplete ) + << "[" << classInfo.GetName( IClassInfo::Name_C ) << "]" << "' instead"; thrower.Throw( s.str() ); } Modified: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 11:00:37 UTC (rev 8111) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 12:05:59 UTC (rev 8112) @@ -66,7 +66,7 @@ }; // specialize default constructor for strings -template<> inline PrimitiveWrapper< std::string >::PrimitiveWrapper(){}; +template<> inline PrimitiveWrapper< std::string >::PrimitiveWrapper(){} template< class BASE > typename ConstPrimitiveProxy<BASE>::WRAPPER * ConstPrimitiveProxy<BASE>::clone() const Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 11:00:37 UTC (rev 8111) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 12:05:59 UTC (rev 8112) @@ -377,7 +377,7 @@ static inline IoObject * ToIo( IoState * state, TArg from, DataConversionCall const & call ) { // delegate to const/non-const implementation - return ToIo( state, from, call, BoolToType< TestConst< TArg >::IsConst >() ); + return ToIo( state, from, call, BoolToType< TestConst< typename ReoveIndirection< TArg >::Direct >::IsConst >() ); } }; Modified: clio/trunk/clio/tests/runtests.sh =================================================================== --- clio/trunk/clio/tests/runtests.sh 2008-02-25 11:00:37 UTC (rev 8111) +++ clio/trunk/clio/tests/runtests.sh 2008-02-25 12:05:59 UTC (rev 8112) @@ -4,6 +4,7 @@ BASES=`echo ${srcdir}/*.test | sed -e "s,${srcdir}/,,g" -e "s,.test,,g"` for f in $BASES; do + mkdir -p $f.test mkdir -p .deps/$f.test done This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 12:06:54
|
Revision: 8113 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8113&view=rev Author: bazaarmagetron Date: 2008-02-25 04:06:59 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Manuel Moos: More informative error output, difficult classes get their C++ type printed along with the Io name. Tests fail for cosmetic reasons. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion.cpp clio/trunk/clio/clio/dataconversion_extended.cpp clio/trunk/clio/clio/iclassinfo.cpp clio/trunk/clio/clio/iclassinfo.hpp clio/trunk/clio/clio/primitiveproxy.hpp clio/trunk/clio/clio/proxy.hpp clio/trunk/clio/tests/runtest.sh Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 12:37:57.757999897 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src + timestamp: 2008-02-25 12:59:32.980999947 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk Modified: clio/trunk/clio/clio/dataconversion.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion.cpp 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/clio/dataconversion.cpp 2008-02-25 12:06:59 UTC (rev 8113) @@ -47,12 +47,10 @@ if ( casts > wrapper->GetClassInfo().GetTotalBaseClassCount() ) { std::ostringstream s; - s << "'" << classInfo.GetName( IClassInfo::Name_IoComplete ) - << "[" << classInfo.GetName( IClassInfo::Name_C ) << "]" - << "' expected, got '" - << wrapper->GetClassInfo().GetName( IClassInfo::Name_IoComplete ) - << "[" << classInfo.GetName( IClassInfo::Name_C ) << "]" - << "' instead"; + classInfo.WriteName( s ); + s << "' expected, got '"; + wrapper->GetClassInfo().WriteName(s); + s << "' instead"; thrower.Throw( s.str() ); } Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 12:06:59 UTC (rev 8113) @@ -141,7 +141,7 @@ if ( !ISNUMBER( from ) ) { std::ostringstream error; - error << "Number expected, got '" << IoObject_name( from ) << "' instead"; + error << "'Number' expected, got '" << IoObject_name( from ) << "' instead"; thrower.Throw( error.str() ); } } @@ -151,7 +151,7 @@ if ( !ISSEQ( from ) ) { std::ostringstream error; - error << "Sequence expected, got '" << IoObject_name( from ) << "' instead"; + error << "'Sequence' expected, got '" << IoObject_name( from ) << "' instead"; thrower.Throw( error.str() ); } } Modified: clio/trunk/clio/clio/iclassinfo.cpp =================================================================== --- clio/trunk/clio/clio/iclassinfo.cpp 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/clio/iclassinfo.cpp 2008-02-25 12:06:59 UTC (rev 8113) @@ -13,6 +13,7 @@ #include "ifunctioninfo.hpp" #include "state.hpp" #include "namespace.hpp" +#include "namemangling.hpp" #include <deque> #include <iostream> @@ -577,12 +578,24 @@ }; */ +void IClassInfo::WriteName( std::ostream & s ) const CLIO_NOTHROW +{ + s << GetName( Name_IoComplete ); + std::string cname = Uppercase( GetName( Name_C ).c_str() ); + if ( GetName( Name_Template ).size() && cname != GetName( Name_IoComplete ) && cname != GetName( Name_IoRaw ) ) + { + s << " [" << GetName( Name_C ) << ']'; + } +} + // tag creator IoTag * IClassInfo::Tag( IoState * state ) const CLIO_NOTHROW { // create tag - IoTag* tag = IoTag_newWithName_( const_cast< char * >( GetName( Name_IoComplete ).c_str() ) ); - + std::stringstream s; + WriteName( s ); + IoTag* tag = IoTag_newWithName_( const_cast< char * >( s.str().c_str() ) ); + // fill with the various function pointers and the state tag->state = state; tag->cloneFunc = (IoTagCloneFunc*) RawClone; Modified: clio/trunk/clio/clio/iclassinfo.hpp =================================================================== --- clio/trunk/clio/clio/iclassinfo.hpp 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/clio/iclassinfo.hpp 2008-02-25 12:06:59 UTC (rev 8113) @@ -54,10 +54,13 @@ IClassInfo() CLIO_NOTHROW; virtual ~IClassInfo() CLIO_NOTHROW; - // returns a name of this class + // returns a name of this class std::string const & GetName( NameType type = Name_C ) const CLIO_NOTHROW; - // sets a name of this class + // Writes the full name (Io name plus C name if that differs) to a stream + void WriteName( std::ostream & s ) const CLIO_NOTHROW; + + // sets a name of this class inline IClassInfo & SetName( NameType type, std::string const & name ) { name_[type] = name; Modified: clio/trunk/clio/clio/primitiveproxy.hpp =================================================================== --- clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/clio/primitiveproxy.hpp 2008-02-25 12:06:59 UTC (rev 8113) @@ -135,12 +135,10 @@ CLIO_INJECTCODE( clio::primitiveProxyCode ); // transfer name -#if 0 clio::NameSurgeon< CLASS, ConstPrimitiveProxy< Proxy< T1 > > >::Operate(); clio::NameSurgeon< CLASS, BASE >::Operate(); clio::NameSurgeon< CLASS, Proxy< TNONCONST > >::Operate(); clio::NameSurgeon< CLASS, PrimitiveProxy< Proxy< TNONCONST > > >::Operate(); -#endif } CLIO_TEMPLATE_CLASS_NOMASTER( clio::PrimitiveWrapper, (1,(class)), clio::PrimitiveProxyNoMaster ); Modified: clio/trunk/clio/clio/proxy.hpp =================================================================== --- clio/trunk/clio/clio/proxy.hpp 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/clio/proxy.hpp 2008-02-25 12:06:59 UTC (rev 8113) @@ -391,12 +391,7 @@ // transfer the name static void Operate() { - std::stringstream s; - s << ClassInfo< DEST >::Get().GetName( IClassInfo::Name_IoComplete ) - << "[short: " - << ClassInfo< SOURCE >::Get().GetName( IClassInfo::Name_IoComplete ) - << "]"; - ClassInfo< DEST >::Get().SetName( IClassInfo::Name_IoComplete, s.str() ); + ClassInfo< DEST >::Get().SetName( IClassInfo::Name_IoComplete, ClassInfo< SOURCE >::Get().GetName( IClassInfo::Name_IoComplete ) ); } }; Modified: clio/trunk/clio/tests/runtest.sh =================================================================== --- clio/trunk/clio/tests/runtest.sh 2008-02-25 12:05:59 UTC (rev 8112) +++ clio/trunk/clio/tests/runtest.sh 2008-02-25 12:06:59 UTC (rev 8113) @@ -19,14 +19,15 @@ ${dir}/${dir} | tee ${raw} || { echo Failed!; exit -1; } sed -u -e "s,_0x[0-9a-f]*,_0xHEXCODE,g" -e "s,^${fulldir}/,," < ${raw} | grep -v IoState_doCString | grep -v "\[unlabeled\]" | grep -v "^ ---------" > ${processed} -if diff -U 5 -b -B ${srcdir}/${dir}/output.txt ${processed}; then +if diff -U 5 -b -B ${srcdir}/${dir}/output.txt ${processed} > ${dir}/output_diff.txt; then echo -e "\n\n ************ test $* passed! **********\n\n" touch $1 rm ${dirbase}.failed - rm -f $*.failed; + rm -f $*.failed ${dir}/output_diff.txt ${dir}/output_failed.txt else echo Failed! - cp ${processed} failed_output.txt + cat ${dir}/output_diff.txt + cp ${processed} ${dir}/output_failed.txt ret=1 fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 12:41:47
|
Revision: 8114 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8114&view=rev Author: bazaarmagetron Date: 2008-02-25 04:41:51 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Manuel Moos: Added string reference conversion, whoops. Modified Paths: -------------- clio/trunk/clio/clio/dataconversion_extended.cpp Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 12:59:32.980999947 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src + timestamp: 2008-02-25 13:08:44.848000050 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk 51 z-...@us...-20080225120844-31fhi28emjcs4ys6 Modified: clio/trunk/clio/clio/dataconversion_extended.cpp =================================================================== --- clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 12:06:59 UTC (rev 8113) +++ clio/trunk/clio/clio/dataconversion_extended.cpp 2008-02-25 12:41:51 UTC (rev 8114) @@ -242,11 +242,12 @@ CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( double ); CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( bool ); + // strings + CLIO_OVERRIDE_DATACONVERSION_INDIRECTION( std::string ); DataConverterOverrider< std::string, DataConverterSTDString >::Register(); DataConverterOverrider< char const *, DataConverterCString >::Register(); DataConverterOverrider< char *, DataConverterMutableCString >::Register(); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 12:43:19
|
Revision: 8115 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8115&view=rev Author: bazaarmagetron Date: 2008-02-25 04:43:25 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Manuel Moos: Added a comfortable way to adapt the output.txt files to changed expectations: 'make checkresults' Modified Paths: -------------- clio/trunk/clio/tests/Makefile.am Added Paths: ----------- clio/trunk/clio/tests/checkresults.sh Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 13:08:44.848000050 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src + timestamp: 2008-02-25 13:22:24.299999952 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src Name: bzr:file-ids - + tests/checkresults.sh checkresults.sh-20080225122218-n5t4dwazcc233c31-1 Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk 51 z-...@us...-20080225120844-31fhi28emjcs4ys6 + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk 51 z-...@us...-20080225120844-31fhi28emjcs4ys6 52 z-...@us...-20080225122224-wrmmr1nt5w9106rg Modified: clio/trunk/clio/tests/Makefile.am =================================================================== --- clio/trunk/clio/tests/Makefile.am 2008-02-25 12:41:51 UTC (rev 8114) +++ clio/trunk/clio/tests/Makefile.am 2008-02-25 12:43:25 UTC (rev 8115) @@ -33,4 +33,7 @@ tests: ${LIBCLIO} MAKE=${MAKE} srcdir=${srcdir} ${srcdir}/runtests.sh +checkresults: + srcdir=${srcdir} ${srcdir}/checkresults.sh + Added: clio/trunk/clio/tests/checkresults.sh =================================================================== --- clio/trunk/clio/tests/checkresults.sh (rev 0) +++ clio/trunk/clio/tests/checkresults.sh 2008-02-25 12:43:25 UTC (rev 8115) @@ -0,0 +1,24 @@ +#! /bin/sh + +# get list of tests +BASES=`echo ${srcdir}/*.test | sed -e "s,${srcdir}/,,g" -e "s,.test,,g"` + +# iterate over them +for f in $BASES; do + if test -r $f.failed; then + echo "" + echo "" + echo "" + echo "Test $f failed, here is the diff:" + cat $f.test/output_diff.txt + echo "" + echo "Are those differences only cosmetic or expected due to changes in the test?" + answer=`line` + if test "x$answer" = "xyes"; then + echo "Ok then, copying the actual result over to the expected result." + cp $f.test/output_failed.txt ${srcdir}/$f.test/output.txt + else + echo "Then go and fix stuff, dammit!" + fi + fi +done Property changes on: clio/trunk/clio/tests/checkresults.sh ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-02-25 12:45:11
|
Revision: 8116 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8116&view=rev Author: bazaarmagetron Date: 2008-02-25 04:45:16 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Manuel Moos: Still prettier classnames, adapted expected test outputs to them. Modified Paths: -------------- clio/trunk/clio/clio/iclassinfo.cpp clio/trunk/clio/clio/namespace.cpp clio/trunk/clio/clio/namespace.hpp clio/trunk/clio/tests/adhoc.test/adhoc.test.io clio/trunk/clio/tests/basic.test/output.txt clio/trunk/clio/tests/constructor.test/output.txt clio/trunk/clio/tests/conversion.test/output.txt clio/trunk/clio/tests/enum.test/output.txt clio/trunk/clio/tests/overloads.test/output.txt clio/trunk/clio/tests/reference.test/output.txt clio/trunk/clio/tests/stack.test/output.txt clio/trunk/clio/tests/templates.test/output.txt clio/trunk/clio/tests/virtual.test/output.txt Property Changed: ---------------- clio/trunk/clio/ Property changes on: clio/trunk/clio ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-25 13:22:24.299999952 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src + timestamp: 2008-02-25 13:36:06.283999920 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: src Name: bzr:file-ids - tests/checkresults.sh checkresults.sh-20080225122218-n5t4dwazcc233c31-1 + Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk 51 z-...@us...-20080225120844-31fhi28emjcs4ys6 52 z-...@us...-20080225122224-wrmmr1nt5w9106rg + 4 z-...@us...-20080222202821-mkuiwckx41jof2gj 5 z-...@us...-20080222202957-htiysaaxkiroqd7e 6 z-...@us...-20080222211806-jc50b77qlgn2dp8j 7 z-...@us...-20080222215601-p8y78c77ncvq5eb1 8 z-...@us...-20080222223809-mmh9wh6yzrdm7oa1 9 z-...@us...-20080222232123-uhnuqd9db0p27rkf 10 z-...@us...-20080222232154-k64q4ee9zuq5r2jp 11 z-...@us...-20080222234236-ny0hc8lwybz73rv6 12 z-...@us...-20080223000039-566psft2c96236kw 13 z-...@us...-20080223000530-4mtket15l6oeo1ju 14 z-...@us...-20080223001030-5t86d3u3bidpoq6r 15 z-...@us...-20080223002857-qvx8z72tmsoguku0 16 z-...@us...-20080223004917-abqn3vdfqb1euyzc 17 z-...@us...-20080223010025-h0nul9yntjvutdbq 18 z-...@us...-20080223013357-1nzhrjwjr4g0h7g9 19 z-...@us...-20080223015240-btmt95d1vvlip4gl 20 z-...@us...-20080223124731-dlwuagon76gq2o3g 21 z-...@us...-20080223133015-0hjqyrki59ydwdcv 22 z-...@us...-20080223135113-icwd4g99yev9n0u2 23 z-...@us...-20080223152916-8rm942q1rmjlueca 24 z-...@us...-20080223174524-3lb2wm6tt5nytd4b 25 z-...@us...-20080223174610-gwmr3fn8456rwvmg 26 z-...@us...-20080223183115-ub0hshkf3zfs69ko 27 z-...@us...-20080223185539-cvhsltp2u12d5lgc 28 z-...@us...-20080223211352-km18u9bp9qhufyta 29 z-...@us...-20080223225132-94n2bwt307fujbg4 30 z-...@us...-20080223234541-mqp3d64uyn3no98y 31 z-...@us...-20080223235231-5lshcanhqlkwv36n 32 z-...@us...-20080224001425-n6xziwrp0hh3nz2f 33 z-...@us...-20080224161454-lyyn0grllfn5qx8w 34 z-...@us...-20080224180639-fr6dqfch7kboocs0 35 z-...@us...-20080224181843-8iq9zyjoz4dprm8b 36 z-...@us...-20080224224147-cmxp11hux8yn3jbp 37 z-...@us...-20080224224848-0h65c9bpg637lgar 38 z-...@us...-20080224225219-0arhdm8hw42hptrf 39 z-...@us...-20080225000421-fh9p1qmu32awa41y 40 z-...@us...-20080225000607-bsvlilqbv5ssltr3 41 z-...@us...-20080225003311-fnfdbdvp3p2bw8b4 42 z-...@us...-20080225013618-jrkbe6q8gpdzbj3n 43 z-...@us...-20080225015144-8j759e33zdztmena 44 z-...@us...-20080225022114-1360a7t61rtei61d 45 z-...@us...-20080225023750-vf22upkbeiyoclbc 46 z-...@us...-20080225024308-j2a0nomtfuzfbjf8 47 z-...@us...-20080225100512-ck04wcqo0w3jibyq 48 z-...@us...-20080225103727-f42008yfu3y6q5r5 49 z-...@us...-20080225113757-opine59p0ak9r6h0 50 z-...@us...-20080225115932-akfi8jo7apw0phkk 51 z-...@us...-20080225120844-31fhi28emjcs4ys6 52 z-...@us...-20080225122224-wrmmr1nt5w9106rg 53 z-...@us...-20080225123606-ts2l2h3aivk9pplp Modified: clio/trunk/clio/clio/iclassinfo.cpp =================================================================== --- clio/trunk/clio/clio/iclassinfo.cpp 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/clio/iclassinfo.cpp 2008-02-25 12:45:16 UTC (rev 8116) @@ -581,11 +581,21 @@ void IClassInfo::WriteName( std::ostream & s ) const CLIO_NOTHROW { s << GetName( Name_IoComplete ); - std::string cname = Uppercase( GetName( Name_C ).c_str() ); - if ( GetName( Name_Template ).size() && cname != GetName( Name_IoComplete ) && cname != GetName( Name_IoRaw ) ) + + // no template? No extra C++ name. + if ( GetName( Name_Template ).size() == 0 ) { - s << " [" << GetName( Name_C ) << ']'; + return; } + + // basic C++ name matches basic Io name? No extra name printing. + std::string cname = Uppercase( NameSpace::Split( GetName( Name_C ) ).second.c_str() ); + if ( cname == GetName( Name_IoRaw ) ) + { + return; + } + + s << " [" << GetName( Name_C ) << ']'; } // tag creator Modified: clio/trunk/clio/clio/namespace.cpp =================================================================== --- clio/trunk/clio/clio/namespace.cpp 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/clio/namespace.cpp 2008-02-25 12:45:16 UTC (rev 8116) @@ -46,7 +46,7 @@ }; // splits a name into namespace and class name -static std::pair< std::string, std::string > Split( std::string base ) +std::pair< std::string, std::string > NameSpace::Split( std::string base ) { // find the last :, take care of <> size_t lastColon = base.size(); Modified: clio/trunk/clio/clio/namespace.hpp =================================================================== --- clio/trunk/clio/clio/namespace.hpp 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/clio/namespace.hpp 2008-02-25 12:45:16 UTC (rev 8116) @@ -21,6 +21,9 @@ // returns the default namespace static NameSpace & GetDefaultNameSpace(); + // splits a name into namespace and class name + static std::pair< std::string, std::string > Split( std::string base ); + // gets a namespace of a given class name static NameSpace & GetNameSpace( std::string const & name ); Modified: clio/trunk/clio/tests/adhoc.test/adhoc.test.io =================================================================== --- clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/adhoc.test/adhoc.test.io 2008-02-25 12:45:16 UTC (rev 8116) @@ -0,0 +1 @@ + Modified: clio/trunk/clio/tests/basic.test/output.txt =================================================================== --- clio/trunk/clio/tests/basic.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/basic.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -23,7 +23,7 @@ expecting error: <<<< writeln( testObject double("har") ) - Exception: Number expected, got 'Sequence' instead (parsing argument 0 of desired type 'int' during call of C++ function 'TestWrapper::double( int )') + Exception: 'Number' expected, got 'Sequence' instead (parsing argument 0 of desired type 'int' during call of C++ function 'TestWrapper::double( int )') <<<< writeln( testObject len("har") ) 3 Modified: clio/trunk/clio/tests/constructor.test/output.txt =================================================================== --- clio/trunk/clio/tests/constructor.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/constructor.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -7,11 +7,11 @@ <<<< y := CT ConstructTest2 with(1) - Exception: Sequence expected, got 'Number' instead (parsing argument 0 of desired type 'char const *' during call of C++ function 'CT::ConstructTest2::with( char const * )') + Exception: 'Sequence' expected, got 'Number' instead (parsing argument 0 of desired type 'char const *' during call of C++ function 'CT::ConstructTest2::with( char const * )') <<<< y := CT ConstructTest2 with2(1) - Exception: Sequence expected, got 'Number' instead (parsing argument 0 of desired type 'char const *' during call of C++ function 'CT::ConstructTest2::with2( char const * )') + Exception: 'Sequence' expected, got 'Number' instead (parsing argument 0 of desired type 'char const *' during call of C++ function 'CT::ConstructTest2::with2( char const * )') <<<< y := ConstructTest1 with("bla") bla Modified: clio/trunk/clio/tests/conversion.test/output.txt =================================================================== --- clio/trunk/clio/tests/conversion.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/conversion.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -2,7 +2,7 @@ <<<< x := DataConversion clone <<<< x f5( DataConversionDummy ) - Exception: 'Clio ProxyNonConst With(DataConversion)' expected, got 'DataConversionDummy' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') + Exception: Clio ProxyNonConst With(DataConversion) [clio::ProxyNonConst<DataConversion *>]' expected, got 'DataConversionDummy' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') <<<< DataConversion f1 <<<< DataConversion f2(true) println @@ -18,12 +18,12 @@ 1 <<<< x f5( x ) - Exception: 'Clio ProxyNonConst With(DataConversion)' expected, got 'DataConversion' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') + Exception: Clio ProxyNonConst With(DataConversion) [clio::ProxyNonConst<DataConversion *>]' expected, got 'DataConversion' instead (parsing argument 0 of desired type 'DataConversion * *' during call of C++ function 'DataConversion::f5( DataConversion * * )') <<<< x f5_2( x ) 0 <<<< DataConversion f3_2(2) type println -Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Int)) +Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Int)) [clio::ConstPrimitiveProxy<clio::Proxy<int const>>] <<<< DataConversion f3_2(2) set(3) Exception: Number does not respond to 'set' Modified: clio/trunk/clio/tests/enum.test/output.txt =================================================================== --- clio/trunk/clio/tests/enum.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/enum.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -8,7 +8,7 @@ <<<< EnumTest get type println TestEnum <<<< EnumTest access type println -Clio PrimitiveProxy With(Clio Proxy With(TestEnum)) +Clio Ref With(TestEnum) [clio::PrimitiveProxy<clio::Proxy<TestEnum>>] # testing access <<<< EnumTest get println @@ -32,7 +32,7 @@ <<<< r := Clio Ref With(TestEnum) <<<< r = r with( TestEnum value3 ) <<<< r type println -Clio Ref With(TestEnum) +Clio Ref With(TestEnum) [clio::PrimitiveWrapper<TestEnum>] <<<< r println value3 Modified: clio/trunk/clio/tests/overloads.test/output.txt =================================================================== --- clio/trunk/clio/tests/overloads.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/overloads.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -16,21 +16,21 @@ <<<< x g( x h_float ) h<float> - Exception: No fitting overload found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))'. The candidates say: -overloads.cpp:74 : OverloadTest2::g( char const & ) : 'Clio ProxyConst With(Clio Char)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') -overloads.cpp:67 : OverloadTest2::g( string ) : Sequence expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'string') -overloads.cpp:68 : OverloadTest2::g( int ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'int') -overloads.cpp:69 : OverloadTest2::g( float ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'float') -overloads.cpp:70 : OverloadTest2::g( double ) : Number expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'double') -overloads.cpp:71 : OverloadTest2::g( double const & ) : 'Clio ProxyConst With(Clio Double)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'double const &') -overloads.cpp:72 : OverloadTest2::g( int const & ) : 'Clio ProxyConst With(Clio Int)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'int const &') -overloads.cpp:73 : OverloadTest2::g( char const & ) : 'Clio ProxyConst With(Clio Char)' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float))' instead (parsing argument 0 of desired type 'char const &') + Exception: No fitting overload found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]'. The candidates say: +overloads.cpp:74 : OverloadTest2::g( char const & ) : Clio ProxyConst With(Clio Char) [clio::ProxyConst<char>]' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'char const &') +overloads.cpp:67 : OverloadTest2::g( string ) : 'Sequence' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'string') +overloads.cpp:68 : OverloadTest2::g( int ) : 'Number' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'int') +overloads.cpp:69 : OverloadTest2::g( float ) : 'Number' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'float') +overloads.cpp:70 : OverloadTest2::g( double ) : 'Number' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'double') +overloads.cpp:71 : OverloadTest2::g( double const & ) : Clio ProxyConst With(Clio Double) [clio::ProxyConst<double>]' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'double const &') +overloads.cpp:72 : OverloadTest2::g( int const & ) : Clio ProxyConst With(Clio Int) [clio::ProxyConst<int>]' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'int const &') +overloads.cpp:73 : OverloadTest2::g( char const & ) : Clio ProxyConst With(Clio Char) [clio::ProxyConst<char>]' expected, got 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Float)) [clio::ConstPrimitiveProxy<clio::Proxy<float const>>]' instead (parsing argument 0 of desired type 'char const &') (during call of C++ function 'OverloadTest2::g( char const & )') <<<< x g( x h_char ) h<char> - Exception: Too many equally fitting overloads found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Char))'. The candidates are: + Exception: Too many equally fitting overloads found for passed argument of type 'Clio ConstPrimitiveProxy With(Clio Proxy With(Clio Char)) [clio::ConstPrimitiveProxy<clio::Proxy<char const>>]'. The candidates are: overloads.cpp:74 : OverloadTest2::g( char const & ) overloads.cpp:73 : OverloadTest2::g( char const & ) (during call of C++ function 'OverloadTest2::g( char const & )') Modified: clio/trunk/clio/tests/reference.test/output.txt =================================================================== --- clio/trunk/clio/tests/reference.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/reference.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -13,7 +13,7 @@ <<<< writeln("bla" .. x) blablubb <<<< x type println -Clio PrimitiveProxy With(Clio Proxy With(Clio String)) +Clio Ref With(Clio String) [clio::PrimitiveProxy<clio::Proxy<string>>] <<<< z := x clone <<<< z println blubb Modified: clio/trunk/clio/tests/stack.test/output.txt =================================================================== --- clio/trunk/clio/tests/stack.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/stack.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -36,9 +36,9 @@ 2 <<<< x getInts clone type println -Std Vector With(Clio Int) +Std Vector With(Clio Int) [clio::VectorWrapper<int>] <<<< Std Vector clone type println -Std Vector +Std Vector [clio::VectorWrapper<clio::GCPointer< IoObject >>] <<<< Std VectorWrapper clone type println Exception: Std does not respond to 'VectorWrapper' Modified: clio/trunk/clio/tests/templates.test/output.txt =================================================================== --- clio/trunk/clio/tests/templates.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/templates.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -1,14 +1,14 @@ # testing whether template masters were correctly handled <<<< B XX With(Clio Int) clone type println -B X_int +B X_int [a::X<int>] <<<< B YY With(Clio Int) clone type println -B Y_int +B Y_int [a::Y<int>] <<<< NN With(Clio Int) clone type println -NN_int +NN_int [NONAME<int>] <<<< B X_int type println -B X_int +B X_int [a::X<int>] <<<< B Y_int type println -B Y_int +B Y_int [a::Y<int>] # expecting errors on the next command block <<<< A Y @@ -35,13 +35,13 @@ # some typename tests <<<< B XX type println -B XX +B XX [a::X<clio::GCPointer< IoObject >>] <<<< B YY type println -B YY +B YY [a::Y] <<<< Clio Ref type println -Clio Ref +Clio Ref [clio::PrimitiveWrapper] <<<< Base TemplateTestBase_Sequence_Object_3 type println -Base TemplateTestBase_Sequence_Object_3 +Base TemplateTestBase_Sequence_Object_3 [base::TemplateTestBase<string,clio::GCPointer< IoObject >,3>] <<<< TemplateTestBase_Sequence_Object_3 type println Exception: Object does not respond to 'TemplateTestBase_Sequence_Object_3' @@ -50,7 +50,7 @@ <<<< testObject := TemplateTest With( Number ) clone <<<< testObject type println -TemplateTest With(Clio Float) +TemplateTest With(Clio Float) [TemplateTest<float>] <<<< testObject2 := TemplateTest With( Sequence ) clone <<<< testObject3 := TemplateTest clone <<<< testObject4 := Base TemplateTestBase clone @@ -64,12 +64,12 @@ <<<< testObject4 := Base TemplateTestBase With( Sequence, Sequence, 2 ) clone <<<< testObject4 type println -Base TemplateTestBase With(Clio String,Clio String,2) +Base TemplateTestBase With(Clio String,Clio String,2) [base::TemplateTestBase<string,string,2>] <<<< testObject4 h() println 2 <<<< testObject4 := Base TemplateTestBase With( Sequence, Sequence, 3 ) clone <<<< testObject4 type println -Base TemplateTestBase_Sequence_Object_3 +Base TemplateTestBase_Sequence_Object_3 [base::TemplateTestBase<string,clio::GCPointer< IoObject >,3>] <<<< testObject4 h() println 3 <<<< testObject f(1) println @@ -95,11 +95,11 @@ <<<< testObject3 create() println nil <<<< TemplateTest With( testObject ) type println -TemplateTest +TemplateTest [TemplateTest<clio::GCPointer< IoObject >>] <<<< TemplateTest With( testObject ) create() println nil <<<< TemplateTest With( TemplateTest ) create() type println -TemplateTest +TemplateTest [TemplateTest<clio::GCPointer< IoObject >>] <<<< testObject3 create() println nil <<<< testObject3 v( list(1,2,3) ) println Modified: clio/trunk/clio/tests/virtual.test/output.txt =================================================================== --- clio/trunk/clio/tests/virtual.test/output.txt 2008-02-25 12:43:25 UTC (rev 8115) +++ clio/trunk/clio/tests/virtual.test/output.txt 2008-02-25 12:45:16 UTC (rev 8116) @@ -18,7 +18,7 @@ function1 in script Function2 in script:test - Exception: Sequence expected, got 'nil' instead (during call of C++ function 'Extensible::callVirtuals()') + Exception: 'Sequence' expected, got 'nil' instead (during call of C++ function 'Extensible::callVirtuals()') <<<< Extended function2 := method(s, writeln("E2", s) resend) <<<< testObject := Extended clone This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |