From 0bfda486167432a9da8eec62b4578a22592a9275 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Mar 2009 17:32:01 +0200 Subject: Add generation of detach functions New option: --generate-detach. Also added detach/attach functionality to var_seq, non-STL str_seq, and string_base. --- xsde/cxx/hybrid/tree-header.cxx | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'xsde/cxx/hybrid/tree-header.cxx') diff --git a/xsde/cxx/hybrid/tree-header.cxx b/xsde/cxx/hybrid/tree-header.cxx index 2412b86..dc378fe 100644 --- a/xsde/cxx/hybrid/tree-header.cxx +++ b/xsde/cxx/hybrid/tree-header.cxx @@ -178,6 +178,16 @@ namespace CXX os << "void" << endl << value << " (char*);" << endl; + + // char* + // detach () + // + if (detach) + { + os << "char*" << endl + << uc.get ("value-detach") << " ();" + << endl; + } } // Custom data. @@ -1050,6 +1060,17 @@ namespace CXX arg_.dispatch (t); os << ");" << endl; + + // type* + // detach () + // + if (detach && !fixed_length (t)) + { + arg_.dispatch (t); + os << endl + << edetach (a) << " ();" + << endl; + } } private: @@ -1150,6 +1171,17 @@ namespace CXX arg_.dispatch (t); os << ");" << endl; + + // type* + // detach () + // + if (detach && !fixed_length (t)) + { + arg_.dispatch (t); + os << endl + << edetach (e) << " ();" + << endl; + } } } @@ -1293,6 +1325,16 @@ namespace CXX os << ");" << endl; + + // type* + // detach () + // + if (detach && !fl) + { + os << type << "*" << endl + << edetach (a) << " ();" + << endl; + } } else All::contains (a); @@ -1571,6 +1613,16 @@ namespace CXX os << ");" << endl; + + // type* + // detach () + // + if (detach && !fl) + { + os << type << "*" << endl + << edetach (c) << " ();" + << endl; + } } } @@ -1786,6 +1838,16 @@ namespace CXX os << ");" << endl; + + // type* + // detach () + // + if (detach && !fl) + { + os << type << "*" << endl + << edetach (c) << " ();" + << endl; + } } } @@ -1970,6 +2032,16 @@ namespace CXX os << ");" << endl; + + // type* + // detach () + // + if (detach && !fl) + { + os << type << "*" << endl + << edetach (s) << " ();" + << endl; + } } } @@ -2149,6 +2221,16 @@ namespace CXX os << ");" << endl; + + // type* + // detach () + // + if (detach && !fl) + { + os << type << "*" << endl + << edetach (s) << " ();" + << endl; + } } } -- cgit v1.1