/src/wrappers/common/library/wrapper_dictionary.e
Specman e | 56 lines | 39 code | 9 blank | 8 comment | 2 complexity | 03801687fa096d53202108450fd15f24 MD5 | raw file
1note 2 description: 3 "A wrapper that is a dictionary of other wrappers." 4 copyright: 5 "[ 6 Copyright (C) 2007-2017: Paolo Redaelli 7 8 This library is free software; you can redistribute it and/or 9 modify it under the terms of the GNU Lesser General Public License 10 as published by the Free Software Foundation; either version 2.1 of 11 the License, or (at your option) any later version. 12 13 This library is distributed in the hope that it will be useful, but 14 WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 Lesser General Public License for more details. 17 18 You should have received a copy of the GNU Lesser General Public 19 License along with this library; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 02110-1301 USA 22 ]" 23 license: 24 "LGPL v2 or later" 25deferred class WRAPPER_DICTIONARY[VALUE_ -> WRAPPER, KEY_ -> COMPARABLE_WRAPPER] 26 -- A wrapper that is a collection of other wrappers. 27 -- Contains the shared logic used in Glib G_SLIST, G_HASH_TABLE 28 -- and so on. 29 30inherit 31 DICTIONARY[VALUE_, KEY_] 32 WRAPPER 33 undefine fill_tagged_out_memory, out_in_tagged_out_memory 34 end 35 36feature {WRAPPER, WRAPPER_HANDLER} -- Implementation 37 are_items_shared: BOOLEAN 38 -- Are the items contained in Currect DICTIONARY shared? If 39 -- an item is not shared the underlying C structure will be 40 -- freed once the Eiffel object is disposed. 41 42 set_shared_items (a_setting: BOOLEAN) 43 do 44 are_items_shared := a_setting 45 ensure 46 set: are_items_shared = a_setting 47 end 48 49 factory: WRAPPER_FACTORY[VALUE_] 50 -- The wrapper factory takes a pointer and returns a correct 51 -- VALUE_ wrapper. 52 53invariant 54 factory_not_void: factory /= Void 55 56end -- class WRAPPER_DICTIONARY