00001 /* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ 00002 /* 00003 * ctrMcast.cc 00004 * Copyright (C) 1997 by USC/ISI 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms are permitted 00008 * provided that the above copyright notice and this paragraph are 00009 * duplicated in all such forms and that any documentation, advertising 00010 * materials, and other materials related to such distribution and use 00011 * acknowledge that the software was developed by the University of 00012 * Southern California, Information Sciences Institute. The name of the 00013 * University may not be used to endorse or promote products derived from 00014 * this software without specific prior written permission. 00015 * 00016 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 00017 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 00018 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00019 * 00020 * Contributed by Polly Huang (USC/ISI), http://www-scf.usc.edu/~bhuang 00021 * 00022 * @(#) $Header: /nfs/jade/vint/CVSROOT/ns-2/queue/delaymodel.h,v 1.6 2000/09/01 03:04:05 haoboy Exp $ (UCB) 00023 */ 00024 00025 #ifndef ns_delaymodel_h 00026 #define ns_delaymodel_h 00027 00028 #include "connector.h" 00029 #include "ranvar.h" 00030 00031 00032 class DelayModel : public Connector { 00033 public: 00034 DelayModel(); 00035 void recv(Packet*, Handler*); 00036 inline double txtime(Packet* p) { 00037 hdr_cmn *hdr = hdr_cmn::access(p); 00038 return bandwidth_ ? (hdr->size() * 8. / bandwidth_) : 0; 00039 } 00040 double bandwidth() const { return bandwidth_; } 00041 00042 protected: 00043 int command(int argc, const char*const* argv); 00044 RandomVariable* ranvar_; 00045 double bandwidth_; /* bandwidth of underlying link (bits/sec) */ 00046 //Event intr_; 00047 }; 00048 00049 #endif
1.3.3