[pygccxml-commit] source/pyplusplus/unittests/data private_assign_to_be_exported.hpp,NONE,1.1 member
Brought to you by:
mbaas,
roman_yakovenko
From: Roman <rom...@us...> - 2006-04-23 14:39:06
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29364/pyplusplus/unittests/data Modified Files: member_variables_to_be_exported.cpp member_variables_to_be_exported.hpp Added Files: private_assign_to_be_exported.hpp Log Message: adding new functionality: if class is used as member variabel, but does not have public assign operator, def_readonly will be used if class has pointer as member variable, it is exposed correctly --- NEW FILE: private_assign_to_be_exported.hpp --- // Copyright 2004 Roman Yakovenko. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef __private_assign_to_be_exported_hpp__ #define __private_assign_to_be_exported_hpp__ #include <memory> #include "boost/shared_ptr.hpp" namespace private_assign{ class item_t{ public: item_t() : m_value ( 24 ) {} private: item_t& operator=( const item_t& other ){ m_value = other.m_value; } public: int m_value; }; struct container_t{ container_t(){ m_item.m_value = 23; } item_t m_item; }; } #endif//__smart_pointers_to_be_exported_hpp__ Index: member_variables_to_be_exported.cpp =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/data/member_variables_to_be_exported.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** member_variables_to_be_exported.cpp 16 Nov 2005 06:05:23 -0000 1.3 --- member_variables_to_be_exported.cpp 23 Apr 2006 14:39:00 -0000 1.4 *************** *** 23,26 **** --- 23,42 ---- } + namespace pointers{ + + std::auto_ptr<tree_node_t> create_tree(){ + std::auto_ptr<tree_node_t> root( new tree_node_t() ); + root->data = new data_t(); + root->data->value = 0; + + root->left = new tree_node_t( root.get() ); + root->left->data = new data_t(); + root->left->data->value = 1; + + return root; + } + + } + } Index: member_variables_to_be_exported.hpp =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/data/member_variables_to_be_exported.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** member_variables_to_be_exported.hpp 23 Nov 2005 14:04:32 -0000 1.10 --- member_variables_to_be_exported.hpp 23 Apr 2006 14:39:00 -0000 1.11 *************** *** 6,9 **** --- 6,10 ---- #ifndef __member_variables_to_be_exported_hpp__ #define __member_variables_to_be_exported_hpp__ + #include <memory> namespace member_variables{ *************** *** 63,70 **** const variable_t vars[3]; ! int ivars[10]; int ivars2[10]; }; } --- 64,109 ---- const variable_t vars[3]; ! int ivars[10]; int ivars2[10]; }; + namespace pointers{ + + struct data_t{ + data_t() : value( 201 ) {} + int value; + static char* reserved; + }; + + struct tree_node_t{ + data_t *data; + tree_node_t *left; + tree_node_t *right; + const tree_node_t *parent; + + tree_node_t(const tree_node_t* parent=0) + : data(0) + , left( 0 ) + , right( 0 ) + , parent( parent ) + {} + + ~tree_node_t(){ + if( left ){ + delete left; + } + if( right ){ + delete right; + } + if( data ){ + delete data; + } + } + }; + + std::auto_ptr<tree_node_t> create_tree(); + + } + } |