OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2012,2014 University of Zagreb |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Vedran Miletić <rivanvx@gmail.com> |
| 19 */ |
| 20 |
| 21 #include "failure-repair-time-tracker-container.h" |
| 22 |
| 23 #include <ns3/failure-repair-time-tracker.h> |
| 24 |
| 25 namespace ns3 { |
| 26 |
| 27 FailureRepairTimeTrackerContainer::FailureRepairTimeTrackerContainer () |
| 28 { |
| 29 } |
| 30 |
| 31 FailureRepairTimeTrackerContainer::FailureRepairTimeTrackerContainer (Ptr<Failur
eRepairTimeTracker> fwtt) |
| 32 { |
| 33 m_failedWorkingTimeTrackers.push_back (fwtt); |
| 34 } |
| 35 |
| 36 FailureRepairTimeTrackerContainer::FailureRepairTimeTrackerContainer (const Fail
ureRepairTimeTrackerContainer &a, const FailureRepairTimeTrackerContainer &b) |
| 37 { |
| 38 *this = a; |
| 39 Add (b); |
| 40 } |
| 41 |
| 42 FailureRepairTimeTrackerContainer::Iterator· |
| 43 FailureRepairTimeTrackerContainer::Begin (void) const |
| 44 { |
| 45 return m_failedWorkingTimeTrackers.begin (); |
| 46 } |
| 47 |
| 48 FailureRepairTimeTrackerContainer::Iterator· |
| 49 FailureRepairTimeTrackerContainer::End (void) const |
| 50 { |
| 51 return m_failedWorkingTimeTrackers.end (); |
| 52 } |
| 53 |
| 54 uint32_t· |
| 55 FailureRepairTimeTrackerContainer::GetN (void) const |
| 56 { |
| 57 return m_failedWorkingTimeTrackers.size (); |
| 58 } |
| 59 |
| 60 Ptr<FailureRepairTimeTracker>· |
| 61 FailureRepairTimeTrackerContainer::Get (uint32_t i) const |
| 62 { |
| 63 return m_failedWorkingTimeTrackers[i]; |
| 64 } |
| 65 |
| 66 void· |
| 67 FailureRepairTimeTrackerContainer::Create (uint32_t n) |
| 68 { |
| 69 for (uint32_t i = 0; i < n; i++) |
| 70 { |
| 71 m_failedWorkingTimeTrackers.push_back (CreateObject<FailureRepairTimeTrack
er> ()); |
| 72 } |
| 73 } |
| 74 |
| 75 void· |
| 76 FailureRepairTimeTrackerContainer::Add (FailureRepairTimeTrackerContainer other) |
| 77 { |
| 78 for (Iterator i = other.Begin (); i != other.End (); i++) |
| 79 { |
| 80 m_failedWorkingTimeTrackers.push_back (*i); |
| 81 } |
| 82 } |
| 83 |
| 84 void· |
| 85 FailureRepairTimeTrackerContainer::Add (Ptr<FailureRepairTimeTracker> fwtt) |
| 86 { |
| 87 m_failedWorkingTimeTrackers.push_back (fwtt); |
| 88 } |
| 89 |
| 90 } // namespace ns3 |
OLD | NEW |