diff Lib/IMPL/Class/Property/Base.pm @ 60:b0c068da93ac

Lazy activation for the configuration objects (final concept) small fixes
author wizard
date Tue, 09 Mar 2010 19:47:39 +0300
parents 0f3e369553bd
children 76b878ad6596
line wrap: on
line diff
--- a/Lib/IMPL/Class/Property/Base.pm	Tue Mar 09 02:50:45 2010 +0300
+++ b/Lib/IMPL/Class/Property/Base.pm	Tue Mar 09 19:47:39 2010 +0300
@@ -5,7 +5,7 @@
 
 require IMPL::Class::Member;
 
-our @factoryParams = qw($class $name $set $get $validator);
+sub factoryParams { qw($class $name $set $get $validator) };
 
 my %factoryCache;
 
@@ -56,20 +56,20 @@
 }
 
 sub GenerateSet {
-	die new IMPL::Exception("Standard accessors not supported");
+	die new IMPL::Exception("Standard accessors not supported",'Set');
 }
 	
 sub GenerateGet {
-	die new IMPL::Exception("Standard accessors not supported");
+	die new IMPL::Exception("Standard accessors not supported",'Get');
 }
 
 sub GenerateGetList {
-	die new IMPL::Exception("Standard accessors not supported");
+	die new IMPL::Exception("Standard accessors not supported",'GetList');
 }
 
 sub GenerateSetList {
 	my ($self) = @_;
-	die new IMPL::Exception("Standard accessors not supported");
+	die new IMPL::Exception("Standard accessors not supported",'SetList');
 }
 
 sub Make {
@@ -101,9 +101,11 @@
 	if (ref $mutators) {
 		$propInfo->canGet( $mutators->{get} ? 1 : 0 );
 		$propInfo->canSet( $mutators->{set} ? 1 : 0 );
+		$propInfo->ownerSet(0);
 	} else {
 		$propInfo->canGet( $mutators & prop_get );
 		$propInfo->canSet( $mutators & prop_set );
+		$propInfo->ownerSet( ($mutators & owner_set) == owner_set );
 	}
 }
 
@@ -133,7 +135,10 @@
 	
 	my ($access,$mutators,$validator) = ($propInfo->get(qw(Access Mutators)),$propInfo->Attributes->{validator});
 	
+	my $implementor = ref $self || $self;
+	
 	return join ('',
+		$implementor,
 		$access,
 		$validator ? 'v' : 'n',
 		ref $mutators ?
@@ -146,7 +151,7 @@
 sub CreateFactory {
 	my ($self,$codeAccessCheck,$codeValidator,$codeOwnerCheck,$codeGet,$codeSet) = @_;
 	
-	my $strParams = join(',',@factoryParams);
+	my $strParams = join(',',$self->factoryParams);
 	
 	my $factory = <<FACTORY;