"Fossies" - the Fresh Open Source Software Archive

Member "email-reminder-0.8.1/EmailReminder/EventStore.pm" (11 Sep 2020, 1398 Bytes) of package /linux/privat/email-reminder-0.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "EventStore.pm" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.7.8_vs_0.8.0.

    1 # This file is part of Email-Reminder.
    2 #
    3 # Email-Reminder is free software; you can redistribute it and/or
    4 # modify it under the terms of the GNU General Public License as
    5 # published by the Free Software Foundation; either version 3 of the
    6 # License, or (at your option) any later version.
    7 #
    8 # Email-Reminder is distributed in the hope that it will be useful,
    9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11 # General Public License for more details.
   12 #
   13 # You should have received a copy of the GNU General Public License
   14 # along with Email-Reminder; if not, write to the Free Software
   15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
   16 # 02110-1301, USA.
   17 
   18 package EmailReminder::EventStore;
   19 
   20 # Base class for all of the event stores.
   21 # 
   22 # This class should never be used directly, use a derived class instead.
   23 
   24 use strict;
   25 use warnings;
   26 
   27 sub new
   28 {
   29     my $class = shift;
   30     my $self = {};
   31     bless $self, $class;
   32     return $self;
   33 }
   34 
   35 sub init
   36 {
   37     my ($self) = @_;
   38     $self->{EVENTS} = [];
   39     $self->{NB_EVENTS} = 0;
   40     return 1;
   41 }
   42 
   43 sub add_event
   44 {
   45     my ($self, $event) = @_;
   46     push (@{$self->{EVENTS}}, $event);
   47     $self->{NB_EVENTS}++;
   48 }
   49 
   50 sub get_nb_events
   51 {
   52     my ($self) = @_;
   53     return $self->{NB_EVENTS};
   54 }
   55 
   56 sub get_events
   57 {
   58     my ($self) = @_;
   59     return $self->{EVENTS};
   60 }
   61 
   62 1;