/[VRac]/M6502/Arch.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /M6502/Arch.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56 - (hide annotations)
Tue Jul 31 15:03:23 2007 UTC (16 years, 10 months ago) by dpavlin
File size: 846 byte(s)
another refactoring: extract preferences to Prefs class
1 dpavlin 55 package Arch;
2    
3     # Dobrica Pavlinusic, <dpavlin@rot13.org> 07/30/07 21:40:53 CEST
4    
5     use strict;
6     use warnings;
7    
8     use Data::Dump qw/dump/;
9    
10     =head1 NAME
11    
12     Arch - tie arhitecutre components together
13    
14     =cut
15    
16     =head1 IMPLEMENTATION
17    
18     =head2 init
19    
20     =head2 read
21    
22     =head2 write
23    
24     =head2 cli
25    
26     =cut
27    
28 dpavlin 56 use base qw(Class::Accessor Orao Prefs);
29 dpavlin 55 warn "loaded ",__PACKAGE__,$/;
30    
31 dpavlin 56 my $prefs = { arch => 'Orao' };
32     if(0){
33     $prefs = {
34 dpavlin 55 arch => 'Orao',
35     scale => 1,
36     show_mem => 1,
37     trace => 1,
38     debug => 1,
39     };
40 dpavlin 56 }#if(0)
41 dpavlin 55
42 dpavlin 56 my $arch_name = $prefs->{arch} || die "need arch";
43 dpavlin 55 our $arch = $arch_name->new( $prefs );
44     warn "Arch $arch_name created with prefs = ",dump( $prefs ),"\n";
45     $arch->prefs;
46    
47     sub init {
48     warn "Arch $arch_name init\n";
49     $arch->prefs;
50     $arch->init;
51     $arch->prefs;
52     }
53    
54     sub read { $arch->read( @_ ) };
55     sub write { $arch->write( @_ ) };
56     sub cli { $arch->cli( @_ ) };
57    
58     1;

  ViewVC Help
Powered by ViewVC 1.1.26