letter.cpp

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