1Config::Model::HashId(3U)ser Contributed Perl DocumentatiCoonnfig::Model::HashId(3)
2
3
4
6 Config::Model::HashId - Handle hash element for configuration model
7
9 version 1.205
10
12 $model ->create_config_class
13 (
14 ...
15 element
16 => [
17 bounded_hash
18 => { type => 'hash',
19 index_type => 'integer',
20 min_index => 1,
21 max_index => 123,
22 max_nb => 2 ,
23 cargo_type => 'leaf',
24 cargo_args => {value_type => 'string'},
25 },
26 ]
27 ) ;
28
30 This class provides hash elements for a Config::Model::Node.
31
32 The hash index can either be en enumerated type, a boolean, an integer
33 or a string.
34
36 HashId object should not be created directly.
37
39 See model declaration section from Config::Model::AnyId.
40
42 get_type
43 Returns "hash".
44
45 fetch_size
46 Returns the nb of elements of the hash.
47
48 firstkey
49 Returns the first key of the hash. Behaves like "each" core perl
50 function.
51
52 nextkey
53 Returns the next key of the hash. Behaves like "each" core perl
54 function.
55
56 swap ( key1 , key2 )
57 Swap the order of the 2 keys. Ignored for non ordered hash.
58
59 move ( key1 , key2 )
60 Rename key1 in key2.
61
62 move_after ( key_to_move [ , after_this_key ] )
63 Move the first key after the second one. If the second parameter is
64 omitted, the first key is placed in first position. Ignored for non
65 ordered hash.
66
67 move_up ( key )
68 Move the key up in a ordered hash. Attempt to move up the first key of
69 an ordered hash will be ignored. Ignored for non ordered hash.
70
71 move_down ( key )
72 Move the key down in a ordered hash. Attempt to move up the last key of
73 an ordered hash will be ignored. Ignored for non ordered hash.
74
75 load_data ( hash_ref | array_ref)
76 Load check_list as a hash ref for standard hash.
77
78 Ordered hash should be loaded with an array ref or with a hash
79 containing a special "__order" element. E.g. loaded with either:
80
81 [ a => 'foo', b => 'bar' ]
82
83 or
84
85 { __order => ['a','b'], b => 'bar', a => 'foo' }
86
88 Dominique Dumont, (ddumont at cpan dot org)
89
91 Config::Model, Config::Model::Instance, Config::Model::AnyId,
92 Config::Model::ListId, Config::Model::Value
93
94
95
96perl v5.12.1 2010-08-18 Config::Model::HashId(3)