Switch.cc (6493:1fa51760a963) | Switch.cc (7002:48a19d52d939) |
---|---|
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 | 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(ostream& out) const | 132void Switch::printStats(std::ostream& out) const |
133{ | 133{ |
134 using namespace std; 135 |
|
134 out << "switch_" << m_switch_id << "_inlinks: " << m_perfect_switch_ptr->getInLinks() << endl; 135 out << "switch_" << m_switch_id << "_outlinks: " << m_perfect_switch_ptr->getOutLinks() << endl; 136 137 // Average link utilizations 138 double average_utilization = 0.0; 139 int throttle_count = 0; 140 141 for (int i=0; i<m_throttles.size(); i++) { --- 41 unchanged lines hidden (view full) --- 183 m_perfect_switch_ptr->clearStats(); 184 for (int i=0; i<m_throttles.size(); i++) { 185 if (m_throttles[i] != NULL) { 186 m_throttles[i]->clearStats(); 187 } 188 } 189} 190 | 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 |
191void Switch::printConfig(ostream& out) const | 193void Switch::printConfig(std::ostream& out) const |
192{ 193 m_perfect_switch_ptr->printConfig(out); 194 for (int i=0; i<m_throttles.size(); i++) { 195 if (m_throttles[i] != NULL) { 196 m_throttles[i]->printConfig(out); 197 } 198 } 199} 200 | 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 |
201void Switch::print(ostream& out) const | 203void Switch::print(std::ostream& out) const |
202{ 203 // FIXME printing 204 out << "[Switch]"; 205} 206 | 204{ 205 // FIXME printing 206 out << "[Switch]"; 207} 208 |