00001 /* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ 00002 /* 00003 * Copyright (c) Xerox Corporation 1997. All rights reserved. 00004 * 00005 * License is granted to copy, to use, and to make and to use derivative 00006 * works for research and evaluation purposes, provided that Xerox is 00007 * acknowledged in all documentation pertaining to any such copy or 00008 * derivative work. Xerox grants no other licenses expressed or 00009 * implied. The Xerox trade name should not be used in any advertising 00010 * without its written permission. 00011 * 00012 * XEROX CORPORATION MAKES NO REPRESENTATIONS CONCERNING EITHER THE 00013 * MERCHANTABILITY OF THIS SOFTWARE OR THE SUITABILITY OF THIS SOFTWARE 00014 * FOR ANY PARTICULAR PURPOSE. The software is provided "as is" without 00015 * express or implied warranty of any kind. 00016 * 00017 * These notices must be retained in any copies of any part of this 00018 * software. 00019 */ 00020 00021 #ifndef lint 00022 static const char rcsid[] = 00023 "@(#) $Header: /nfs/jade/vint/CVSROOT/ns-2/adc/null-estimator.cc,v 1.2 1998/06/27 01:24:16 gnguyen Exp $"; 00024 #endif 00025 00026 /* Dummy estimator that only measures actual utilization */ 00027 00028 #include <stdlib.h> 00029 #include "estimator.h" 00030 00031 class Null_Est : public Estimator { 00032 public: 00033 Null_Est(); 00034 protected: 00035 void estimate(); 00036 }; 00037 00038 Null_Est::Null_Est() 00039 { 00040 00041 } 00042 00043 void Null_Est::estimate() { 00044 00045 measload_ = meas_mod_->bitcnt()/period_; 00046 meas_mod_->resetbitcnt(); 00047 00048 } 00049 static class Null_EstClass : public TclClass { 00050 public: 00051 Null_EstClass() : TclClass ("Est/Null") {} 00052 TclObject* create(int,const char*const*) { 00053 return (new Null_Est()); 00054 } 00055 }class_null_est;
1.3.3