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 SERIALIZER_HELPER feature create_vector_from_real_32_array (array: ARRAY[REAL_32]): POINTER is require array_not_void: array /= Void local i: INTEGER do Result := cpp_create_real_32_vector from i := array.lower until i > array.upper loop cpp_add_to_real_32_vector (Result, array.item (i)) i := i + 1 end end create_vector_from_real_64_array (array: ARRAY[REAL_64]): POINTER is require array_not_void: array /= Void local i: INTEGER do Result := cpp_create_real_64_vector from i := array.lower until i > array.upper loop cpp_add_to_real_64_vector (Result, array.item (i)) i := i + 1 end end create_vector_from_string_array (array: ARRAY[STRING]): POINTER is require array_not_void: array /= Void local i: INTEGER c_str: ANY do Result := cpp_create_string_vector from i := array.lower until i > array.upper loop c_str := array.item (i).to_c cpp_add_to_string_vector (Result, $c_str) i := i + 1 end end delete_real_32_vector (obj_ptr: POINTER) is require obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use " alias "delete ((std::vector*)$obj_ptr)" end delete_real_64_vector (obj_ptr: POINTER) is require obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use " alias "delete ((std::vector*)$obj_ptr)" end delete_string_vector (obj_ptr: POINTER) is require obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use , " alias "delete ((std::vector*)$obj_ptr)" end feature {NONE} -- Externals cpp_create_real_32_vector: POINTER is external "C++ inline use " alias "new std::vector" end cpp_add_to_real_32_vector (obj_ptr: POINTER; entry: REAL_32) is require obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use " alias "((std::vector*)$obj_ptr)->push_back($entry)" end cpp_create_real_64_vector: POINTER is external "C++ inline use " alias "new std::vector" end cpp_add_to_real_64_vector (obj_ptr: POINTER; entry: REAL_64) is require obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use " alias "((std::vector*)$obj_ptr)->push_back($entry)" end cpp_create_string_vector: POINTER is external "C++ inline use , " alias "new std::vector" end cpp_add_to_string_vector (obj_ptr: POINTER; entry: POINTER) is require obj_ptr_not_null: obj_ptr /= default_pointer entry_not_null: entry /= default_pointer external "C++ inline use , " alias "((std::vector*)$obj_ptr)->push_back((char*)$entry)" end feature 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