update docs about private/protected class/members

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7421 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-09-10 21:12:35 +00:00
commit 2d7540f33c

View file

@ -775,10 +775,14 @@ SWIG is unable to support kwargs when wrapping overloaded methods, so the defaul
<p>
SWIG can only wrap class members that are declared public. Anything
specified in a private or protected section will simply be ignored (although
the internal code generator sometimes looks at the contents of the private and protected
sections so that it can properly generate code for default constructors and destructors).
SWIG wraps class members that are public following the C++
conventions, i.e., by explicit public declaration or by the use of
the <tt using</tt> directive. In general, anything specified in a
private or protected section will be ignored, although the internal
code generator sometimes looks at the contents of the private and
protected sections so that it can properly generate code for default
constructors and destructors. Directors could also modify the way
non-public virtual protected members are treated.
</p>
<p>
@ -1065,20 +1069,24 @@ if possible (consider using references instead).
<p>
SWIG supports C++ public inheritance of classes and allows both
single and multiple inheritance. The SWIG type-checker knows about the
relationship between base and derived classes and allows pointers
to any object of a derived class to be used in functions of a base
class. The type-checker properly casts pointer values and is safe to
use with multiple inheritance.
SWIG supports C++ inheritance of classes and allows both single and
multiple inheritance, as limited or allowed by the target
language. The SWIG type-checker knows about the relationship between
base and derived classes and allows pointers to any object of a
derived class to be used in functions of a base class. The
type-checker properly casts pointer values and is safe to use with
multiple inheritance.
</p>
<p> SWIG does not support private or protected inheritance (it is
parsed, but it has no effect on the generated code). Note: private
and protected inheritance do not define an "isa" relationship between
classes so it would have no effect on type-checking anyways.
<p> SWIG treats private or protected inheritance as close to the C++
spirit, and target language capabilities, as possible. In most of the
cases, this means that swig will parse the non-public inheritance
declarations, but that will have no effect in the generated code,
besides the implicit policies derived for constructor and
destructors.
</p>
<p>
The following example shows how SWIG handles inheritance. For clarity,
the full C++ code has been omitted.</p>