Deleted Added
sdiff udiff text old ( 6493:1fa51760a963 ) new ( 7002:48a19d52d939 )
full compact
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
133{
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
191void Switch::printConfig(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
201void Switch::print(ostream& out) const
202{
203 // FIXME printing
204 out << "[Switch]";
205}
206