indexing description: "[ Test for Eiffel-GigaSpaces wrapper loosely based on POCO benchmark example ]" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date$" revision: "$Revision$" class BENCHMARK_BASE_OBJECT inherit EGS_ENTRY create make, make_from_external, make_from_entry feature -- Initialisation make is do make_from_external (cpp_create) end make_from_entry (entry: EGS_ENTRY) is local ptr: POINTER exception: EXCEPTIONS do ptr := cpp_cast_pointer (entry.object_ptr) if ptr /= default_pointer then make_from_external (ptr) entry.set_object_ptr (default_pointer) else create exception exception.raise ("Invalid cast Exception") end end feature id: INTEGER is do Result := cpp_get_id (object_ptr) end uid: STRING is do Result := internal_uid.string end set_id (an_id: INTEGER) is do cpp_set_id (object_ptr, an_id) end set_uid (an_uid: STRING) is do create internal_uid.make (an_uid) cpp_set_uid (object_ptr, internal_uid.item) end feature {NONE} -- Internal storage internal_uid: C_STRING -- Storage for `uid'. feature {NONE} -- Externals cpp_create: POINTER is external "C++ inline use %"benchmarkSerializer.h%"" alias "new benchmarkBase()" end cpp_set_id (obj_ptr: POINTER; an_id: INTEGER) is external "C++ inline use %"benchmarkSerializer.h%"" alias "((benchmarkBase*)$obj_ptr)->id = $an_id" end cpp_set_uid (obj_ptr: POINTER; a_content: POINTER) is external "C++ inline use %"benchmarkSerializer.h%"" alias "((benchmarkBase*)$obj_ptr)->uid = (const char*)$a_content" end cpp_get_id (obj_ptr: POINTER): INTEGER is external "C++ inline use %"benchmarkSerializer.h%"" alias "((benchmarkBase*)$obj_ptr)->id" end cpp_get_uid (obj_ptr: POINTER): POINTER is external "C++ inline use %"benchmarkSerializer.h%"" alias "((benchmarkBase*)$obj_ptr)->uid.c_str()" end cpp_cast_pointer (obj_ptr: POINTER): POINTER is external "C++ inline use %"benchmarkSerializer.h%"" alias "(dynamic_cast((OpenSpaces::IEntry*)$obj_ptr))" end indexing copyright: "Copyright (c) 2008, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end