line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Eidolon::Driver::Router; |
2
|
|
|
|
|
|
|
# ============================================================================== |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Eidolon |
5
|
|
|
|
|
|
|
# Copyright (c) 2009, Atma 7 |
6
|
|
|
|
|
|
|
# --- |
7
|
|
|
|
|
|
|
# Eidolon/Driver/Router.pm - router generic driver |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# ============================================================================== |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
1365
|
use base qw/Eidolon::Driver/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1019
|
|
12
|
2
|
|
|
2
|
|
1032
|
use Eidolon::Driver::Router::Exceptions; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
13
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
42
|
|
14
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
321
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = "0.02"; # 2009-05-14 05:25:08 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
19
|
|
|
|
|
|
|
# \% new() |
20
|
|
|
|
|
|
|
# constructor |
21
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
22
|
|
|
|
|
|
|
sub new |
23
|
|
|
|
|
|
|
{ |
24
|
1
|
|
|
1
|
1
|
1
|
my ($class, $self); |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
3
|
$class = shift; |
27
|
1
|
|
|
|
|
2
|
$self = |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
"controller" => undef, # relative path to controller |
30
|
|
|
|
|
|
|
"handler" => undef, # handler reference |
31
|
|
|
|
|
|
|
"params" => undef # handler params |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
3
|
bless $self, $class; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
6
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
40
|
|
|
|
|
|
|
# find_handler() |
41
|
|
|
|
|
|
|
# find a query handler |
42
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
43
|
|
|
|
|
|
|
sub find_handler |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
0
|
1
|
|
throw CoreError::AbstractMethod; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
49
|
|
|
|
|
|
|
# get_handler() |
50
|
|
|
|
|
|
|
# get handler reference |
51
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
52
|
|
|
|
|
|
|
sub get_handler |
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
0
|
1
|
|
return $_[0]->{"handler"}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
58
|
|
|
|
|
|
|
# get_params() |
59
|
|
|
|
|
|
|
# get handler params |
60
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
61
|
|
|
|
|
|
|
sub get_params |
62
|
|
|
|
|
|
|
{ |
63
|
0
|
|
|
0
|
1
|
|
return $_[0]->{"params"}; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |