1 2/* 3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 115 unchanged lines hidden (view full) --- 124 return m_throttles[link_number]; 125} 126 127const Vector<Throttle*>* Switch::getThrottles() const 128{ 129 return &m_throttles; 130} 131 |
132void Switch::printStats(std::ostream& out) const |
133{ |
134 using namespace std; 135 |
136 out << "switch_" << m_switch_id << "_inlinks: " << m_perfect_switch_ptr->getInLinks() << endl; 137 out << "switch_" << m_switch_id << "_outlinks: " << m_perfect_switch_ptr->getOutLinks() << endl; 138 139 // Average link utilizations 140 double average_utilization = 0.0; 141 int throttle_count = 0; 142 143 for (int i=0; i<m_throttles.size(); i++) { --- 41 unchanged lines hidden (view full) --- 185 m_perfect_switch_ptr->clearStats(); 186 for (int i=0; i<m_throttles.size(); i++) { 187 if (m_throttles[i] != NULL) { 188 m_throttles[i]->clearStats(); 189 } 190 } 191} 192 |
193void Switch::printConfig(std::ostream& out) const |
194{ 195 m_perfect_switch_ptr->printConfig(out); 196 for (int i=0; i<m_throttles.size(); i++) { 197 if (m_throttles[i] != NULL) { 198 m_throttles[i]->printConfig(out); 199 } 200 } 201} 202 |
203void Switch::print(std::ostream& out) const |
204{ 205 // FIXME printing 206 out << "[Switch]"; 207} 208 |