diff --git a/SWIG/Doc/Manual/SWIGPlus.html b/SWIG/Doc/Manual/SWIGPlus.html index 6bfb609f9..0f9c3fbeb 100644 --- a/SWIG/Doc/Manual/SWIGPlus.html +++ b/SWIG/Doc/Manual/SWIGPlus.html @@ -124,9 +124,8 @@ type checking, error handling, and other low-level details of the C++ binding. These wrappers are also sufficient to bind C++ into any target language that supports built-in procedures. In some sense, you might view this layer of wrapping as providing a C library interface to C++. -Optionally, SWIG can also generate proxy classes -that provide a natural OO interface to the underlying code. These proxies -are built on top of the low-level procedural wrappers and are typically +On top of the low-level procedural (flattened) interface, SWIG generates proxy classes +that provide a natural object-oriented (OO) interface to the underlying code. The proxy classes are typically written in the target language itself. For instance, in Python, a real Python class is used to provide a wrapper around the underlying C++ object.

@@ -134,8 +133,8 @@ Python class is used to provide a wrapper around the underlying C++ object.

It is important to emphasize that SWIG takes a deliberately conservative and non-intrusive approach to C++ wrapping. SWIG does not -encapsulate C++ classes inside special C++ adaptor or proxy classes, -it does not rely upon templates, nor does it use C++ inheritance when +encapsulate C++ classes inside a special C++ adaptor, it does not rely +upon templates, nor does it add in additional C++ inheritance when generating wrappers. The last thing that most C++ programs need is even more compiler magic. Therefore, SWIG tries to maintain a very strict and clean separation between the implementation of your C++ @@ -148,11 +147,10 @@ with C++, it is safe, simple, portable, and debuggable.

-Most of this chapter focuses on the low-level procedural interface to +Some of this chapter focuses on the low-level procedural interface to C++ that is used as the foundation for all language modules. Keep in -mind that most target languages also provide a high-level OO interface via -proxy classes. A few general details about proxies can be found at the end of -this chapter. However, more detailed coverage can be found in the documentation +mind that the target languages also provide the high-level OO interface via +proxy classes. More detailed coverage can be found in the documentation for each target language.

@@ -221,11 +219,271 @@ $ c++ example_wrap.o $(OBJS) -o example.so

-Unfortunately, the process varies slightly on each machine. Make sure +Unfortunately, the process varies slightly on each platform. Make sure you refer to the documentation on each target language for further details. The SWIG Wiki also has further details.

+Compatibility Note: Early versions of SWIG generated just a flattened low-level C style API to C++ classes by default. +The -noproxy commandline option is recognised by many target languages and will generate just this +interface as in earlier versions. + +

6.27 Proxy classes

+ + +

+In order to provide a natural mapping from C++ classes to the target language classes, SWIG's target +languages mostly wrap C++ classes with special proxy classes. These +proxy classes are typically implemented in the target language itself. +For example, if you're building a Python module, each C++ class is +wrapped by a Python proxy class. Or if you're building a Java module, each +C++ class is wrapped by a Java proxy class. +

+ +

6.27.1 Construction of proxy classes

+ + +

+Proxy classes are always constructed as an extra layer of wrapping that uses low-level +accessor functions. To illustrate, suppose you had a +C++ class like this: +

+ +
+
+class Foo {
+public:
+      Foo();
+     ~Foo();
+      int  bar(int x);
+      int  x;
+};
+
+
+ +

+Using C++ as pseudocode, a proxy class looks something like this: +

+ +
+
+class FooProxy {
+private:
+      Foo    *self;
+public:
+      FooProxy() {
+            self = new_Foo();
+      }
+     ~FooProxy() {
+            delete_Foo(self);
+      }
+      int bar(int x) {
+            return Foo_bar(self,x);
+      }
+      int x_get() {
+            return Foo_x_get(self);
+      }
+      void x_set(int x) {
+            Foo_x_set(self,x);
+      }
+};
+
+
+ +

+Of course, always keep in mind that the real proxy class is written in the target language. +For example, in Python, the proxy might look roughly like this: +

+ +
+
+class Foo:
+    def __init__(self):
+         self.this = new_Foo()
+    def __del__(self):
+         delete_Foo(self.this)
+    def bar(self,x):
+         return Foo_bar(self.this,x)
+    def __getattr__(self,name):
+         if name == 'x':
+              return Foo_x_get(self.this)
+         ...
+    def __setattr__(self,name,value):
+         if name == 'x':
+              Foo_x_set(self.this,value)
+         ...
+
+
+ +

