📄 lauc-scheduler.h
字号:
/* Copyright (c) University of Maryland, Baltimore County, 2003. * Original Authors: Ramakrishna Shenai, Sunil Gowda and Krishna Sivalingam. * * This software is developed at the University of Maryland, Baltimore County under * grants from Cisco Systems Inc and the University of Maryland, Baltimore County. * * Permission to use, copy, modify, and distribute this software and its * documentation in source and binary forms for non-commercial purposes * and without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both the copyright notice and * this permission notice appear in supporting documentation. and that * any documentation, advertising materials, and other materials related * to such distribution and use acknowledge that the software was * developed by the University of Maryland, Baltimore County. The name of * the University may not be used to endorse or promote products derived from * this software without specific prior written permission. * * Copyright (C) 2000-2003 Washington State University. All rights reserved. * This software was originally developed at Alcatel USA and subsequently modified * at Washington State University, Pullman, WA through research work which was * supported by Alcatel USA, Inc and Cisco Systems Inc. * The following notice is in adherence to the Washington State University * copyright policy follows. * * License is granted to copy, to use, and to make and to use derivative * works for research and evaluation purposes, provided that Washington * State University is acknowledged in all documentation pertaining to any such * copy or derivative work. Washington State University grants no other * licenses expressed or implied. The Washington State University name * should not be used in any advertising without its written permission. * * WASHINGTON STATE UNIVERSITY MAKES NO REPRESENTATIONS CONCERNING EITHER * THE MERCHANTABILITY OF THIS SOFTWARE OR THE SUITABILITY OF THIS SOFTWARE * FOR ANY PARTICULAR PURPOSE. The software is provided "as is" * without express or implied warranty of any kind. These notices must * be retained in any copies of any part of this software. */#ifndef lauc_scheduler_h#define lauc_scheduler_husing namespace std;#include <cassert>#include <cmath>#include <cstdlib>#include <cstring>#include <iostream>#include "../debug.h"#include "../classifier/classifier-base.h"class Debug;class BaseClassifier;class Schedule{ public: // constructs a new schedule object Schedule( int ch = -1, double stime = -1. ){ channel_ = ch; startTime_ = stime; } // accessor and modifiers methods virtual int& channel() { return (channel_); } virtual double& startTime() { return (startTime_); } protected: int channel_; double startTime_;};class LaucScheduler{ public: /* do nothing constructor */ LaucScheduler(){} /* Construct a new Lauc Scheduler object with the provided control and data */ LaucScheduler( u_int ncc, u_int ndc, u_int maxChannels ); /* alloc space and assign ncc ndc and maxChannels */ virtual void alloc( u_int ncc, u_int ndc, u_int maxChannels, BaseClassifier *parent ); /* Schedule a control channel at the proposed schedule time and duration */ virtual Schedule schedControl( double schedTime, double schedDur ); /* Schedule a data channel at the proposed schedule time and duration */ virtual Schedule schedData( double schedTime, double schedDur, int &fdl_count ); /// Accesor and modifiers u_int& ncc() { return ncc_; } u_int& ndc() { return ndc_; } u_int& maxChannels() { return maxChannels_; } // return the destination Node id u_int& destNodeId() { return destNodeId_; } // the per channel bw u_int &chbw() { return chbw_; } // Returns the packets duration virtual double duration( u_int pktsize ); /* Diagnostic method */ virtual void printChInfo( u_int channel ); protected: /* Number of control data and total channels present per-fiber-link */ u_int ncc_, ndc_, maxChannels_; /* Unscheduled time, startTime and the endTime */ double *unschTime_, *startTime_, *endTime_; /* per channel bandwidth */ u_int chbw_; /* destination node id of the lauc-scheduler */ u_int destNodeId_; /* GMG -- added pointer to base classifier whose node this Lauc * scheduler is part of (needed to access FDL scheduler) */ BaseClassifier *bc_; /* search for an appropriate data-schedule */ Schedule search( double schedTime, double schedDur, int &count ); /* update channel information */ void update( u_int channel, double schedTime, double schedDur );};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -