Crazy Eddie's GUI System  ${CEGUI_VERSION}
methods.hpp
1 // This file has been generated by Py++.
2 
3 // Copyright (c) 2004 Raoul M. Gough
4 //
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
7 // at http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // Header file methods.hpp
10 //
11 // Methods (and sets of methods) that containers can provide.
12 //
13 // History
14 // =======
15 // 2004/ 1/11 rmg File creation
16 // 2008/12/08 Roman Change indexing suite layout
17 //
18 // $Id: methods.hpp,v 1.1.2.1 2004/02/08 18:57:42 raoulgough Exp $
19 //
20 
21 #ifndef BOOST_PYTHON_INDEXING_METHODS_HPP
22 #define BOOST_PYTHON_INDEXING_METHODS_HPP
23 
24 #include <boost/config.hpp>
25 #include <boost/mpl/if.hpp>
26 
27 namespace boost { namespace python { namespace indexing {
28 
29  typedef unsigned long method_set_type;
30 
31  enum methods_enum {
32  method_len = 1UL << 0,
33  method_iter = 1UL << 1,
34  method_getitem = 1UL << 2,
35  method_getitem_slice = 1UL << 3,
36  method_index = 1UL << 4,
37  method_contains = 1UL << 5,
38  method_count = 1UL << 6,
39  method_has_key = 1UL << 7,
40  method_setitem = 1UL << 8,
41  method_setitem_slice = 1UL << 9,
42  method_delitem = 1UL << 10,
43  method_delitem_slice = 1UL << 11,
44  method_reverse = 1UL << 12,
45  method_append = 1UL << 13,
46  method_insert = 1UL << 14,
47  method_extend = 1UL << 15,
48  method_sort = 1UL << 16
49  };
50 
51  // Some sets of methods that could be useful for disabling expensive
52  // features. e.g. something & ~(slice_methods | search_methods)
53 
54  enum {
55  slice_methods
56  = method_getitem_slice | method_setitem_slice | method_delitem_slice
57  };
58 
59  enum {
60  search_methods
61  = method_index | method_contains | method_count | method_has_key
62  };
63 
64  enum {
65  reorder_methods
66  = method_sort | method_reverse
67  };
68 
69  enum {
70  insert_methods
71  = method_append | method_insert | method_extend
72  };
73 
74  enum {
75  all_methods = ~0UL
76  };
77 
78  namespace detail {
79  // Compile-time constant selection:
80  //
81  // method_set_if<c, t, f>::value == (c ? t : f)
82  //
83  // where c is convertible to bool, and t and f are convertible to
84  // method_set_type. This gives a compile-time constant reliably on
85  // all supported compilers.
86 
87  template<
88  bool Cond, method_set_type TrueValue, method_set_type FalseValue = 0>
89 
90  struct method_set_if {
91  struct true_type {
92  BOOST_STATIC_CONSTANT(method_set_type, value = TrueValue);
93  };
94 
95  struct false_type {
96  BOOST_STATIC_CONSTANT(method_set_type, value = FalseValue);
97  };
98 
99  typedef typename mpl::if_c<Cond, true_type, false_type>::type
100  result_type;
101 
102  BOOST_STATIC_CONSTANT(method_set_type, value = result_type::value);
103  };
104 
105  // Compile-time set membership test:
106  // is_member<set, mem>::value == (bool) set & mem
107  template<method_set_type Set, method_set_type Member>
108  struct is_member {
109  // Use a cast to prevent MSVC truncation warning C4305
110  BOOST_STATIC_CONSTANT (bool, value = (bool) (Set & Member));
111  };
112  }
113 
114 } } } // boost::python::indexing
115 
116 #endif // BOOST_PYTHON_INDEXING_METHODS_HPP
117 
118 
119 
Definition: python_CEGUI.h:9