/[cvs]/nfo/perl/libs/Data/Storage/Handler/Abstract.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage/Handler/Abstract.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Fri Nov 29 04:58:20 2002 UTC revision 1.6 by joko, Tue Dec 3 15:52:24 2002 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.6  2002/12/03 15:52:24  joko
7    #  + fix/feature: if dispatching to deep core method fails (is not declared), try method at Data::Storage - level
8    #
9    #  Revision 1.5  2002/12/01 22:19:33  joko
10    #  + just disconnect if COREHANDLE exists
11    #
12    #  Revision 1.4  2002/12/01 04:45:38  joko
13    #  + sub eraseAll
14    #  + sub createDb
15    #
16  #  Revision 1.3  2002/11/29 04:58:20  joko  #  Revision 1.3  2002/11/29 04:58:20  joko
17  #  + Storage::Result now uses the same dispatching mechanism like Storage::Handler  #  + Storage::Result now uses the same dispatching mechanism like Storage::Handler
18  #  #
# Line 116  sub AUTOLOAD { Line 126  sub AUTOLOAD {
126            
127      # method calls doing it until here will get dispatched to the proper handler      # method calls doing it until here will get dispatched to the proper handler
128      return $self->{COREHANDLE}->$methodname(@_);      return $self->{COREHANDLE}->$methodname(@_);
129      
130      } elsif ($self->can($methodname)) {
131        return $self->$methodname(@_);
132    }    }
133    
134  }  }
# Line 129  sub DESTROY { Line 142  sub DESTROY {
142    
143      # call "disconnect" or alike on COREHANDLE      # call "disconnect" or alike on COREHANDLE
144      # was: $self->{COREHANDLE}->disconnect();      # was: $self->{COREHANDLE}->disconnect();
145      $disconnectMethod && ( $self->{COREHANDLE}->$disconnectMethod() );      $disconnectMethod && $self->{COREHANDLE} && ( $self->{COREHANDLE}->$disconnectMethod() );
146    
147      undef $self->{COREHANDLE};      undef $self->{COREHANDLE};
148    }    }
# Line 182  sub _typeCheck { Line 195  sub _typeCheck {
195    # TODO:    # TODO:
196    #   - abstract "abstract methods" to list/hash to be used in AUTOLOAD    #   - abstract "abstract methods" to list/hash to be used in AUTOLOAD
197    #      e.g.: my @ABSTRACT_METHODS = (qw( connect sendCommand getChildNodes ));    #      e.g.: my @ABSTRACT_METHODS = (qw( connect sendCommand getChildNodes ));
198      #      use Class::XYZ (Construct)
199    #   - build them via anonymous subs    #   - build them via anonymous subs
200    #   - introduce them via symbols    #   - introduce them via symbols
201    
# Line 242  sub _typeCheck { Line 256  sub _typeCheck {
256      return;      return;
257    }    }
258    
259      sub eraseAll {
260        my $self = shift;
261        $self->_abstract_function('eraseAll');
262        return;
263      }
264    
265      sub createDb {
266        my $self = shift;
267        $self->_abstract_function('createDb');
268        return;
269      }
270    
271  1;  1;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed