File: WarpedId.pl

package info (click to toggle)
libconfig-model-itself-perl 2.025-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 468 kB
  • sloc: perl: 3,507; makefile: 12
file content (97 lines) | stat: -rw-r--r-- 3,247 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
use strict;
use warnings;

return [
    [
        name    => 'MasterModel::WarpedIdSlave',
        element => [
            [qw/X Y Z/] => {
                type       => 'leaf',
                value_type => 'enum',
                choice     => [qw/Av Bv Cv/],
            }
        ]
    ],

    [
        name      => 'MasterModel::WarpedId',
        'element' => [
            macro => {
                type       => 'leaf',
                value_type => 'enum',
                choice     => [qw/A B C/],
            },
            version => {
                type       => 'leaf',
                value_type => 'integer',
                default    => 1
            },
            warped_hash => {
                type       => 'hash',
                index_type => 'integer',
                max_nb     => 3,
                warp       => {
                    follow => '- macro',
                    rules  => {
                        A => { max_nb => 1 },
                        B => { max_nb => 2 }
                    }
                },
                cargo_type        => 'node',
                config_class_name => 'MasterModel::WarpedIdSlave'
            },
            'multi_warp' => {
                type       => 'hash',
                index_type => 'integer',
                min_index  => 0,
                max_index  => 3,
                default    => [ 0 .. 3 ],
                warp       => {
                    follow  => [ '- version', '- macro' ],
                    'rules' => [
                        [ '2', 'C' ] => { max => 7, default => [ 0 .. 7 ] },
                        [ '2', 'A' ] => { max => 7, default => [ 0 .. 7 ] }
                    ]
                },
                cargo_type        => 'node',
                config_class_name => 'MasterModel::WarpedIdSlave'
            },

            'hash_with_warped_value' => {
                type       => 'hash',
                index_type => 'string',
                cargo_type => 'leaf',
                level      => 'hidden',
                warp => {
                    follow  => '- macro',
                    'rules' => { 'A' => { level => 'normal', }, }
                },
                cargo_args => {
                    value_type => 'string',
                    warp       => {
                        follow  => '- macro',
                        'rules' => { 'A' => { default => 'dumb string' }, }
                    }
                }
            },
            'multi_auto_create' => {
                type        => 'hash',
                index_type  => 'integer',
                min_index   => 0,
                max_index   => 3,
                auto_create => [ 0 .. 3 ],
                'warp'      => {
                    follow  => [ '- version', '- macro' ],
                    'rules' => [
                        [ '2', 'C' ] =>
                          { max => 7, auto_create_keys => [ 0 .. 7 ] },
                        [ '2', 'A' ] =>
                          { max => 7, auto_create_keys => [ 0 .. 7 ] }
                    ],
                },
                cargo_type        => 'node',
                config_class_name => 'MasterModel::WarpedIdSlave'
            }
        ]
    ]
];