QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/third_party/quiche/src/quic/test_tools/simulator/actor.h" |
| 6 | #include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h" |
| 7 | |
| 8 | namespace quic { |
| 9 | namespace simulator { |
| 10 | |
vasilvv | c48c871 | 2019-03-11 13:38:16 -0700 | [diff] [blame] | 11 | Actor::Actor(Simulator* simulator, std::string name) |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 12 | : simulator_(simulator), |
| 13 | clock_(simulator->GetClock()), |
| 14 | name_(std::move(name)) { |
| 15 | simulator_->AddActor(this); |
| 16 | } |
| 17 | |
| 18 | Actor::~Actor() { |
| 19 | simulator_->RemoveActor(this); |
| 20 | } |
| 21 | |
| 22 | void Actor::Schedule(QuicTime next_tick) { |
| 23 | simulator_->Schedule(this, next_tick); |
| 24 | } |
| 25 | |
| 26 | void Actor::Unschedule() { |
| 27 | simulator_->Unschedule(this); |
| 28 | } |
| 29 | |
| 30 | } // namespace simulator |
| 31 | } // namespace quic |