Sequence/Message.pm

filter: Statementstmt 45.0% 9 / 20 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 31.5% 12 / 38 CC 6 SCAR 24.8
CC
6
Cov
29%
recv_time
20.0
new
12.0
BEGIN
1.0
CRAP 11.9
« Sequence/Layout.pm ↑ Summary Sequence/Object.pm »
1 package Chart::Sequence::Message;
2  
3 $VERSION = 0.000_1;
4  
5 =head1 NAME
6  
7 Chart::Sequence::Message - A message in a Chart::Sequence.
8  
9 =head1 SYNOPSIS
10  
11 =head1 DESCRIPTION
12  
13 =cut
14  
15 1 ▶use Chart::Sequence::Object ();
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 @ISA = qw( Chart::Sequence::Object );
18  
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
23 0 my $proto = shift;
24 0 ▶ if ( @_ == 1 && ref $_[0] eq "ARRAY" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1 and ref $_[0] eq "ARRAY") 0 0 0
Condition0%0/3
@_ == 1 and ref $_[0] eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
@_ == 1 and ref $_[0] eq "ARRAY"
@_ == 1 ref $_[0] eq "ARRAY"
Truth table0%0/3
A and B
A= @_ == 1B= ref $_[0] eq "ARRAY"
ABresult
0X0
100
111
25 0 my @fields = qw( From To Name );
26 0 @_ = map { ( shift @fields => $_ ) } @{shift()};
27 }
28 0 return $proto->SUPER::new( @_ );
29 }
30  
31  
32 __PACKAGE__->make_methods(qw(
33 number
34 send_time
35 name
36 from
37 to
38 description
39 color
40 URI
41 _layout_info
42 ));
43  
44 0 ▶sub recv_time {
Subroutine recv_time: not called CC=4 SCAR=30.0
45 0 my $self = shift;
46 0 ▶ Carp::croak "Too many parameters passed" if @_ > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 0 0
47 0 ▶ $self->{RecvTime} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
48 0 ▶ return defined $self->{RecvTime} ? $self->{RecvTime} : $self->{SendTime};
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'RecvTime'} ? : 0 0 0
49 }
50  
51 =head1 DATA MEMBERS
52  
53 =over
54  
55 =item number
56  
57 (1..N) The number of the message in the sequence. Assigned by the
58 Chart::Sequence as messages are added to it.
59  
60 =item name
61  
62 The name of the message. This is displayed on the arrow
63  
64 =item send_time
65  
66 The time the message was sent: an integer or floating point value. The time
67 format (ie the units for this value) is set in the parent sequence for now.
68 This may be seconds since the epoch, seconds since the start of the sequence,
69 or just a message order.
70  
71 =item recv_time
72  
73 The time the message was received. Defaults to send_time if unset.
74  
75 =item from
76  
77 What entity sent the message.
78  
79 =item to
80  
81 What entity received the message.
82  
83 =item description
84  
85 A longer textual description, displayed according to the rendering. NOTE:
86 we may well add some primitive HTML rendering to this, not sure.
87  
88 =item color
89  
90 What color to use for the font and the line.
91  
92 =item URI
93  
94 A URI to use when rendering clickable resources.
95  
96 =back
97  
98 =head1 LIMITATIONS
99  
100 =head1 COPYRIGHT
101  
102 Copyright 2002, R. Barrie Slaymaker, Jr., All Rights Reserved
103  
104 =head1 LICENSE
105  
106 You may use this module under the terms of the BSD, Artistic, oir GPL licenses,
107 any version.
108  
109 =head1 AUTHOR
110  
111 Barrie Slaymaker <barries@slaysys.com>
112  
113 =cut
114  
115 1;
« Sequence/Layout.pm ↑ Summary Sequence/Object.pm »