annotate lib/swig/swigwin-2.0.11/Lib/std/std_queue.i @ 2562:b8a56afc6ba1

new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
author Ritor1
date Sun, 17 May 2015 22:42:13 +0600
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 /**
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 * @file std_queue.i
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 * @date Sun May 6 01:48:07 2007
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 * @brief A wrapping of std::queue for Ruby.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 %include <std_container.i>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 // Queue
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 %define %std_queue_methods(queue...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 queue();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 queue( const _Sequence& );
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 bool empty() const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 size_type size() const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 const value_type& front() const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 const value_type& back() const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 void pop();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 void push( const value_type& );
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 %define %std_queue_methods_val(queue...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 %std_queue_methods(queue)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 // ------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 // std::queue
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 // const declarations are used to guess the intent of the function being
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 // exported; therefore, the following rationale is applied:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 // -- f(std::queue<T>), f(const std::queue<T>&):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 // the parameter being read-only, either a sequence or a
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 // previously wrapped std::queue<T> can be passed.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 // -- f(std::queue<T>&), f(std::queue<T>*):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 // the parameter may be modified; therefore, only a wrapped std::queue
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 // can be passed.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 // -- std::queue<T> f(), const std::queue<T>& f():
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 // the queue is returned by copy; therefore, a sequence of T:s
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 // is returned which is most easily used in other functions
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 // -- std::queue<T>& f(), std::queue<T>* f():
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 // the queue is returned by reference; therefore, a wrapped std::queue
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 // is returned
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 // -- const std::queue<T>* f(), f(const std::queue<T>*):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 // for consistency, they expect and return a plain queue pointer.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 // ------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 #include <queue>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 // exported classes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 namespace std {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 template<class _Tp, class _Sequence = std::deque<_Tp> >
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 class queue {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 public:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 typedef size_t size_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 typedef _Tp value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 typedef value_type& reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 typedef const value_type& const_reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 typedef _Sequence container_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 %traits_swigtype(_Tp);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 %fragment(SWIG_Traits_frag(std::queue<_Tp, _Sequence >), "header",
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 fragment=SWIG_Traits_frag(_Tp),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 fragment="StdQueueTraits") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 namespace swig {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 template <> struct traits<std::queue<_Tp, _Sequence > > {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 typedef pointer_category category;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 static const char* type_name() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 return "std::queue<" #_Tp "," #_Sequence " >";
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 %typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp, _Sequence >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 #ifdef %swig_queue_methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87 // Add swig/language extra methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 %swig_queue_methods(std::queue<_Tp, _Sequence >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91 %std_queue_methods(queue);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 template<class _Tp, class _Sequence >
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 class queue<_Tp*, _Sequence > {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 public:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97 typedef size_t size_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98 typedef _Tp value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 typedef value_type& reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 typedef const value_type& const_reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 typedef _Sequence container_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103 %traits_swigtype(_Tp);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 %fragment(SWIG_Traits_frag(std::queue<_Tp*, _Sequence >), "header",
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 fragment=SWIG_Traits_frag(_Tp),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107 fragment="StdQueueTraits") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108 namespace swig {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109 template <> struct traits<std::queue<_Tp*, _Sequence > > {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110 typedef value_category category;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111 static const char* type_name() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 return "std::queue<" #_Tp "," #_Sequence " * >";
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118 %typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp*, _Sequence >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
120 #ifdef %swig_queue_methods_val
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
121 // Add swig/language extra methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
122 %swig_queue_methods_val(std::queue<_Tp*, _Sequence >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
123 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
124
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
125 %std_queue_methods_val(std::queue<_Tp*, _Sequence >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
126 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
127
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
128 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
129