@@ -74,6 +74,32 @@ <h2>Contents</h2> |
74 | 74 | </dl> |
75 | 75 | </dd> |
76 | 76 |
|
| 77 | + <dt><a href="#const_objattribute_policies-spec">Class |
| 78 | + <code>const_objattribute_policies</code></a></dt> |
| 79 | + |
| 80 | + <dd> |
| 81 | + <dl class="page-index"> |
| 82 | + <dt><a href="#const_objattribute_policies-spec-synopsis">Class |
| 83 | + <code>const_objattribute_policies</code> synopsis</a></dt> |
| 84 | + |
| 85 | + <dt><a href="#const_objattribute_policies-spec-statics">Class |
| 86 | + <code>const_objattribute_policies</code> static functions</a></dt> |
| 87 | + </dl> |
| 88 | + </dd> |
| 89 | + |
| 90 | + <dt><a href="#objattribute_policies-spec">Class |
| 91 | + <code>objattribute_policies</code></a></dt> |
| 92 | + |
| 93 | + <dd> |
| 94 | + <dl class="page-index"> |
| 95 | + <dt><a href="#objattribute_policies-spec-synopsis">Class |
| 96 | + <code>objattribute_policies</code> synopsis</a></dt> |
| 97 | + |
| 98 | + <dt><a href="#objattribute_policies-spec-statics">Class |
| 99 | + <code>objattribute_policies</code> static functions</a></dt> |
| 100 | + </dl> |
| 101 | + </dd> |
| 102 | + |
77 | 103 | <dt><a href="#const_item_policies-spec">Class |
78 | 104 | <code>const_item_policies</code></a></dt> |
79 | 105 |
|
@@ -328,6 +354,102 @@ <h4><a name="attribute_policies-spec-statics"></a>Class |
328 | 354 | <!-- end --> |
329 | 355 | <!-- begin --> |
330 | 356 |
|
| 357 | + <h3><a name="const_objattribute_policies-spec"></a>Class |
| 358 | + <code>const_objattribute_policies</code></h3> |
| 359 | + |
| 360 | + <p>The policies which are used for proxies representing an attribute |
| 361 | + access to a <code>const object</code> when the attribute name is |
| 362 | + given as a <code>const object</code>.</p> |
| 363 | + |
| 364 | + <h4><a name="const_objattribute_policies-spec-synopsis"></a>Class |
| 365 | + <code>const_objattribute_policies</code> synopsis</h4> |
| 366 | +<pre> |
| 367 | +namespace boost { namespace python { namespace api |
| 368 | +{ |
| 369 | + struct const_objattribute_policies |
| 370 | + { |
| 371 | + typedef object const& key_type; |
| 372 | + static object get(object const& target, object const& key); |
| 373 | + }; |
| 374 | +}}} |
| 375 | +</pre> |
| 376 | + |
| 377 | + <h4><a name="const_objattribute_policies-spec-statics"></a>Class |
| 378 | + <code>const_objattribute_policies</code> static functions</h4> |
| 379 | +<pre> |
| 380 | +static object get(object const& target, object const& key); |
| 381 | +</pre> |
| 382 | + |
| 383 | + <dl class="function-semantics"> |
| 384 | + <dt><b>Requires:</b> <code>key</code> is an <code>object</code> |
| 385 | + holding a string.</dt> |
| 386 | + |
| 387 | + <dt><b>Effects:</b> accesses the attribute of <code>target</code> named |
| 388 | + by <code>key</code>.</dt> |
| 389 | + |
| 390 | + <dt><b>Returns:</b> An <code>object</code> managing the result of the |
| 391 | + attribute access.</dt> |
| 392 | + |
| 393 | + <dt><b>Throws:</b> <code><a href= |
| 394 | + "errors.html#error_already_set-spec">error_already_set</a></code> if a |
| 395 | + Python exception is raised.</dt> |
| 396 | + </dl> |
| 397 | + |
| 398 | + <h3><a name="objattribute_policies-spec"></a>Class |
| 399 | + <code>objattribute_policies</code></h3> |
| 400 | + |
| 401 | + <p>The policies which are used for proxies representing an attribute |
| 402 | + access to a mutable <code>object</code> when the attribute name is |
| 403 | + given as a <code>const object</code>.</p> |
| 404 | + |
| 405 | + <h4><a name="objattribute_policies-spec-synopsis"></a>Class |
| 406 | + <code>objattribute_policies</code> synopsis</h4> |
| 407 | +<pre> |
| 408 | +namespace boost { namespace python { namespace api |
| 409 | +{ |
| 410 | + struct objattribute_policies : const_objattribute_policies |
| 411 | + { |
| 412 | + static object const& set(object const& target, object const& key, object const& value); |
| 413 | + static void del(object const&target, object const& key); |
| 414 | + }; |
| 415 | +}}} |
| 416 | +</pre> |
| 417 | + |
| 418 | + <h4><a name="objattribute_policies-spec-statics"></a>Class |
| 419 | + <code>objattribute_policies</code> static functions</h4> |
| 420 | +<pre> |
| 421 | +static object const& set(object const& target, object const& key, object const& value); |
| 422 | +</pre> |
| 423 | + |
| 424 | + <dl class="function-semantics"> |
| 425 | + <dt><b>Requires:</b> <code>key</code> is an <code>object</code> |
| 426 | + holding a string.</dt> |
| 427 | + |
| 428 | + <dt><b>Effects:</b> sets the attribute of <code>target</code> named by |
| 429 | + <code>key</code> to <code>value</code>.</dt> |
| 430 | + |
| 431 | + <dt><b>Throws:</b> <code><a href= |
| 432 | + "errors.html#error_already_set-spec">error_already_set</a></code> if a |
| 433 | + Python exception is raised.</dt> |
| 434 | + </dl> |
| 435 | +<pre> |
| 436 | +static void del(object const&target, object const& key); |
| 437 | +</pre> |
| 438 | + |
| 439 | + <dl class="function-semantics"> |
| 440 | + <dt><b>Requires:</b> <code>key</code> is an <code>object</code> |
| 441 | + holding a string.</dt> |
| 442 | + |
| 443 | + <dt><b>Effects:</b> deletes the attribute of <code>target</code> named |
| 444 | + by <code>key</code>.</dt> |
| 445 | + |
| 446 | + <dt><b>Throws:</b> <code><a href= |
| 447 | + "errors.html#error_already_set-spec">error_already_set</a></code> if a |
| 448 | + Python exception is raised.</dt> |
| 449 | + </dl> |
| 450 | + <!-- end --> |
| 451 | + <!-- begin --> |
| 452 | + |
331 | 453 | <h3><a name="const_item_policies-spec"></a>Class |
332 | 454 | <code>const_item_policies</code></h3> |
333 | 455 |
|
@@ -542,6 +664,8 @@ <h4><a name="object_operators-spec-synopsis"></a>Class template |
542 | 664 | // |
543 | 665 | proxy<const_object_attribute> attr(char const*) const; |
544 | 666 | proxy<object_attribute> attr(char const*); |
| 667 | + proxy<const_object_objattribute> attr(object const&) const; |
| 668 | + proxy<object_objattribute> attr(object const&); |
545 | 669 |
|
546 | 670 | // item access |
547 | 671 | // |
@@ -608,6 +732,21 @@ <h4><a name="object_operators-spec-observers"></a>Class template |
608 | 732 | <code>name</code> as its key.</dt> |
609 | 733 | </dl> |
610 | 734 | <pre> |
| 735 | +proxy<const_object_objattribute> attr(const object& name) const; |
| 736 | +proxy<object_objattribute> attr(const object& name); |
| 737 | +</pre> |
| 738 | + |
| 739 | + <dl class="function-semantics"> |
| 740 | + <dt><b>Requires:</b> name is a <code>object</code> holding a string.</dt> |
| 741 | + |
| 742 | + <dt><b>Effects:</b> accesses the named attribute of |
| 743 | + <code>*this</code>.</dt> |
| 744 | + |
| 745 | + <dt><b>Returns:</b> a proxy object which binds |
| 746 | + <code>object(*static_cast<U*>(this))</code> as its target, and |
| 747 | + <code>name</code> as its key.</dt> |
| 748 | + </dl> |
| 749 | +<pre> |
611 | 750 | template <class T> |
612 | 751 | proxy<const_object_item> operator[](T const& key) const; |
613 | 752 | template <class T> |
@@ -938,11 +1077,11 @@ <h2><a name="examples"></a>Example</h2> |
938 | 1077 | </pre> |
939 | 1078 | <p>Revised |
940 | 1079 | <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> |
941 | | - 13 January, 2006 |
| 1080 | + 27 May, 2008 |
942 | 1081 | <!--webbot bot="Timestamp" endspan i-checksum="39359" --> |
943 | 1082 | </p> |
944 | 1083 |
|
945 | 1084 | <p><i>© Copyright <a href= |
946 | | - "http://www.boost.org/people/dave_abrahams.htm">Dave Abrahams</a> 2006.</i></p> |
| 1085 | + "http://www.boost.org/people/dave_abrahams.htm">Dave Abrahams</a> 2008.</i></p> |
947 | 1086 | </body> |
948 | 1087 | </html> |