You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Tell Python to take ownership of factory's result
430
430
def("factory", factory,
@@ -462,7 +462,7 @@ functions so that a Python override may be called:
462
462
};
463
463
464
464
Notice too that in addition to inheriting from `Base`, we also multiply-
465
-
inherited `wrapper<Base>` (See [@../../../v2/wrapper.html Wrapper]). The
465
+
inherited `wrapper<Base>` (See [@../reference/high_level_components/boost_python_wrapper_hpp.html#high_level_components.boost_python_wrapper_hpp.class_template_wrapper Wrapper]). The
466
466
`wrapper` template makes the job of wrapping classes that are meant to
[section Virtual Functions with Default Implementations]
495
495
496
496
We've seen in the previous section how classes with pure virtual functions are
497
-
wrapped using Boost.Python's [@../../../v2/wrapper.html class wrapper]
497
+
wrapped using Boost.Python's [@../reference/high_level_components/boost_python_wrapper_hpp.html#high_level_components.boost_python_wrapper_hpp.class_template_wrapper class wrapper]
498
498
facilities. If we wish to wrap [*non]-pure-virtual functions instead, the
499
499
mechanism is a bit different.
500
500
501
-
Recall that in the [link python.class_virtual_functions previous section], we
501
+
Recall that in the [link tutorial.exposing.class_virtual_functions previous section], we
502
502
wrapped a class with a pure virtual function that we then implemented in C++, or
503
503
Python classes derived from it. Our base class:
504
504
@@ -811,7 +811,7 @@ or more policies can be composed by chaining. Here's the general syntax:
811
811
policy3<args...> > >
812
812
813
813
Here is the list of predefined call policies. A complete reference detailing
814
-
these can be found [@../../../v2/reference.html#models_of_call_policies here].
814
+
these can be found [@../reference/function_invocation_and_creation/models_of_callpolicies.html here].
815
815
816
816
* [*with_custodian_and_ward]: Ties lifetimes of the arguments
817
817
* [*with_custodian_and_ward_postcall]: Ties lifetimes of the arguments and results
@@ -896,7 +896,7 @@ to retrieve the default arguments:
896
896
def("f", f); // defaults lost!
897
897
898
898
Because of this, when wrapping C++ code, we had to resort to manual
899
-
wrapping as outlined in the [link python.overloading previous section], or
899
+
wrapping as outlined in the [link tutorial.functions.overloading previous section], or
900
900
writing thin wrappers:
901
901
902
902
// write "thin wrappers"
@@ -969,7 +969,7 @@ fourth macro argument). The thin wrappers are all enclosed in a class named
See the [@../../../v2/overloads.html#BOOST_PYTHON_FUNCTION_OVERLOADS-spec overloads reference]
972
+
See the [@../reference/function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.macros overloads reference]
973
973
for details.
974
974
975
975
[h2 init and optional]
@@ -1036,12 +1036,12 @@ Notice though that we have a situation now where we have a minimum of zero
1036
1036
It is important to emphasize however that [*the overloaded functions must
1037
1037
have a common sequence of initial arguments]. Otherwise, our scheme above
1038
1038
will not work. If this is not the case, we have to wrap our functions
1039
-
[link python.overloading manually].
1039
+
[link tutorial.functions.overloading manually].
1040
1040
1041
1041
Actually, we can mix and match manual wrapping of overloaded functions and
1042
1042
automatic wrapping through [^BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS] and
1043
1043
its sister, [^BOOST_PYTHON_FUNCTION_OVERLOADS]. Following up on our example
1044
-
presented in the section [link python.overloading on overloading], since the
1044
+
presented in the section [link tutorial.functions.overloading on overloading], since the
1045
1045
first 4 overload functins have a common sequence of initial arguments, we
1046
1046
can use [^BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS] to automatically wrap the
1047
1047
first three of the [^def]s and manually wrap just the last. Here's
@@ -1266,7 +1266,7 @@ associated with the C++ type passed as its first parameter.
1266
1266
The scope is a class that has an associated global Python object which
1267
1267
controls the Python namespace in which new extension classes and wrapped
1268
1268
functions will be defined as attributes. Details can be found
@@ -1402,8 +1402,8 @@ There is a difference however. While the reference-counting is fully
1402
1402
automatic in Python, the Python C API requires you to do it
1403
1403
[@http://www.python.org/doc/current/c-api/refcounting.html by hand]. This is
1404
1404
messy and especially hard to get right in the presence of C++ exceptions.
1405
-
Fortunately Boost.Python provides the [@../../../v2/handle.html handle] and
1406
-
[@../../../v2/object.html object] class templates to automate the process.
1405
+
Fortunately Boost.Python provides the [@../reference/utility_and_infrastructure/boost_python_handle_hpp.html#utility_and_infrastructure.boost_python_handle_hpp.class_template_handle handle] and
1406
+
[@../reference/object_wrappers/boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object object] class templates to automate the process.
1407
1407
1408
1408
[h2 Running Python code]
1409
1409
@@ -1446,7 +1446,7 @@ containing a phrase that is well-known in programming circles.
1446
1446
1447
1447
Often we'd like to have a class to manipulate Python objects.
1448
1448
But we have already seen such a class above, and in the
1449
-
[@python/object.html previous section]: the aptly named [^object] class
1449
+
[link tutorial.object previous section]: the aptly named [^object] class
1450
1450
and its derivatives. We've already seen that they can be constructed from
1451
1451
a [^handle]. The following examples should further illustrate this fact:
1452
1452
@@ -1466,7 +1466,7 @@ which returns the result directly:
1466
1466
[h2 Exception handling]
1467
1467
1468
1468
If an exception occurs in the evaluation of the python expression,
1469
-
[@../../../v2/errors.html#error_already_set-spec error_already_set] is thrown:
1469
+
[@../reference/high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set error_already_set] is thrown:
1470
1470
1471
1471
try
1472
1472
{
@@ -1847,7 +1847,7 @@ we have a class [^point] in C++:
1847
1847
}
1848
1848
1849
1849
If we are using the technique from the previous session,
1850
-
[link python.creating_packages Creating Packages], we can code directly
1850
+
[link tutorial.techniques.creating_packages Creating Packages], we can code directly
1851
1851
into [^geom/\_\_init\_\_.py]:
1852
1852
1853
1853
[python]
@@ -1970,13 +1970,9 @@ This method is recommended too if you are developing the C++ library and
1970
1970
exporting it to Python at the same time: changes in a class will only demand
1971
1971
the compilation of a single cpp, instead of the entire wrapper code.
1972
1972
1973
-
[note If you're exporting your classes with [@../../../../pyste/index.html Pyste],
1974
-
take a look at the [^--multiple] option, that generates the wrappers in
1975
-
various files as demonstrated here.]
1976
-
1977
1973
[note This method is useful too if you are getting the error message
1978
1974
['"fatal error C1204:Compiler limit:internal structure overflow"] when compiling
1979
-
a large source file, as explained in the [@../../../v2/faq.html#c1204 FAQ].]
1975
+
a large source file, as explained in the [@../faq/fatal_error_c1204_compiler_limit.html FAQ].]
0 commit comments