Changeset 167
- Timestamp:
- 12/19/05 19:57:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/ObsData/ObsData/Event.pm
- Property cvs2svn:cvs-rev changed from 1.1 to 1.2
r166 r167 5 5 6 6 package ObsData::Event; 7 8 =head1 NAME 9 10 ObsData::Event - A simple class to manage message between backend 11 and main software. 12 13 =head1 SYNOPSIS 14 15 my $callback = sub { 16 my ($events) = @_; 17 print $events->message . "\n"; 18 } 19 20 my $oe = ObsData::Event->new('id', 'what should I do'); 21 22 $callback($oe); 23 24 =head1 METHODS 25 26 =head2 new($id $message) 27 28 Create a new ObsData::Event object to handle $message with $id 29 30 =cut 7 31 8 32 sub new { … … 24 48 } 25 49 50 =head2 id 51 52 Return the id of the object 53 54 =cut 55 26 56 sub id { 27 57 my ($self) = @_; … … 29 59 } 30 60 61 =head2 message 62 63 Return the message handle by the object 64 65 =cut 66 31 67 sub message { 32 68 my ($self) = @_; 33 69 return($self->{message}); 34 70 } 71 72 =head2 add_test($test_id, $message, $result) 73 74 Add a new test into the object. 75 76 =cut 35 77 36 78 sub add_test { … … 43 85 } 44 86 87 =head2 list_test 88 89 List test currently stored into the object. Return the list of test id. 90 91 =cut 92 45 93 sub list_test { 46 94 my ($self) = @_; … … 48 96 } 49 97 98 =head2 test_message($test_id) 99 100 Return the message associated to a test. 101 102 =cut 103 50 104 sub test_message { 51 105 my ($self, $test_id) = @_; 52 106 return($self->{test}{$test_id}{message}); 53 107 } 108 109 =head2 test_result($test_id) 110 111 Return the result associated to a test 112 113 =cut 54 114 55 115 sub test_result { … … 60 120 1; 61 121 122 __END__ 123 124 =head1 AUTHOR 125 126 Olivier Thauvin <olivier.thauvin@aerov.jussieu.fr> 127 128 =cut
Note: See TracChangeset
for help on using the changeset viewer.