indexing description: "[ Provides an interface to obtain a proxy to a space (EGS_SPACE_PROXY). ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class EGS_SPACE_FINDER inherit EGS_SHARED_EXCEPTION_HANDLER feature attach (a_proxy: EGS_SPACE_PROXY ): EGS_SPACE_PROXY is -- Adds a reference to an existing space proxy and return that proxy. -- @param a_proxy - An existing space proxy -- @return SpaceProxy require was_not_exception: not was_exception a_proxy_not_void: a_proxy /= Void local res: POINTER do res := cpp_attach (exception_handler, a_proxy.object_ptr) if res /= default_pointer then create Result.make_from_external (res) end end find_space_by_string (url: STRING): EGS_SPACE_PROXY is -- Returns a new space proxy using the given space URL. -- @param url - Space URL -- @return new SpaceProxy require was_not_exception: not was_exception url_not_void: url /= Void local res: POINTER c_str: C_STRING do create c_str.make (url) res := cpp_find_space_by_string (exception_handler, c_str.item) if res /= default_pointer then create Result.make_from_external (res) end end feature {NONE} -- Externals cpp_find_space_by_string (eh: EGS_EXCEPTION_HANDLER; string: POINTER): POINTER is require eh_not_void: eh /= Void string_not_null: string /= default_pointer external "C++ inline use " alias "[ OpenSpaces::SpaceFinder f; try { return new OpenSpaces::SpaceProxyPtr(f.find ((const char*)$string)); } catch(OpenSpaces::XAPException& e) { EGS_HANDLE_XAP_EXCEPTION($eh, e); return 0; } ]" end cpp_attach (eh: EGS_EXCEPTION_HANDLER; a_proxy: POINTER): POINTER is require eh_not_void: eh /= Void a_proxy_not_null: a_proxy /= default_pointer external "C++ inline use " alias "[ OpenSpaces::SpaceFinder f; try { return new OpenSpaces::SpaceProxyPtr(f.attach (*((OpenSpaces::SpaceProxyPtr*)$a_proxy))); } catch(OpenSpaces::XAPException& e) { EGS_HANDLE_XAP_EXCEPTION($eh, e); return 0; } ]" end indexing library: "egigs-cpp: Library for accessing the GigaSpaces platform, POCO library based implementation." 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