line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
XAO::DO::Embeddable - recommended base object for XAO embeddable configs |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package XAO::DO::Foo::Config; |
8
|
|
|
|
|
|
|
use strict; |
9
|
|
|
|
|
|
|
use XAO::Objects; |
10
|
|
|
|
|
|
|
use base XAO::Objects->load(objname => 'Embeddable'); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Provides set_base_config() and base_config() methods to embeddable |
15
|
|
|
|
|
|
|
configs based on it. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 METHODS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=over |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
############################################################################### |
24
|
|
|
|
|
|
|
package XAO::DO::Embeddable; |
25
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
26
|
1
|
|
|
1
|
|
12
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
62
|
|
27
|
1
|
|
|
1
|
|
7
|
use XAO::Objects; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
28
|
1
|
|
|
1
|
|
10
|
use base XAO::Objects->load(objname => 'Atom'); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
13
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our $VERSION=2.1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
############################################################################### |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item set_base_config ($) |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Called automatically with one argument -- reference to the configuration |
37
|
|
|
|
|
|
|
object it is being embedded into. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub set_base_config ($$) { |
42
|
1
|
|
|
1
|
1
|
3
|
my ($self,$base)=@_; |
43
|
1
|
|
|
|
|
7
|
$self->{'_embedding_base_config'}=$base; |
44
|
1
|
|
|
|
|
9
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
############################################################################### |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item base_config ($) |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns previously stored base config reference. Reason to have this |
52
|
|
|
|
|
|
|
method is the following: methods of embedded configs are called in the |
53
|
|
|
|
|
|
|
namespace of their own and common configuration object is not available |
54
|
|
|
|
|
|
|
from them through normal @ISA relations. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub base_config ($) { |
59
|
1
|
|
|
1
|
1
|
7
|
my $self=shift; |
60
|
1
|
|
|
|
|
6
|
return $self->{'_embedding_base_config'}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
############################################################################### |
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
__END__ |