annotate Tree/Interval/Node/Constants.pm @ 1:4f6952e0af48 default tip

CREST - add crest.loc.sample
author Jim Johnson <jj@umn.edu>
date Wed, 08 Feb 2012 16:08:01 -0600
parents acc8d8bfeb9a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
1 package Tree::Interval::Node::Constants;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
2
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
3 use strict;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
4 use Carp;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
5 use vars qw( $VERSION @EXPORT );
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
6
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
7 $VERSION = '0.1';
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
8
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
9 require Exporter;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
10 *import = \&Exporter::import;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
11
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
12 my @Node_slots;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
13 my @Node_colors;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
14
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
15 BEGIN {
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
16 @Node_slots = qw(PARENT LEFT RIGHT COLOR KEY VAL MAX INTERVAL);
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
17 @Node_colors = qw(RED BLACK);
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
18 }
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
19
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
20 @EXPORT = (@Node_colors, map {"_$_"} @Node_slots);
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
21
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
22 use enum @Node_colors;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
23 use enum @Node_slots;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
24
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
25 # enum doesn't allow symbols to start with "_", but we want them
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
26 foreach my $s (@Node_slots) {
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
27 no strict 'refs';
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
28 *{"_$s"} = \&$s;
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
29 delete $Tree::RB::Node::Constants::{$s};
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
30 }
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
31
acc8d8bfeb9a Uploaded
jjohnson
parents:
diff changeset
32 1;