PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/glib/partially-implemented/g_reference_array_iterator.e

http://github.com/tybor/Liberty
Specman e | 75 lines | 59 code | 14 blank | 2 comment | 5 complexity | 4676fe3dffdffa74d4b55f6334e5f6cd MD5 | raw file
 1indexing
 2	description: "."
 3	copyright: "[
 4					Copyright (C) 2007 $EWLC_developer, $original_copyright_holder
 5					
 6					This library is free software; you can redistribute it and/or
 7					modify it under the terms of the GNU Lesser General Public License
 8					as published by the Free Software Foundation; either version 2.1 of
 9					the License, or (at your option) any later version.
10					
11					This library is distributed in the hopeOA that it will be useful, but
12					WITHOUT ANY WARRANTY; without even the implied warranty of
13					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14					Lesser General Public License for more details.
15
16					You should have received a copy of the GNU Lesser General Public
17					License along with this library; if not, write to the Free Software
18					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19					02110-1301 USA
20			]"
21
22class G_REFERENCE_ARRAY_ITERATOR [ITEM->C_STRUCT]
23
24inherit
25	ITERATOR[ITEM]
26	WRAPPER_HANDLER
27
28insert
29	WRAPPER_FACTORY [ITEM]
30	SHARED_WRAPPERS_DICTIONARY
31	G_PTR_ARRAY_EXTERNALS
32
33creation make 
34
35feature {} -- Creation
36	make (an_array: G_REFERENCE_ARRAY [ITEM]) is
37		require array_not_void: an_array/=Void
38		do
39			array:=an_array
40		end
41	
42feature {ANY}
43	start is
44		do
45			i:=array.lower
46		end
47
48	is_off: BOOLEAN is
49			-- Returns True when there are no more objects in the
50			-- sequence.
51		do
52			Result := i>upper
53		end
54
55	item: ITEM is
56		local p: POINTER; npa: NATIVE_ARRAY[POINTER]
57		do
58			npa := npa.from_pointer(get_pdata(handle))
59			p := npa.item(index)
60			if p.is_not_null then
61				if wrappers.has(p) then Result::=wrappers.item(p)
62				else print_wrapper_factory_notice
63				end
64			end
65		end
66
67	next is
68		do
69			i:=i+1
70		end
71feature {} -- Implementation
72	array: G_REFERENCE_ARRAY [ITEM]
73	
74end --class G_REFERENCE_ARRAY_ITERATOR
75