PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/src/wrappers/xml/library/xml2_node_cache.e

http://github.com/tybor/Liberty
Specman e | 26 lines | 21 code | 3 blank | 2 comment | 1 complexity | eb6f01fe018e72fb468d8eac23648608 MD5 | raw file
 1class XML2_NODE_CACHE
 2	-- A singleton wrapper factory and cache for XML2_NODEs.
 3
 4inherit 
 5	CACHING_FACTORY[XML2_NODE]
 6		redefine default_create end
 7	SINGLETON
 8		redefine default_create end
 9
10feature {ANY} 	
11	default_create
12		do
13			create wrappers.make
14		end
15	
16	wrapper (a_pointer: POINTER): XML2_NODE
17		-- XML2_NODE wrapper for `a_pointer'
18	do
19		Result:=wrappers.reference_at(a_pointer)
20		if Result=Void then
21			create Result.from_external_pointer(a_pointer)
22			wrappers.put(Result,a_pointer)
23			Result.set_shared
24		end
25	end
26end -- class XML2_NODE_CACHE