lib/Ekahau/Response/AreaList.pm

filter: Statementstmt 83.3% 35 / 42 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 66.6% 4 / 6 totaltotal 79.3% 50 / 63 CC 3 SCAR 3.8
CC
3
Cov
80%
create_area
2.0
init
2.0
get
2.0
CRAP 1.5
« lib/Ekahau/Response/LocationContext.pm ↑ Summary lib/Ekahau/Response/LocationEstimate.pm »
1 package Ekahau::Response::AreaList;
2 15 ▶use base 'Ekahau::Response'; our $VERSION=Ekahau::Response::VERSION;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 # Written by Scott Gifford <gifford@umich.edu>
5 # Copyright (C) 2004 The Regents of the University of Michigan.
6 # See the file LICENSE included with the distribution for license
7 # information.
8  
9 15 ▶use Ekahau::Response::Area;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 15 ▶use constant AREA_CLASS => 'Ekahau::Response::Area';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 =head1 NAME
16  
17 Ekahau::Response::AreaList - Represents a list of areas contained in an Ekahau response
18  
19 =head1 SYNOPSIS
20  
21 Contains information about a list of areas, possibly from an
22 L<Ekahau::Response::AreaEstimate|Ekahau::Response::AreaEstimate> object.
23  
24 =head1 DESCRIPTION
25  
26 =head2 Constructor
27  
28 Generally you will not want to construct these objects yourself; they
29 are created by L<Ekahau::Response|Ekahau::Response>, and use its constructor.
30  
31 =head2 Methods
32  
33 =cut
34  
35 # Internal method
36 sub init
37 11 ▶{
Subroutine init: called CC=2 SCAR=7.0
Pod undocumented
38 11 my $self = shift;
39  
40 warn "Created Ekahau::Response::AreaList object\n"
41 11 ▶ if ($ENV{VERBOSE});
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"VERBOSE"} 0 11 11
42 11 $self->{_areas}=[ map { $self->create_area($_) } @{$self->{params}{AREA}} ];
43 11 1;
44 }
45  
46 # Internal method
47 sub create_area
48 29 ▶{
Subroutine create_area: called CC=2 SCAR=7.1
Pod undocumented
49 29 my $self = shift;
50 29 my($area)=@_;
51
52 0 ▶ if (!$area) { return undef; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($area) 0 29 29
53
54 29 my $new = { %$self };
55 29 $new->{params} = { %$area };
56 29 bless $new,AREA_CLASS;
57 29 $new->init;
58 29 $new;
59 }
60  
61 =head3 get ( $which )
62  
63 Return L<Ekahau::Response::Area|Ekahau::Response::Area> object number C<$which>.
64  
65 =cut
66  
67 sub get
68 0 ▶{
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
69 0 my $self = shift;
70
71 0 my($which)=@_;
72 0 return $self->{_areas}[$which];
73 }
74  
75 =head3 get_all ( )
76  
77 Return all L<Ekahau::Response::Area|Ekahau::Response::Area> objects in this list.
78  
79 =cut
80  
81 sub get_all
82 3 ▶{
Subroutine get_all: called CC=1 SCAR=0.0
Pod documented
83 3 my $self = shift;
84
85 3 return @{$self->{_areas}};
86 }
87  
88 =head3 num_areas
89  
90 Returns the number of areas in this object
91  
92 =cut
93  
94 sub num_areas
95 0 ▶{
Subroutine num_areas: not called CC=1 SCAR=6.9
Pod documented
96 0 my $self = shift;
97
98 0 return scalar(@{$self->{_areas}});
99 }
100  
101 =head3 type ( )
102  
103 Returns the string I<AreaList>, to identify the type of this object.
104 Note that subclasses of this class will override this method,
105 returning their own type string.
106  
107 =cut
108  
109 sub type
110 2 ▶{
Subroutine type: called CC=1 SCAR=0.0
Pod documented
111 2 'AreaList';
112 }
113  
114 =head1 AUTHOR
115  
116 Scott Gifford E<lt>gifford@umich.eduE<gt>, E<lt>sgifford@suspectclass.comE<gt>
117  
118 Copyright (C) 2005 The Regents of the University of Michigan.
119  
120 See the file LICENSE included with the distribution for license
121 information.
122  
123  
124 =head1 SEE ALSO
125  
126 L<Ekahau::Response|Ekahau::Response>, L<Ekahau::Response::Area|Ekahau::Response::Area>, L<Ekahau::Response::AreaEstimate|Ekahau::Response::AreaEstimate>.
127  
128 =cut
129  
130  
131 15 1;
« lib/Ekahau/Response/LocationContext.pm ↑ Summary lib/Ekahau/Response/LocationEstimate.pm »