Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / IPC / Run3 / ProfArrayBuffer.pm
1 package IPC::Run3::ProfArrayBuffer;
2
3 $VERSION = 0.043;
4
5 =head1 NAME
6
7 IPC::Run3::ProfArrayBuffer - Store profile events in RAM in an array
8
9 =head1 SYNOPSIS
10
11 =head1 DESCRIPTION
12
13 =cut
14
15 use strict;
16
17 =head1 METHODS
18
19 =over
20
21 =item C<< IPC::Run3::ProfArrayBuffer->new() >>
22
23 =cut
24
25 sub new {
26     my $class = ref $_[0] ? ref shift : shift;
27
28     my $self = bless { @_ }, $class;
29
30     $self->{Events} = [];
31
32     return $self;
33 }
34
35 =item C<< $buffer->app_call(@events) >>
36
37 =item C<< $buffer->app_exit(@events) >>
38
39 =item C<< $buffer->run_exit(@events) >>
40
41 The three above methods push the given events onto the stack of recorded
42 events.
43
44 =cut
45
46 for my $subname ( qw(app_call app_exit run_exit) ) {
47   no strict 'refs';
48   *{$subname} = sub {
49       push @{shift->{Events}}, [ $subname => @_ ];
50   };
51 }
52
53 =item get_events
54
55 Returns a list of all the events.  Each event is an ARRAY reference
56 like:
57
58    [ "app_call", 1.1, ... ];
59
60 =cut
61
62 sub get_events {
63     my $self = shift;
64     @{$self->{Events}};
65 }
66
67 =back
68
69 =head1 LIMITATIONS
70
71 =head1 COPYRIGHT
72
73 Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved
74
75 =head1 LICENSE
76
77 You may use this module under the terms of the BSD, Artistic, or GPL licenses,
78 any version.
79
80 =head1 AUTHOR
81
82 Barrie Slaymaker E<lt>barries@slaysys.comE<gt>
83
84 =cut
85
86 1;