+Again, it's important to emphasize that the low-level accessor functions are always used by the +proxy classes. +Whenever possible, proxies try to take advantage of language features that are similar to C++. This +might include operator overloading, exception handling, and other features. +

+ +

6.27.2 Resource management in proxies

+ + +

+A major issue with proxies concerns the memory management of wrapped objects. Consider the following +C++ code: +

+ +
+
+class Foo {
+public:
+      Foo();
+     ~Foo();
+      int bar(int x);
+      int x;
+};
+
+class Spam {
+public:
+      Foo *value;
+      ...
+};
+
+
+ +

+Consider some script code that uses these classes: +

+ +
+
+f = Foo()               # Creates a new Foo
+s = Spam()              # Creates a new Spam
+s.value = f             # Stores a reference to f inside s
+g = s.value             # Returns stored reference
+g = 4                   # Reassign g to some other value
+del f                   # Destroy f 
+
+
+ +

+Now, ponder the resulting memory management issues. When objects are +created in the script, the objects are wrapped by newly created proxy +classes. That is, there is both a new proxy class instance and a new +instance of the underlying C++ class. In this example, both +f and s are created in this way. However, the +statement s.value is rather curious---when executed, a +pointer to f is stored inside another object. This means +that the scripting proxy class AND another C++ class share a +reference to the same object. To make matters even more interesting, +consider the statement g = s.value. When executed, this +creates a new proxy class g that provides a wrapper around the +C++ object stored in s.value. In general, there is no way to +know where this object came from---it could have been created by the +script, but it could also have been generated internally. In this +particular example, the assignment of g results in a second +proxy class for f. In other words, a reference to f +is now shared by two proxy classes and a C++ class. +

+ +

+Finally, consider what happens when objects are destroyed. In the +statement, g=4, the variable g is reassigned. In +many languages, this makes the old value of g available for +garbage collection. Therefore, this causes one of the proxy classes +to be destroyed. Later on, the statement del f destroys the +other proxy class. Of course, there is still a reference to the +original object stored inside another C++ object. What happens to it? +Is the object still valid? +

+ +

+To deal with memory management problems, proxy classes provide an API +for controlling ownership. In C++ pseudocode, ownership control might look +roughly like this: +

+ +
+
+class FooProxy {
+public:
+      Foo    *self;
+      int     thisown;
+
+      FooProxy() {
+            self = new_Foo();
+            thisown = 1;       // Newly created object
+      }
+     ~FooProxy() {
+            if (thisown) delete_Foo(self);
+      }
+      ...
+      // Ownership control API
+      void disown() {
+           thisown = 0;
+      }
+      void acquire() {
+           thisown = 1;
+      }
+};
+
+class FooPtrProxy: public FooProxy {
+public:
+      FooPtrProxy(Foo *s) {
+          self = s;
+          thisown = 0;
+      }
+};
+
+class SpamProxy {
+     ...
+     FooProxy *value_get() {
+          return FooPtrProxy(Spam_value_get(self));
+     }
+     void value_set(FooProxy *v) {
+          Spam_value_set(self,v->self);
+          v->disown();
+     }
+     ...
+};
+
+
+ +

+Looking at this code, there are a few central features: +

+ + + +

+Given the tricky nature of C++ memory management, it is impossible for proxy classes to automatically handle +every possible memory management problem. However, proxies do provide a mechanism for manual control that +can be used (if necessary) to address some of the more tricky memory management problems. +

+ +

6.27.3 Language specific details

+ + +

+Language specific details on proxy classes are contained in the chapters describing each target language. This +chapter has merely introduced the topic in a very general way. +

+

6.5 Simple C++ wrapping

@@ -256,8 +514,7 @@ static void print(List *l);

To generate wrappers for this class, SWIG first reduces the class to a collection of low-level C-style -accessor functions. The next few sections describe this process. Later parts of the chapter describe a higher -level interface based on proxy classes. +accessor functions which are then used by the proxy classes.

6.5.1 Constructors and destructors

