diff Lib/IMPL/Object.pm @ 276:8a5da17d7ef9

*IMPL::Class refactoring property definition mechanism (incomplete).
author sergey
date Thu, 31 Jan 2013 17:37:44 +0400
parents 6d8092d8ce1b
children 4ddb27ff4a0b
line wrap: on
line diff
--- a/Lib/IMPL/Object.pm	Thu Jan 31 02:18:31 2013 +0400
+++ b/Lib/IMPL/Object.pm	Thu Jan 31 17:37:44 2013 +0400
@@ -3,13 +3,12 @@
 
 use parent qw(IMPL::Object::Abstract);
 require IMPL::Class::Property::Direct;
+use IMPL::Const qw(:prop);
 
 sub surrogate {
     bless {}, ref $_[0] || $_[0];
 }
 
-__PACKAGE__->static_accessor( propertyInfoClass => 'IMPL::Class::DirectPropertyInfo' );
-
 sub new {
     my $class = shift;
     my $self = bless {}, ref($class) || $class;    
@@ -22,6 +21,18 @@
     'IMPL::Class::Property::Direct'
 }
 
+sub ImplementProperty {
+	my ($self,$name,$attributes) = @_;
+	
+	$attributes = {
+        get => $attributes & PROP_GET,
+        set => $attributes & PROP_SET,
+        isList => $attributes & PROP_LIST
+    } unless ref $attributes;
+    
+    $self->_ProppertyImplementor->Implement($name,$attributes);
+}
+
 1;
 
 __END__