147
|
1 package IMPL::Code::MethodCache;
|
|
2 use strict;
|
|
3 use IMPL qw(Debug);
|
|
4
|
|
5 my %cachedMethods;
|
|
6
|
|
7 sub dbgBuildCachedMethod {
|
|
8 my ($class,$method,$prefix,$mappers)= @_;
|
|
9
|
|
10 no strict 'refs';
|
|
11
|
|
12 $prefix ||= 'call';
|
|
13
|
|
14 my $proxyMethod = "$prefix$method";
|
|
15
|
|
16 die new IMPL::Exception("A proxy method already exists") if *{"${class}::$proxyMethod"}{CODE};
|
|
17
|
|
18 my @methodCache = cacheMethod($class,$method,$mappers);
|
|
19
|
|
20 *{"${class}::$proxyMethod"} = sub {
|
|
21 $_->(@_) foreach @methodCache;
|
|
22 }
|
|
23 }
|
|
24
|
|
25 sub cacheMethod {
|
|
26 my ($class,$method,$mappers) = @_;
|
|
27 }
|
|
28
|
|
29 1; |