@@ -282,7 +539,7 @@ void delete_List(List *l) {

Following the C++ rules for implicit constructor and destructors, SWIG -will try to automatically generate them even when they are not +will automatically assume there is one even when they are not explicitly declared in the class interface.

@@ -293,17 +550,17 @@ In general then: @@ -334,16 +591,17 @@ class defines a non-public default constructor or destructor.

SWIG should never generate a default constructor, copy constructor or -default destructor for a class in which it is illegal to do so. In +default destructor wrapper for a class in which it is illegal to do so. In some cases, however, it could be necessary (if the complete class declaration is not visible from SWIG, and one of the above rules is -violated) or desired (to reduce the size of the final interface) to -disable the implicit constructor/desctructor generation manually. +violated) or desired (to reduce the size of the final interface) by +manually disabling the implicit constructor/destructor generation.

-To do so, the %nodefaultctor and %nodefaultdtor -directives can be used. Note that these directives only affects the +To manually disable these, the %nodefaultctor and %nodefaultdtor +feature flag directives +can be used. Note that these directives only affects the implicit generation, and they have no effect if the default/copy constructors or destructor are explicitly declared in the class interface. @@ -356,7 +614,7 @@ For example:

 %nodefaultctor Foo;  // Disable the default constructor for class Foo.
