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 "quiche/quic/test_tools/simulator/actor.h" 6 7 #include "quiche/quic/test_tools/simulator/simulator.h" 8 9 namespace quic { 10 namespace simulator { 11 Actor(Simulator * simulator,std::string name)12Actor::Actor(Simulator* simulator, std::string name) 13 : simulator_(simulator), 14 clock_(simulator->GetClock()), 15 name_(std::move(name)) { 16 simulator_->AddActor(this); 17 } 18 ~Actor()19Actor::~Actor() { simulator_->RemoveActor(this); } 20 Schedule(QuicTime next_tick)21void Actor::Schedule(QuicTime next_tick) { 22 simulator_->Schedule(this, next_tick); 23 } 24 Unschedule()25void Actor::Unschedule() { simulator_->Unschedule(this); } 26 27 } // namespace simulator 28 } // namespace quic 29