diff Lib/IMPL/Code/MethodCache.pm @ 147:c2aa10fbb396

Post to dom improved
author wizard
date Mon, 09 Aug 2010 08:45:36 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/Code/MethodCache.pm	Mon Aug 09 08:45:36 2010 +0400
@@ -0,0 +1,29 @@
+package IMPL::Code::MethodCache;
+use strict;
+use IMPL qw(Debug);
+
+my %cachedMethods;
+
+sub dbgBuildCachedMethod {
+	my ($class,$method,$prefix,$mappers)= @_;
+	
+	no strict 'refs';
+	
+	$prefix ||= 'call';
+	
+	my $proxyMethod = "$prefix$method";
+	
+	die new IMPL::Exception("A proxy method already exists") if *{"${class}::$proxyMethod"}{CODE};
+	
+	my @methodCache = cacheMethod($class,$method,$mappers);
+	
+	*{"${class}::$proxyMethod"} = sub {
+		$_->(@_) foreach @methodCache;
+	}
+}
+
+sub cacheMethod {
+	my ($class,$method,$mappers) = @_;
+}
+
+1;
\ No newline at end of file