-class Foo {          // No default constructor is generated, unless is declared
+class Foo {          // No default constructor is generated, unless one is declared
 ...
 };
 class Bar {          // A default constructor is generated, if possible
@@ -372,12 +630,12 @@ The directive %nodefaultctor can also be applied "globally", as in:
 
 %nodefaultctor; // Disable creation of default constructors
-class Foo {     // No default constructor is generated, unless is declared
+class Foo {     // No default constructor is generated, unless one is declared
 ...
 };
 class Bar {   
 public:
-  Bar();        // The default constructor is generated, since is declared
+  Bar();        // The default constructor is generated, since one is declared
 };
 %clearnodefaultctor; // Enable the creation of default constructors again
 
@@ -394,7 +652,7 @@ in well known cases. For example:
 %nodefaultdtor Foo;   // Disable the implicit/default destructor for class Foo.
-class Foo {           // No destructor is generated, unless is declared
+class Foo {           // No destructor is generated, unless one is declared
 ...
 };
 
@@ -418,11 +676,10 @@ those sections in the interface or using %nodefault to fix the problem.

-Note: The above described %nodefault -directive/-nodefault option, which disable both the default -constructor and the the implicit destructors, could lead to memory -leaks across the target languages, and is highly recommended you don't -use them. +Note: The %nodefault +directive/-nodefault options described above, which disable both the default +constructor and the implicit destructors, could lead to memory +leaks, and so it is strongly recommended to not use them.

@@ -529,8 +786,8 @@ then the copy constructor can be used as follows:
-x = new_List()               # Create a list
-y = new_List(x)              # Copy list x
+x = List()               # Create a list
+y = List(x)              # Copy list x
 
@@ -561,6 +818,23 @@ Constructors such as X(const X &), X(X &), and Note: SWIG does not generate a copy constructor wrapper unless one is explicitly declared in the class. This differs from the treatment of default constructors and destructors. +However, copy constructor wrappers can be generated if using the copyctor +feature flag. For example: +

+ +
+
+%copyctor List;
+
+class List {
+public:
+    List();    
+};
+
+
+ +

+Will generate a copy constructor wrapper for List.

@@ -611,7 +885,7 @@ It should be noted that SWIG does not actually create a C accessor function in the code it generates. Instead, member access such as obj->search(value) is directly inlined into the generated wrapper functions. However, the name and calling convention of the -wrappers match the accessor function prototype described above. +low-level procedural wrappers match the accessor function prototype described above.

6.5.6 Static members

@@ -624,11 +898,6 @@ transformations. For example, the static member function in the generated wrapper code.

-

-Usually, static members are accessed as functions with names in which the class name has been -prepended with an underscore. For example, List_print. -

-

6.5.7 Member data

@@ -649,8 +918,9 @@ int List_length_set(List *obj, int value) {

-A read-only member can be created using the %immutable and -%mutable directives. For example, we probably wouldn't want +A read-only member can be created using the %immutable and %mutable +feature flag directive. +For example, we probably wouldn't want the user to change the length of a list so we could do the following to make the value available, but read-only.

@@ -700,7 +970,7 @@ public:

-then access to the items member actually uses pointers. For example: +then the low-level accessor to the items member actually uses pointers. For example:

@@ -725,7 +995,7 @@ This can be somewhat unnatural for some types. For example, a user would expect the STL std::string class member variables to be wrapped as a string in the target language, rather than a pointer to this class. The const reference typemaps offer this type of marshalling, so there is a feature to tell SWIG to use the const reference typemaps rather than the pointer typemaps. -It is the %naturalvar feature and is used as follows: +It is the %naturalvar directive and is used as follows:

@@ -745,7 +1015,9 @@ struct Foo {

-The observant reader will notice that %naturalvar works like any other feature, except it can also be attached to class types. +The observant reader will notice that %naturalvar works like any other +feature flag directive, +except it can also be attached to class types. The first of the example usages above show %naturalvar attaching to the List class. Effectively this feature changes the way accessors are generated to the following:

@@ -765,7 +1037,7 @@ void Foo_items_set(Foo *self, const List &value) { In fact it is generally a good idea to use this feature globally as the reference typemaps have extra NULL checking compared to the pointer typemaps. A pointer can be NULL, whereas a reference cannot, so the extra checking ensures that the target language user does not pass in a value that translates to a NULL pointer and thereby preventing any potential NULL pointer dereferences. -The %naturalvar feature will also apply to global variables in some language modules, eg C# and Java. +The %naturalvar feature will apply to global variables in addition to member variables in some language modules, eg C# and Java.

@@ -857,7 +1129,7 @@ The Ambiguity resolution and renaming%rename and %ignore on methods with default arguments. If you are writing your own typemaps for types used in methods with default arguments, you may also need to write a typecheck typemap. See the Typemaps and overloading section for details or otherwise -use the compactdefaultargs feature as mentioned below. +use the compactdefaultargs feature flag as mentioned below.

@@ -865,7 +1137,8 @@ use the compactdefaultargs feature as mentioned below. Instead a single wrapper method was generated and the default values were copied into the C++ wrappers so that the method being wrapped was then called with all the arguments specified. If the size of the wrappers are a concern then this approach to wrapping methods with default arguments -can be re-activated by using the compactdefaultargs feature. +can be re-activated by using the compactdefaultargs +feature flag.

@@ -966,7 +1239,7 @@ Members declared as const are wrapped as read-only members and do not c

-Friend declarations are not longer ignored by SWIG. For example, if +Friend declarations are recognised by SWIG. For example, if you have this code:

@@ -999,7 +1272,7 @@ void blah(Foo *f);

A friend declaration, as in C++, is understood to be in the same scope -where the class is declared, hence, you can do +where the class is declared, hence, you can have

@@ -1038,7 +1311,8 @@ public:

-is accessed using a function similar to this:

+has a low-level accessor +

 double Foo_bar(Foo *obj, double *a) {
@@ -1081,7 +1355,7 @@ public:
 

-Generates code like this: +Generates an accessor like this:

@@ -1221,7 +1495,7 @@ multiple inheritance.

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 +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. @@ -1263,8 +1537,8 @@ public:

-When wrapped into Python, we can now perform the following operations -:

+When wrapped into Python, we can perform the following operations (shown using the low level Python accessors): +

 $ python
@@ -1308,20 +1582,20 @@ the attributes x and y are generated as
 

-Although the low-level C-like interface is functional, most language -modules also produce a higher level OO interface using proxy classes. -This approach is described later and can be used to provide a more natural C++ interface. +Note that there is a one to one correlation between the low-level accessor functions and +the proxy methods and therefore there is also a one to one correlation between +the C++ class methods and the generated proxy class methods.

Note: For the best results, SWIG requires all -base classes to be defined in an interface. Otherwise, you may get an +base classes to be defined in an interface. Otherwise, you may get a warning message like this:

-example:18. Nothing known about class 'Foo'. Ignored.
+example.i:18: Warning(401): Nothing known about base class 'Foo'. Ignored.
 
@@ -1335,7 +1609,8 @@ silence the warning, you might consider using the %import directive to include the file that defines Foo. %import simply gathers type information, but doesn't generate wrappers. Alternatively, you could just define Foo as an empty class -in the SWIG interface. +in the SWIG interface or use +warning suppression.

@@ -1502,66 +1777,19 @@ generated wrappers to correctly cast pointer values under inheritance

-One might be inclined to fix this problem using some variation of -dynamic_cast<>. The only problem is that it doesn't -work with void pointers, it requires RTTI support, and it -only works with polymorphic classes (i.e., classes that define one or -more virtual functions). +Some of the language modules are able to solve the problem by storing multiple instance of the pointer, for example, A *, +in the A proxy class and C * in the C proxy class. The correct cast can then be made:

-

-The bottom line: learn to live with type-tagged pointers. -

- -

6.14 Renaming

- - -

-C++ member functions and data can be renamed with the %name -directive. The %name directive only replaces the member -function name. For example :

- -
-class List {
-public:
-  List();
-%name(ListSize) List(int maxsize);
-  ~List();
-  int  search(char *value); 
-%name(find)    void insert(char *); 
-%name(delete)  void remove(char *); 
-  char *get(int n);
-  int  length;
-static void print(List *l);
-};
-
-
- -

-This will create the functions List_find, -List_delete, and a function named new_ListSize for -the overloaded constructor.

- -

-The %name directive can be applied to all members including -constructors, destructors, static functions, data members, and -enumeration values.

- -

-The class name prefix can also be changed by specifying

- -
-%name(newname) class List {
+
+
+C *c = new C();
+void *p = (void *) c;
 ...
-}
-
- -

-Although the %name() directive can be used to help deal with -overloaded methods, it really doesn't work very well because it -requires a lot of additional markup in your interface. Keep reading -for a better solution. -

+int x = A_function((C *) p); +int y = B_function((C *) p); +
+

6.15 Wrapping Overloaded Functions and Methods

@@ -2295,7 +2523,7 @@ than dynamically typed languages like Perl, Python, Ruby, and Tcl.

-Starting in SWIG-1.3.10, C++ overloaded operator declarations can be wrapped. +C++ overloaded operator declarations can be wrapped. For example, consider a class like this:

@@ -2534,7 +2762,7 @@ chapter for further details.

Compatibility note: The %extend directive is a new -name for the %addmethods directive. Since %addmethods could +name for the %addmethods directive in SWIG1.1. Since %addmethods could be used to extend a structure with more than just methods, a more suitable directive name has been chosen.

@@ -2543,7 +2771,7 @@ directive name has been chosen.

-In all versions of SWIG, template type names may appear anywhere a type +Template type names may appear anywhere a type is expected in an interface file. For example:

@@ -3842,7 +4070,7 @@ just a single catch handler for the base class, EBase will be generated

-Starting with SWIG1.3.7, there is limited parsing support for pointers to C++ class members. +Starting with SWIG-1.3.7, there is limited parsing support for pointers to C++ class members. For example:

@@ -4409,265 +4637,6 @@ using another tool if maintaining constness is the most important part of your project.

-

6.27 Proxy classes

- - -

-In order to provide a more natural API, SWIG's target -languages wrap C++ classes with special proxy classes. These -proxy classes are typically implemented in the target language itself. -For example, if you're building a Python module, each C++ class is -wrapped by a Python class. Or if you're building a Java module, each -C++ class is wrapped by a Java class. -

- -

6.27.1 Construction of proxy classes

- - -

-Proxy classes are always constructed as an extra layer of wrapping that uses the low-level -accessor functions described in the previous section. To illustrate, suppose you had a -C++ class like this: -

- -
-
-class Foo {
-public:
-      Foo();
-     ~Foo();
-      int  bar(int x);
-      int  x;
-};
-
-
- -

-Using C++ as pseudocode, a proxy class looks something like this: -

- -
-
-class FooProxy {
-private:
-      Foo    *self;
-public:
-      FooProxy() {
-            self = new_Foo();
-      }
-     ~FooProxy() {
-            delete_Foo(self);
-      }
-      int bar(int x) {
-            return Foo_bar(self,x);
-      }
-      int x_get() {
-            return Foo_x_get(self);
-      }
-      void x_set(int x) {
-            Foo_x_set(self,x);
-      }
-};
-
-
- -

-Of course, always keep in mind that the real proxy class is written in the target language. -For example, in Python, the proxy might look roughly like this: -

- -
-
-class Foo:
-    def __init__(self):
-         self.this = new_Foo()
-    def __del__(self):
-         delete_Foo(self.this)
-    def bar(self,x):
-         return Foo_bar(self.this,x)
-    def __getattr__(self,name):
-         if name == 'x':
-              return Foo_x_get(self.this)
-         ...
-    def __setattr__(self,name,value):
-         if name == 'x':
-              Foo_x_set(self.this,value)
-         ...
-
-
- -

-Again, it's important to emphasize that the low-level accessor functions are always used to construct the -proxy classes. -

- -

-Whenever possible, proxies try to take advantage of language features that are similar to C++. This -might include operator overloading, exception handling, and other features. -

- -

6.27.2 Resource management in proxies

- - -

-A major issue with proxies concerns the memory management of wrapped objects. Consider the following -C++ code: -

- -
-
-class Foo {
-public:
-      Foo();
-     ~Foo();
-      int bar(int x);
-      int x;
-};
-
-class Spam {
-public:
-      Foo *value;
-      ...
-};
-
-
- -

-Now, consider some script code that uses these classes: -

- -
-
-f = Foo()               # Creates a new Foo
-s = Spam()              # Creates a new Spam
-s.value = f             # Stores a reference to f inside s
-g = s.value             # Returns stored reference
-g = 4                   # Reassign g to some other value
-del f                   # Destroy f 
-
-
- -

-Now, ponder the resulting memory management issues. When objects are -created in the script, the objects are wrapped by newly created proxy -classes. That is, there is both a new proxy class instance and a new -instance of the underlying C++ class. In this example, both -f and s are created in this way. However, the -statement s.value is rather curious---when executed, a -pointer to f is stored inside another object. This means -that the scripting proxy class AND another C++ class share a -reference to the same object. To make matters even more interesting, -consider the statement g = s.value. When executed, this -creates a new proxy class g that provides a wrapper around the -C++ object stored in s.value. In general, there is no way to -know where this object came from---it could have been created by the -script, but it could also have been generated internally. In this -particular example, the assignment of g results in a second -proxy class for f. In other words, a reference to f -is now shared by two proxy classes and a C++ class. -

- -

-Finally, consider what happens when objects are destroyed. In the -statement, g=4, the variable g is reassigned. In -many languages, this makes the old value of g available for -garbage collection. Therefore, this causes one of the proxy classes -to be destroyed. Later on, the statement del f destroys the -other proxy class. Of course, there is still a reference to the -original object stored inside another C++ object. What happens to it? -Is it the object still valid? -

- -

-To deal with memory management problems, proxy classes always provide an API -for controlling ownership. In C++ pseudocode, ownership control might look -roughly like this: -

- -
-
-class FooProxy {
-public:
-      Foo    *self;
-      int     thisown;
-
-      FooProxy() {
-            self = new_Foo();
-            thisown = 1;       // Newly created object
-      }
-     ~FooProxy() {
-            if (thisown) delete_Foo(self);
-      }
-      ...
-      // Ownership control API
-      void disown() {
-           thisown = 0;
-      }
-      void acquire() {
-           thisown = 1;
-      }
-};
-
-class FooPtrProxy: public FooProxy {
-public:
-      FooPtrProxy(Foo *s) {
-          self = s;
-          thisown = 0;
-      }
-};
-
-class SpamProxy {
-     ...
-     FooProxy *value_get() {
-          return FooPtrProxy(Spam_value_get(self));
-     }
-     void value_set(FooProxy *v) {
-          Spam_value_set(self,v->self);
-          v->disown();
-     }
-     ...
-};
-
-
- -

-Looking at this code, there are a few central features: -

- -
    -
  • Each proxy class keeps an extra flag to indicate ownership. C++ objects are only destroyed -if the ownership flag is set. -
  • - -
  • When new objects are created in the target language, the ownership flag is set. -
  • - -
  • When a reference to an internal C++ object is returned, it is wrapped by a proxy -class, but the proxy class does not have ownership. -
  • - -
  • In certain cases, ownership is adjusted. For instance, when a value is assigned to the member of -a class, ownership is lost. -
  • - -
  • Manual ownership control is provided by special disown() and acquire() methods. -
  • -
- -

-Given the tricky nature of C++ memory management, it is impossible for proxy classes to automatically handle -every possible memory management problem. However, proxies do provide a mechanism for manual control that -can be used (if necessary) to address some of the more tricky memory management problems. -

- -

6.27.3 Language specific details

- - -

-Language specific details on proxy classes are contained in the chapters describing each target language. This -chapter has merely introduced the topic in a very general way. -

-

6.28 Where to go for more information