letter.cpp

Go to the documentation of this file.
00001 #ifndef LETTER_IMPLEMENTATION_FILE
00002 #define LETTER_IMPLEMENTATION_FILE
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : letter                                                            *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1998-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "letter.h"
00019 
00020 #include <basis/istring.h>
00021 #include <basis/function.h>
00022 #include <mechanisms/time_stamp.h>
00023 
00024 letter::letter(int type, int start_after)
00025 : _type(type),
00026   _ready_time(new time_stamp(start_after))
00027 {}
00028 
00029 letter::letter(const letter &to_copy)
00030 : _type(to_copy._type),
00031   _ready_time(new time_stamp(*to_copy._ready_time))
00032 {
00033 }
00034 
00035 letter::~letter()
00036 {
00037   _type = 0;
00038   WHACK(_ready_time);
00039 }
00040 
00041 bool letter::ready_to_send() { return time_stamp() >= *_ready_time; }
00042 
00043 void letter::set_ready_time(int start_after)
00044 { *_ready_time = time_stamp(start_after); }
00045 
00046 letter &letter::operator =(const letter &to_copy)
00047 {
00048   if (this == &to_copy) return *this;
00049   _type = to_copy._type;
00050   *_ready_time = *to_copy._ready_time;
00051   return *this;
00052 }
00053 
00054 
00055 
00056 #endif //LETTER_IMPLEMENTATION_FILE
00057 

Generated on Fri Nov 28 04:29:30 2008 for HOOPLE Libraries by  doxygen 1.5.1