Mercurial > pub > Impl
comparison Lib/IMPL/Code/MethodCache.pm @ 147:c2aa10fbb396
Post to dom improved
| author | wizard |
|---|---|
| date | Mon, 09 Aug 2010 08:45:36 +0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 146:60fd224f3e3c | 147:c2aa10fbb396 |
|---|---|
| 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; |
